2 Replies Latest reply on Mar 5, 2010 2:56 AM by letstalk

    Strategy for assigning subprocess execution ID

      When a subprocess is started from a main process using subprocess activity, is there a way to specifiy a strategy for assigning instance IDs to the subprocess?

       

      An example: I have a main process called "FulfilOrder". Since I am starting this process manually, I am able to assign a process instance ID as "FulfilOrder.123" where 123 is my order ID. Now, when the main process starts a subprocess, it assigns an instance ID that is not derived from the main process instance ID, for example "ContractCreate.82".

       

      Is there a way to specifiy the strategy of assigning instance ID to subprocesses to get something like "ContractCreate.123.82" - a composite instance ID that would contain my order ID?

       

      Thanks.

        • 1. Re: Strategy for assigning subprocess execution ID
          matrixpooh

          would processInstance.getParent().getId() work instead?

           

          Also, you can extend org.jbpm.pvm.internal.model::ExecutionImpl and override composeId(). Ultimately org.jbpm.pvm.internal.id.DatabaseIdComposer is the one that creates ids in that format

          1 of 1 people found this helpful
          • 2. Re: Strategy for assigning subprocess execution ID

            Hi Al, I've tried getId() first but it didn't work for my case where subprocess reached timer activity. In this case processInstance.getParent().getId() returns the parent execution which is the execution of the subprocess and it is in the inactive-scope state. This execution, in turn, returns null for parent execution id which is strange, isn't it?

             

            Besides, that's only a part of the problem, my goal is to have all child execution reference the original order id and your second suggestion might just do the trick. I'll try that, thanks a lot!