AnsweredAssumed Answered

set subprocess name

Question asked by peteth on Aug 3, 2018
Latest reply on Aug 7, 2018 by bassam.al-sarori

I have a Process Definition that makes a number of different calls to a subprocess via Call Activity,  as the subprocess is called multiple times for many different reasons, I'd like to be able to set the 'Name' for each instance of the called subprocess, so that name gets displayed on the Admin Console - see screen shot 

 

Process Def with multiple subprocesses and no name

 

I tried setting a Java Listener to modify the name e.g.  and setting it as a start event in the subprocess, but that does not seem to take any effect.    I also tried a script based listener doing similar, but again the name does not seem to get set. 

 

We are using Alfresco Activiti Enterprise BPM Suite v1.5.0

 

 

 

public class ModProcessInstanceNameListener implements ExecutionListener{

   private static final long serialVersionUID = 3381970945383360304L;

   @Override
   public void notify(DelegateExecution execution) throws Exception {
      execution.getEngineServices().
            getRuntimeService().
            setProcessInstanceName(execution.getProcessInstanceId(), "myname");

   }

}


Outcomes