Spawning another sub-process

All
A quick workflow question: How do I spawn another child/sub-process from another process of the same item type ?
Imagine this scenario:
ItemType : ABC
Process : EFG
Start --> Function A ---> Process HIJ ---> Function C ---> End
Process : HIJ
Start --> Function D ---> Notify X ---[Timeout]--> Notify Y ---> Re-assign
One of the options/buttons within the Notify Y will be to start another process EFG of item type ABC.
Do I simply drag and drop the Process EFG process icon into the diagram of Process HIJ and link it as an outcome of Notify Y ?
Or is there another way of doing it ?
Any helps is appreciated ?
Thanks
Regards

Hi everyone
I have an application that Im trying to test.
Unfortunately one of these tests requires me to spawn
another java process after a System.exit(0); has
executed. Since this exits the VM its proving very
difficult. Does anyone know of a way to restart the VM
after the System.exit has run?Exactly what do you want to do?
If the application is supposed to only have one exit point then add a security manager and disallow all the other exit points. Then you can use Runtime.exec() to start the second application just before the real exit point.
However note that if there are other calls to System.exit in the application then it is very likely that this will cause some unexpected failures in terms of security exceptions.
You could also use Runtime.addShutdownHook() which would run your second app. The hook would be called as the application exits.
You might want to consider what happens if someone just kills the application (say with 'kill -9' or the windows task manager.) In either of those cases there is nothing that you can do in java to make that second application run.
You might also want to consider why you are doing this in the first place. As suggested a script solution is probably a better solution.

Similar Messages

  • Spawning another java process after System.exit(0);

    Hi everyone
    I have an application that Im trying to test. Unfortunately one of these tests requires me to spawn another java process after a System.exit(0); has executed. Since this exits the VM its proving very difficult. Does anyone know of a way to restart the VM after the System.exit has run?
    Thanks

    Hi everyone
    I have an application that Im trying to test.
    Unfortunately one of these tests requires me to spawn
    another java process after a System.exit(0); has
    executed. Since this exits the VM its proving very
    difficult. Does anyone know of a way to restart the VM
    after the System.exit has run?Exactly what do you want to do?
    If the application is supposed to only have one exit point then add a security manager and disallow all the other exit points. Then you can use Runtime.exec() to start the second application just before the real exit point.
    However note that if there are other calls to System.exit in the application then it is very likely that this will cause some unexpected failures in terms of security exceptions.
    You could also use Runtime.addShutdownHook() which would run your second app. The hook would be called as the application exits.
    You might want to consider what happens if someone just kills the application (say with 'kill -9' or the windows task manager.) In either of those cases there is nothing that you can do in java to make that second application run.
    You might also want to consider why you are doing this in the first place. As suggested a script solution is probably a better solution.

  • Calling BPM Sub Process from another BPM Process - Stuck at Sub Process

    Hi
    JDeveloper 11.1.1.6, BPM 11.1.1.6, WLS 10.3.6
    I am trying to Call a BPM Process from another BPM Process. Both the processes are defined in the same BPM Project.
    Both the Processes have 'None' Start and End activities.
    The 'Parent Process' has a 'Call Activity' which calls the 'Sub Process'.
    The Sub process takes a parameter of payload object as input and returns output (also same payload object)
    I have passed the payload object from parent to sub process in the 'Data Associations'.
    The Start and End activities in the sub process also have the data associations set where I am passing the payload object from parent process to child process.
    When I run the process and see the Enterprise Manager console - Audit Trail / Flow tabs,
    Flow Tab - The progress of the process is showing only till the Calling of the sub process in the Parent Process. It does not show the Sub Process.
    Audit Trail Tab - Shows that the Sub Process is called but has not reached to the End of the Sub process.
    The audit trail does not have links to the sub process activities.
    I cannot see any exceptions as well in the audit trail.
    How can I find out why the process is stuck? Or what is going on in the process?
    Please let me know if my explanation is not clear?
    Thanks for any help
    Regards
    Sameer

    Thanks for replying.
    I have another Sub Process with Start and End events as Message Events and used Send Task and Receive Task (Implementation : Process Call) in the Main process to invoke the sub process asynchronously.
    Then, the Sub Process is shown in the 'Flow Trace' as child of the main process.
    In this particular one, I used 'Call Activity' to call the sub process.
    So the Audit trail is showing the sub process as a child.
    But what I was trying to say is that the audit trail did not have links to the entries in the 'Event' column (in Enterprice manager - instance window). (like Instance entered activity, Instance left activity etc).
    I was intending to use these links to see the payload information and try to debug if there is any problem with the code.
    The actual problem I was trying to say in the post is that, even after the user responds to the activity (User Task - Approval) in the Sub process,
    the audit trail is not proceeding further.
    In the Sub process definition, after the user task, there is End with none implementation.
    Hope it is clear now.
    Thanks and Regards
    Sameer

  • Passing attachements to sub-processes

    I have a process that initiates a sub-process and pass the form data through successfully but the only problem is that I want to pass attachments also from one process (main) to another sub-process, which i have been trying for the past couple of days and unfortunately all my efforts went on vain.
    Is there any body to save me on this one, PLS?

    hi,
         You have mentioned that it is possible to access main process form variable to the subprocess.
    I have a main process called M and a subprocess named S. At the end of the workflow of M i have added S using the Subprocess service.
    How can i pass form avariables and process variables of M to S...?
    pls help me on this ..
    thanx
    Balaji

  • Sub process

    Hi,
    I would like to know if there is a way to call a subprocess or a different process from global interactive activity. The requirement is. once the subprocess is called, the user should not be able to execute the parent instance. Only when the instance returns from the sub process, the user should be able to proceed. Please suggest.
    Thanks in advance

    Hi,
    Since the Global Interactive has instance access there'd be a lot of moving parts. I apologize in advance - I have completely obsessed over this.
    I put a project out on http://www.4shared.com/file/117294058/7685a219/InvokeSubProcessFromGlobalInteractive.html that you could download and import to Oracle BPM 10g to see what you think.
    I obsessed over this a little too much (ok - way too much), but it was an interesting challenge. If you're not comfortable with this, it's completely my fault that I've made it seem too difficult. Not that hard, but it takes a knowledge of Message Wait activities, creating Correlations, sending notifications and creating instances in another process using logic (ok - maybe you should try to talk the customer out of going this route and lean them towards a simple SubFlow activity).
    Here's what I did to get this to work if you're curious. If your Global Interactive activity has instance access, you could have checkbox in the UI that is presented when you invoke the Global Interactive. The checkbox would be tied to a Boolean attribute in the instance's BPM Object. I'm calling this attribute "spawnSubprocessAndLockParent" in this scenario. This will act as a flag to tell the Global Interactive to spawn a subprocess and to lock the parent instance if checked.
    Here are the steps I did:
    In the parent process:
    1) created a correlation as the first activity in the process and terminated the correlation in the last activity in the process
    2) added the Boolean "spawnSubprocessAndLockParent" attribute to my instance's BPM Object
    3) created a presentation with this attribute
    4) added this presentation to the Global Interactive's screenflow
    5) inside the same screenflow, if the user checks the checkbox it goes to a new Automatic task in the screenflow that uses logic to create an instance in the child process.
    6) changed the screenflow for the parent process's activity to detect if the "spawnSubprocessAndLockParent" Boolean variable is true when it enters the Screenflow. If it is false, end users can edit the normal UI presentations and submit in the normal way it does now. If it is true, however, end users can only bring up read only UI presentations and have them exit the Screenflow via an Automatic task that has the logic "action = CANCEL".
    7) in the parent process, added a Message Wait activity that has no transitions coming into it or going out of it. Its "Runtime" property setting for "Waits for" need to be set to set to "External" and the "Allows interruptions" property needs to be checked.
    8) in the parent process, added an Automatic activity with just this one line of logic: "action = SKIP"
    9) added an unconditional transition from the Message Wait activity to the Automatic activity added in step 8
    In the spawned child subprocess:
    10) in the subprocess spawned in step 5, just before it reaches the End activity add an automatic activity that sends a notification to the parent process's Message Wait activity.
    Hope this helps - again sorry for obsessing,
    Dan

  • Killing a sub process from it's parent process

    does any one know if ther's a way of killing a sub process from it's parent process?

    There are a few ways to do this depending on how the subprocess was invoked and if you are inside the parent work item instance or if you are using PAPI.
    If you are not using PAPI, here's how you could abort the child work item instances spawned by a parent process's work item instance.
    Asynchronously Spawned Children
    If a child process was invoked using an asynchronous Process Creation activity, the work item instance in the parent has a predefined hash table variable called "children". Downstream of the parent's Process Creation activity (called "SpawnChildren" in the PBL logic below), you can get the child's instance id using the children hash table and use this to send a notification to a Message Wait activty in the spawned child process instance using logic like this:
    send Notification
            using instanceId = children["SpawnChildren"],
                  activityName = "TerminateChild",
                  parameters = nullThe Message Wait activity needs to have its "Allows Interrupt" property checked in the child process. As you add this Message Wait activity (called "terminateChild" in the example above) make it an orphan with no transitions in or out initially. Once notified by the parent process, it still needs to be aborted so add a new Automatic activity in the child with this logic:
    action = ABORTFinally, add a transition from the Message Wait activity in the child subprocess to the Automatic activity.
    Synchronously Spawned Children
    If all you know is the parent work item instance's id and the child subprocess was invoked using a synchronous SubFlow activity, you could send a notification to a Message Wait activity that has it's "Allows Interrupt" property checked in the parent. If the Message Wait activity flows to an Automatic activity, you could use logic like this to kill the child subprocess work item instances synchrously spawned by the parent:
    for each ch in ProcessInstance.children do
        send Notification
            using instanceId = ch,
                  activityName = "TerminateChild",
                  parameters = null
    end
    action = SKIPSince the parent's instance was stuck in the Subflow activity, you'd need to send a notification to the parent's Message Wait activity in the parent process.

  • Business process and sub process in CUP & ERM

    Hi,
    We have created Business Processes and Sub- Processes in ERM. But we are not able to view the same when we create a request in CUP.
    We have created the Business Processes and Sub- Processes for CUP in Roles -Attributes.These were then visible in the request.
    Do we need to create the Processes and Sub-processes independently in both ERM and CUP or should it flow into CUP when roles are imported into CUP from ERM ?
    Thanks and Regards.

    Another important point:
    In CUP, Sub Processes are optional, in ERM they are mandatory.
    Please make sure you have some in CUP for all your processes.
    Frank.

  • Sub-Process Main Process Web-Service

    Hi,
    I have a main Process and a sub-process inside this main process.
    I have a Wait activity inside this sub-process, which waits for an external call from another system to call my Web-Service at this Wait activity. This Web-Service is built as Process As a Web-Service Call.
    But I fail to get any information back from this Wait Activity which keeps waiting for the call from the external system which calls my Web-Service at this Wait Activity.
    But the external system is calling my Web-Service and it gets a error notification from BPM..
    Why is that so?
    Is it because its a sub-process inside a main process or something else?

    Did you use PAPI code inside your web service or did u just use PAPI Web Services ( like did u just pressed the button Launch PAPI Web Services ) and it created the WSDL for you and u used it to create the client?
    I am using the latest version of OBPM..
    Oracle 10.3.10
    Can you let me know what do u mean by PAPI interface.. Is it the PAPI code of is the PAPI Web Service which is built by BPM automatically and could be used?
    Edited by: user8707382 on Sep 10, 2009 9:00 AM

  • Concept of Sub Process and Starter Process in BPEL

    Hi Forum -
    With my limited understanding of BPEL I have found that if a process has to interact with another process it has to be exposed as a service however that is not good in all cases.
    Is there a way in BPEL where once can create a process and do not expose it as service and still be able to call it from another BPEL process.
    For example there can be a process called sendNotification and all the other processes if they want to send a notification can call this process.
    In TIBCO there is a concept of Starter Process and Sub Process. A Starter Process is a process which will wait for an event to take place, like a web service request or a JMS message or a database adapter event and then this main process can call a sub process, just like the main program calling a function. This sub process need not be defined as a service in TIBCO and it can still accept an xml schema type as input.
    Is this possible in BPEL?
    Thanks!

    10g -> Every process is a service.
    11g -> Create a Composite, You could wire multiple BPEL Components and expose only the desired ones as a service through a mediator or directly the bpel. Mediator provide one more layer of virtualization and hides even the first master bpel component.
    But if the send notification have to be reused outside the composite, it has to be an exposed service. Although it is exposed as a web service, it uses only WSIF binding to interact between bpel processes and not a soap binding(unless specifically instructed).
    If you are looking for function kind of construct, you could create custom xpath functions (like logging etc.)
    -Sridhar

  • Call Referenced sub-process by propagated user

    Hello, gurus!
    Today a caught new problem.
    I try to call referenced sub-process from another BPM-process. I have enabled principal propagation in both processes. After that I call head process by predefined user (in example "TestUser"), but unfortunately internal referenced sub-process was called by "SAP_BPM_Service" user.
    Does anyone knows if I have any way to call referenced sub-process by predefined "TestUser" too?
    Thanks for your answers.
    Regards, Sergey.

    I try to call head process by "TestUser" which should be propagated to referenced sub-process, but in process management perspective in nwa I can see that sub-process was started by "SAP_BPM_Service" user. Do you know what I should do to fix that problem?
    Thanks for your reply!

  • Get Id of sub process

    Hi everyone,
    I've got a process, which starts in its procedure another process (subprocess). I'm able to get the process' id (parent), however I'm not able to get the subprocess' id.
    Does anyone run into the same situation and can give me a hint to get the subprocess' id?
    Thanks & kind regards.

    Hi,
    You can search the sub-process ID from adminui by navigating Home>Services>LiveCycle Pocess Management>Process Search.
    Here you can select your 'Application' from the drop down and click search. You will find the 'Process ID' of your process as well as sub-process.
    Thanks,
    Vipin

  • How the invocation between process and sub-process work?

    As I have read throught some posts here and know that the web service whicn is used to trigger the process is asynchronous.
    so is the invocation between process and its sub-process asynchronous using web service?
    supposed there is a process like below:
    Start Event -
    >Sub-Process ->Automated Task-->EndEvent
    I have some confused questions:
    1: is it asyn to invoke the subprocess?
    2: if the invocation is asyn, is the next "Automated Task" triggerred before the completion of the nested subprocess? It seems to be, but it is not so reasonable.
    3: if the invocation is asyn, how the process get the return value of the nested subprocess?

    Hi John,
    the invocation of sub-processes is done via an internal runtime mechanism and not via normal Web Service call.
    The sub-process call is synchronous, so the calling process is waiting for the reply from the sub-process. There are a few things to keep in mind when using sub-processes:
    If you are branching off parallel execution paths (via a split gateway) within the sub-process and are using a regular end event, only the first token arriving at the end event will return to the calling process. The sub-process will keep running until either the last of its tokens flows into the end event or until the calling process is being terminated. In any case, the calling process will not react to any more tokens arriving at the sub-processes end event.
    If you are using parallelism within the sub-process, but want it to terminate once the first token arrives the end, use a terminating end event in the sub-process.
    Don't use the correlation condition at the start event of a sub-process. If this condition evaluates to 'false', the sub-process will never be started, but the calling process will wait forever for a reply.
    If you want the sub-process call to behave asynchronously, you can model the sub-process to split off a token to the execution path where it does the actual work and have another straight path directly from the split gateway to the (non-terminating) end event. That way the calling process will continue right away, but of course you cannot expect any response coming out of the sub-process.
    Best regards,
    Oliver

  • Handling exceptions at Sub-Process Level

    Can we handle exceptions at Sub-Process level itself? Or do we need to transfer the exceptions to the main process and then only the admin user can handle them?

    The same thing applies to subprocesses. A subprocess is just a process that has been invoked by another process and the same exception handling rules apply to it.
    You can catch exceptions in any process using:
    <li> logic at the activity level using a try/catch block
    <li> an activity using an Exception transition
    <li> a Group in the process using an Exception transition
    <li> the process using an Exception Handler
    At a minimum, catch the "Others" exception using the Exception Handler. This ensures uncaught exceptions are not sent to the End activity (the default) and the instances are not lost. This simple best practice will save you days of debugging and several calls to customer support to resolve.
    Dan

  • Referenced sub process mapping

    Hi,
    is there an easy way to map a data context of the parent process as input of a referenced sub process?
    The only way I know is to create a new event trigger in the sub process and define a service interface with an XSD schema definition and so on...
    It doesn't seem to be straight forward, worse if I have several sub processes!
    Best regards,
    Kevin

    Hello Kevin,
    i hope you are yet watching this thread.
    Do you now have another solution for mapping data context to a sub process?
    We have a "dispatcher"-process, which calls the different versions of a main process and need to map the data from the dispatcher to the different processes.
    Thanks in advance,
    Martin

  • Invoking bpel process from another bpel process in same app server

    Hi,
    When I invoke a bpel process from another bpel process in the same oracle AS
    1. Is it a SOAP call or is there any optimization?
    2. If there is some optimization where can I configure this?
    3. Is there any similar optimizations if I invoke a bpel process from a
    java application deployed in the same server? If so can you please provide
    a sample?
    Thanks for your help
    Raj

    By default the BPEL 10.1.2, it will do a local call to the process. It will not execute a SOAP request, no network access is done.
    It can be configured at domain level:
    Parameter: optSoapShortcut (SOAP local optimization)
    Turns on "short-cut" for local SOAP request; local SOAP calls are normally done via an internal call instead of sending a message through the SOAP stack.
    The default behavior for the engine is to optimize all. To disable optimization specify a value other than "true" or "yes".

Maybe you are looking for