cancel
Showing results for 
Search instead for 
Did you mean: 

Pass process variables at Activiti call

wuboy_2000
Champ in-the-making
Champ in-the-making
Hi.

I am new to Activiti Forum.

I want to programmatically called another process from the current process. I define a ServiceTask class that implements ActivityBehavior interface. It will create an CallActivityBehavior  object and pass process variables to the sub process and vice versa.
Code is as follows:

   public void execute(ActivityExecution execution) throws Exception {            
      CallActivityBehavior cab = new CallActivityBehavior("otherProcess");
      
      MessageImplicitDataInputAssociation midia = new MessageImplicitDataInputAssociation("k1",  "uk1");
      cab.addDataInputAssociation(midia);
      
      MessageImplicitDataOutputAssociation midoa = new MessageImplicitDataOutputAssociation("k2", "uk2");
      cab.addDataOutputAssociation(midoa);
      
      cab.execute(execution);
                   cab.completed(execution);
   }

Now, I can't get subprocess variable from parent process.


Any help !!!

Thanks in advance !




Thanks,
3 REPLIES 3

jbarrez
Star Contributor
Star Contributor
I really don't get what you are trying to accomplish here.

Why arent you using a CallActivity directly in your process?

wuboy_2000
Champ in-the-making
Champ in-the-making
I need to determine at run time whether a process is defined, so as to decide whether to call the process.

trademak
Star Contributor
Star Contributor
You can also determine this in a script or service task and then use the call activity (with an expression) to invoke the determined process. That would have the advantage that you can use the public exposed parent and sub process variable functionality.

Best regards,