cancel
Showing results for 
Search instead for 
Did you mean: 

How to trigger execution of a Java programm automatically within a task in a workflow?

reinhacker
Champ in-the-making
Champ in-the-making

Hi there,

I would like to automatically trigger the execution of a Java program as soon as a specific task within a workflow is reached / completed. Furthermore, I need to pass the PROC_INST_ID_ of the current process as a parameter into this program. Is there any example available on how to do this or could anyone give me some hints?

Right now, I am working with the community edition.

Best,

Mario

2 REPLIES 2

daisuke-yoshimo
Star Collaborator
Star Collaborator

How about Execution listener or Task listener?

Activiti User Guide 

Activiti User Guide 

kalpesh_c2
Star Collaborator
Star Collaborator

Hi , 
Please refer this documentation https://www.activiti.org/userguide/#bpmnJavaServiceTask 

You can get your parameter like this

public class ToUppercase implements JavaDelegate { 
   public void execute(DelegateExecution execution) throws Exception {

    String var = (String) execution.getVariable("input");
    var = var.toUpperCase();
    execution.setVariable("input", var);
  }
}


Thanks,

Kalpesh