How to close the parent process.

Hello World
I am trying to open the external process like word using Runtime.exec(). The code below works perfectly fine. But I want to close the parent process. And only word file should remain on. How to do this? Experts please comment.
Regards,
Sachin Dare.
import java.io.*;
class Test {
public static void main(String[] args) {
try {
String cmd[] = new String[3];
cmd[0]= "cmd.exe";
cmd[1]= "/C";
cmd[2]= "C:\\Sachin\\EvicDocs\\sst58.doc";
Process process = Runtime.getRuntime().exec(cmd);
if(process != null) {
StreamHandler errorGobbler = new StreamHandler(process.getErrorStream(), "ERROR");
StreamHandler outputGobbler = new StreamHandler(process.getInputStream(), "OUTPUT");
errorGobbler.start();
outputGobbler.start();
int exitVal = process.waitFor();
System.out.println(" Exit Value is : " + exitVal);
if(exitVal != 0) {
throw new Exception();
} else {
System.out.println("Process is destroying......");
process.destroy();
catch(Exception e) {
e.printStackTrace();
class StreamHandler extends Thread {
InputStream is;
String type;
StreamHandler(InputStream is, String type) {
this.is = is;
this.type = type;
public void run() {
try {
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
String line=null;
while ( (line = br.readLine()) != null) {
System.out.println(type + ">" + line);
br.close();
isr.close();
} catch (Exception e) {
e.printStackTrace();
}

If you mean by "parent process " the java one starting e.g. Word, then say System.exit() after having launched the child process. Hopefully Word will not take care of stdin, stdout or err so this arrangement will be okay.

Similar Messages

  • How to determine the Parent process information in Oracle BPMS 10g

    Hi ,
    I am trying to retrieve the parent process information given the instanceId and Process Id of an instance of a process from a different process.
    I am getting the instanceId of the instance in workspace using the Fuego.Papi.ProcessService and by creating the Filter.
    I tried using the ProcessInstance.parent but it needs to be instantiated using the instance details of my referred instance, which i am not able to do.
    Can some one shed some light on how to get the parent process details from the referred instance.
    Thanks,
    shravan.

    Hi,
    If you mean to increase the request timeout i.e the time when a request is submitted to the server and the response is sent by the server it can be done in httpd.conf file located in $OracleHome/Apache/Apache/conf directory.
    The attribute to be used for setting timeout is "Timeout". By default teh value is 600 seconds i.e 5 minutes.
    After making these changes , run command dcmctl updateConfig -ct OHS and restart the HTTP Server. Please note these commands need to be run only if the httpd.conf changes are done through text editor.
    Hope this helps.
    Smita

  • How to check the parent process chain of a meta chain

    Hello Friends,
    Recently I joined a new project, which is of environment BW 3.0. I am trying to find the dependent process chain's parent, but could'nt able to find them. I went through all the process chains manually to check whther the dependent process chain is mentioned in them, but could'nt find any......
    Can any of you help me to know how to find the parent process chain of a meta chain ?
    I really appreciate your time, will be awarding points to any answers.......
    Thanks,

    Hello Radhan,
    thanks for your quick reply. I searched the table based on your advice, but i could'nt get the parent process chain's name. Can you throw some more ideas please..........
    Thanks,

  • How to find the Parent process in workflow

    Hi all,
    I have a .wft file with me.
    It contains atleast 8 processess.
    I need to understand the flow of this workflow.
    How do i getto know the flow?
    How do I getto know the parent process?
    I am sure if i know the parent process then i can figure out the flow as well.
    Hope someone can help me in thisproblem.
    Thanks in anticipation.
    regards.

    Hello,
    You can open the .wft file using the Workflow builder and see visually how the processes are designed. You can also see which processes are used as sub processes. These will be your children flows.
    Cheers,
    Raja

  • How to Get the Parent Process ID from Child BPEL Process

    Hi All,
    We have a requirement to get the Parent BPEL Process ID from Child BPEL Process. One way is we can pass the Parent BPEL process ID from Parent BPEL Process to Child BPEL process. Is there any standard function available to get the Parent BPEL process ID from Child Process?
    P.S: We are using BPEL 10.1.3 Version.
    Please share any info on this.
    Thanks in Advance,
    Saravana

    Hi Saravana,
    The existing methods in 10.1.3x allow a following (a bit of a convoluted way):
    In a BPEL Java embedding activity, you can use the following code to get the parentProcessname:
    String parentInstanceId = getParentId();
    String parentProcessname = getLocator().locator.lookupInstance(parentInstanceId).getProcess().getProcessId().getProcessId();Hope this helps,
    Regards,
    Shanmu
    http://www.prshanmu.com/articles/

  • How to launch a function/procedure without suspending the parent process?

    Hi everybody,
    I would like to know if I can define something as follows in PLSQL:
    procedure master
    begin
    call a procedure_child;
    End master;
    I would like that the procedure master does not suspend the execution and wait that the procedure_child finishes in order to resume the executions with the further code.
    Thanks a lot in advanced
    Tomeu

    In the future, please stick to posting in a single forum.
    Re: How to launch a function/procedure without suspending the parent process?

  • How to get status of a sub process from the parent process.

    Hi,
    I want to get the status of a subprocess from the parent process (i.e. success or failure).
    How can I get this.
    Thanks in advance.
    Bye

    have a look at the workflow built-in vars:
    WF_ACTION_ERROR and WF_ACTION_RESULT or WF_CASE_RESULT
    WilfredS

  • How to Terminate the BPM Process instance

    Hi,
    If I have an instance of bpm process which fault at the database service task, I want to manually terminate or suspend it. I tried to do it in the workspace as an bpm administrator, however, since the instance pass the human task already, so that i can't suspend the instance. On the enterprise manager console, I don't see any way to terminate one instance. Please advise and it is so important and urgent for me, since our bpm project already on prodction, we have to fix it as soon as possible. Thanks in advance

    I'm thinking you're asking what you can do with an instance that has an uncaught exception and not how to have modeled it so they can be properly handled. If you're not catching the exception, in any of the 7 techniques listed below - you're kind of stuck.
    If you have a service task and you'd like to handle the exception (manually or other), you have the choices listed below. If you are using none of these, then you're allowing the BPMN engine to handle the exception and about all you can do is to delete the instance in Enterprise Manager.
    1) You could add a catch error event to the boundary of the Service task and have that event designated to handle the exception thrown. From the boundary event, you might have a sequence flow to an Interactive activity that lets you hande the exception. Once handled, the instance can continue on with the process.
    2) You could add an event subprocess in the same process as the Service activity that has a start error event and have that event designated to handle the exception thrown. From the event subprocess, you might have a sequence flow to an Interactive activity that lets you hande the exception. The difference between this scenario and the first is that the instance in the process has to terminate in the end event in the event subprocess.
    3) If your process is invoked as an embedded subprocess, you could add a boundary event (1 above) or catch it in an event subprocess (2 above).
    4) If your process is a reusable process invoked from a parent process using a Call activity, if the exception isn't caught inside the called subprocess you could add a boundary event to the Call activity in the parent process. This is similiar to 1 above and you'd need a sequence flow comingin out of the boundary catch error event on the Call activity to go somewhere in the process to handle the exception.
    5) If your process is a reusable process invoked from a parent process using a Call activity, if the exception isn't caught inside the called subprocess and it is not caught by a boundary error event on the parent's call activity then you could add an event subprocess in the parent process that has a start error event and have that event designated to handle the exception thrown inside the child process.
    6) There is a way to handle exceptions thrown inside a peer process but I'm guessing that might be too much for this post.
    7) You can handle exceptions using a Policy outside of the processes. Rather than using the above to handle exceptions, you could use policy based exception handling where you give the policy the different types of faults you want to catch and if you want to retry, let it be handled by someone in Enterprise Manager and if you just want to abort the instance.
    If the exception is not caught, then you're in the scenario you're in now and the BPMN engine is where it is unfortunately caught. Although you can see it, it is a non-recoverable exception and about all you can do is delete the instance in Enterprise Manager.
    Hope this helps,
    Dan

  • How to monitor the wrapper process flows

    Hi,
    I have a process flow(main wrapper) which contains the 2 child process flows(child_PF1, child_PF2). which looks like below.
    start -> Child_PF1 -> Child_PF2 -> end
    I am able to run the the process flows successfully. I want to monitor the process flows and the % of completion of the process flow.
    I am able to check the parent and child process flows seperately. I am unable to link the parent process flow to its child work flows. Can anyone explain how to link/track the Parent process flow to its child process flows.
    When i open the Parent process flow i was able to see the child process flow as an operator. But i was not able to view the contents child process flow further.
    Oracle Workflow server version is 2.6.4
    OWB version is 10.1.0.4
    Thanks in Advance,
    SriGP.

    Hi,
    the following SQL works with OWB 10.2.
    SELECT to_char(x.created_on,'dd.mm. hh24:mi') as created_on,
           --x.root_id as r_id,
           sys_connect_by_path(x.map_name, '/') AS NAME,
           step_name as target,
           --x.map_name as map_name,
           --x.run_status,
           x.number_records_updated + x.number_records_inserted + x.number_records_merged + x.number_records_deleted AS "#R",
           --x.number_records_selected AS "#S",
           --x.number_records_inserted AS "#I",
           --x.number_records_updated AS "#U",
           --x.number_records_merged AS "#M",
           --x.number_records_deleted AS "#D",
           NVL(x.elapse_time, round((x.updated_on - x.created_on) * 86400)) AS secs,
           x.status
      FROM (SELECT r.top_level_execution_audit_id AS root_id,
                   r.parent_execution_audit_id AS parent_id,
                   r.execution_audit_id AS audit_id,
                   r.created_on,
                   r.updated_on,
                   coalesce(substr(m.map_name, 2, length(m.map_name) - 2), r.execution_name) AS map_name,
                   r.return_result,
                   s.elapse_time,
                   m.run_status,
                   s.number_records_selected,
                   s.number_records_inserted,
                   s.number_records_updated,
                   s.number_records_merged,
                   s.number_records_deleted,
                   s.step_name,
                   s.run_status as step_status,
                   s.elapse_time as step_time,
                   s.step_id,
                   p1.VALUE AS p1,
                   coalesce(e.run_error_message, msg.message_text, s.run_status, m.run_status, r.return_result, 'RUNNING') AS status,
                   msg.message_text
              FROM all_rt_audit_executions r,
                   all_rt_audit_map_runs m,
                   all_rt_audit_map_run_errors e,
                   all_rt_audit_step_runs s,
                   (SELECT execution_audit_id,
                           message_text
                      FROM all_rt_audit_exec_messages
                     WHERE message_line_number = 1) msg,
                   (SELECT p.execution_audit_id,
                           p.parameter_name,
                           p.parameter_kind,
                           p.VALUE
                      FROM all_rt_audit_execution_params p
                     WHERE p.parameter_kind = 'CUSTOM'
                       AND p.parameter_name = 'OTIM_ID') p1
             WHERE 1 = 1
               AND r.execution_audit_id = p1.execution_audit_id(+)
               AND m.map_run_id = e.map_run_id(+)
               AND m.map_run_id = s.map_run_id(+)
               AND r.execution_audit_id = m.execution_audit_id(+)
               AND r.execution_audit_id = msg.execution_audit_id(+)) x
    WHERE 1 = 1
       AND x.created_on > trunc(SYSDATE) - 0
    CONNECT BY x.parent_id = PRIOR x.audit_id
    START WITH x.parent_id IS NULL
    ORDER SIBLINGS BY x.root_id DESC, x.audit_id DESC, x.step_id DESCMaybe your are lucky and it will work also with OWB 10.1.
    Regards,
    Carsten.

  • JPanel that close the parent JFrame

    Hello.
    I'm puzzled... how can I close a JFrame from the JPanel it contains?
    I mean:
    I have a Form that extends JFrame. In this form there's a JPanel, which has a BorderLayout. In the South part of the BorderLayout there's a JPanel (BoxLayout) that contains a JButton.
    I'd like this JButton to get disposed of the Form.
    How should I?
    Is there a better way to manage with this?
    (putting the button somewhere else...)
    Thank you

    Sorry, I forgot to mention that my sub-panel is in another class, another file.
    So I don't know how to call the parent frame.
    I tried with some .getParent(), but I get
    JPanel
    JLayerPane
    JRootPane
    and no JFrame.
    I could just put everything into 1 single class (or inner classes at least), but if there's a chance to keep them in different files, I would be glad to learn about it :)
    Thank you.

  • How to get the parent of a component in fx?

    Here is an example:
    Index.fx:
    Stage {
        title: "Online book library";
        width: 1024
        height: 768
        scene:Scene {
        fill: Color.WHITE
        content: [
           banner ,
           login = Login{translateX:715 translateY:135}
    };Login.fx:
    var logOn : Button = Button {
            translateX:25 translateY: 170
            text: "Log On"
            font: Font {size:11 name: "Verdana Bold"}
            action: function() {
                showHello();
    function showHello(){
       // add a label in index.fx whose text is "welcome!";
        }I want to show something on the index.fx but I don't know how to get the parent from the child component?
    In Flex, we use parent or parentApplication, Is there a similar function in JavaFX?

    Reusing the same Tile example, I had no problems, I suppose I was doing wrong the first time:
    def IMAGES_WIDTH = 100;
    def IMAGES_HEIGHT = 100;
    var COLUMN_NB = 3;
    var ROW_NB = 3;
    var scene: Scene;
    var previews: Container;
    Stage
      title: "Test of Tile layout"
      scene: scene = Scene
        width: 500
        height: 500
        fill: Color.LAVENDER
        content:
          previews = Tile
            hgap: 10
            vgap: 10
            layoutX: bind (scene.width - previews.width) / 2
            layoutY: bind (scene.height - previews.height) / 2
            columns: COLUMN_NB
            content: for (i in [ 1 .. COLUMN_NB * ROW_NB ])
              ImageView
                id: "IV{i}"
                image: Image
                  url: "{__DIR__}clock.gif"
                  width: IMAGES_WIDTH
                  preserveRatio: true
                onMousePressed: Hide
    function Hide(evt: MouseEvent): Void
      println("{evt.node} ({evt.node.id}) - {evt.node.parent}");
      var nm: Node = evt.node.parent.lookup("IV5"); // Middle node
      nm.visible = false;
      var ntl: Node = evt.node.parent.lookup("IV1"); //Top left node
      (ntl as ImageView).viewport = Rectangle2D { height: IMAGES_WIDTH/2, width: IMAGES_WIDTH/2 };
      (evt.node.parent as Tile).hgap = 20; // Strange effect, but works
    }

  • How to close the detach popup on click of a button in the panel collection

    Hi,
    I'm using Jdeveloper 11.1.2.3.0.
    I have an af table surrounded by panel collection. There is a button on panel collection to commit the changes in the table.
    Clicked detach button to view the table in full browser.
    On click of Commit button, the detach popup is not closed. I have set partialSubmit of that button to false. Then also detach popup is not closed.
    Can anybody suggest me how to close the detach popup on click of a button in the toolbar.
    Thanks,
    Vinod

    Hi Frank,
    Thanks for your response. Popup is not closed.
    I tried this approach, when the view tree is navigated on the Detach, I see that the tree is same as if it is traversed on the page without detach.
    Printed client id and UI component class in the while loop, result is as below.
    r1:0:pc1:t3 class oracle.adf.view.rich.component.rich.layout.RichToolbar
    r1:0:pc1 class oracle.adf.view.rich.component.rich.output.RichPanelCollection
    r1:0:ph2 class oracle.adf.view.rich.component.rich.layout.RichPanelHeader
    r1:0:pgl1 class oracle.adf.view.rich.component.rich.layout.RichPanelGroupLayout
    r1 class oracle.adf.view.rich.component.rich.fragment.RichRegion
    pgl1 class oracle.adf.view.rich.component.rich.layout.RichPanelGroupLayout
    db2 class oracle.adf.view.rich.component.rich.layout.RichDecorativeBox
    db1 class oracle.adf.view.rich.component.rich.layout.RichDecorativeBox
    psl1 class oracle.adf.view.rich.component.rich.layout.RichPanelStretchLayout
    ps1 class oracle.adf.view.rich.component.rich.layout.RichPanelSplitter
    f1 class oracle.adf.view.rich.component.rich.RichForm
    Tried with setting partialsubmit property to false on the command button, still the popup is not closed and my Faces Message are shown behind the detach popup.
    Thanks,
    Vinod

  • How to get the parent window in sub-child controller class in javafx?

    how to get the parent window in sub-child controller class in javafx?

    You can get the window in which a node is contained with
    Window window = node.getScene().getWindow();Depending when this is invoked, you might want to check the Scene is not null before calling getWindow().
    If the window is a stage that is owned by another window, you can get the "parent" or "owner" window with
    Window owner = null ;
    if (window instanceof Stage) {
      Stage stage = (Stage) window ;
      owner = stage.getOwner();
    }

  • How to stop the running process chain

    How to stop the running process chains or infopackges...just qm status change is enought?

    BI - SM 37 - Kill the Job
    ECC - SM 50 - Kill the job

  • How to stop the backup process....

    How to stop the backup process....
    Okay, so it happens nearly everytime you synch your iPhone with your iTunes? Easy. As soon as it starts, hit the "X" in the bar where the backup process is being shown, this does NOT STOP the synching process, ONLY the backup process.
    HOWEVER, keep in mind that a few times during the week (depends how often you synch ur iPhone) it will be good to let the backup process let run fully.
    There we go. Problem solved...

    i agree its what i do i backup whenever i add a new app, or take more pics etc its exactly what i do its what ive been saying on all these threads talking about backups etc, im hoping in 2.0.1 will be bug fixes about this sort of thing...

Maybe you are looking for

  • How can I transfer the root account on my computer to a regular account?

    Not sure if this in the correct category, but anyway... Back in October 2010, I installed a Java update or something on my regular account, and it broke the account for some reason. I had no other account to use except for the root user that I enable

  • Blue Screen and Error code help

    I got up for a few moments then come back to see my computer Blue Screened, first time ever for me. Its running win XP and is roughly 1 1\2 years old and i have no idea what even caused the blue screen much less how to fix it so it wont happen again

  • "The 'charCode' property of a keyup event should not be used. The value is meaningless." Is this possibly caused by a virus?

    I don't know what's wrong with my Mac Mozilla Firefox, version 3.6.8, but today, it started alerting me about an error message on the "Error Console". In every website I visit, it tells me: "The 'charCode' property of a keyup event should not be used

  • Transport request organizing report based on package

    Can anyone suggest me from which tables i will get all the transport requests, package to which it belongs to, which date it has been created, in which date it has been trasported and modified and to which user id it belongs to.

  • How do I play an .flv file ?

    I got an email with a .flv attachment.  I understand this is a flash file. What do I need to do to play this file? Windows XP 32 bit Your site check says I have flash version 10.1.53.64 I never explicitly installed flash, I understand it came bundled