cancel
Showing results for 
Search instead for 
Did you mean: 

reagarding expression to be appended in the workflow

hermes
Champ in-the-making
Champ in-the-making
In the workflow , we need to replace the ‘waitForDispatchUpdate’ with unique activiti Id each time so that multiple workflow will recognize response with it’s unique activity id

I am planning to use

<serviceTask id="print" activiti:expression="#{contactDispatchTask.createUniqueId(Execution)}" activity:resultvariable=”activitiResponse” />

This variable will be used across


<!– If no response is received within a set time period the workflow will take a default action –>
      <receiveTask id=" activitiResponse " />
      <boundaryEvent attachedToRef=" activitiResponse "
         id="setDefaultIfNoDispatchUpdate">
         <timerEventDefinition>
            <timeDuration>PT20S</timeDuration>
         </timerEventDefinition>
      </boundaryEvent>


i don't want to write anything in java code to calculate a unique id .Can i use workflow expression to have unique id so that i can have segregate for each workflow response
1 REPLY 1

frederikherema1
Star Contributor
Star Contributor
You can register a "bean" in the processEngineConfiguration (see user guide, search for beans). This bean can point to a simple Java-class with one method, e.g. "generateId()". if you register an instance of that class in the "beans", using key "generator", you can use these kind of expressions:

"${generator.generateId()}"

This forces you to write ONE java-class, but it's available from ALL of the processes, so no additional logic/coding is involved for additional processes.

Using no code at all, not sure If I can think of anything like that, perhaps a script-exeuction/task listener that sets that variable? (I know groovy can use any Java-class, so you could use UUID in the JDK, for example).