cancel
Showing results for 
Search instead for 
Did you mean: 

workflow level variable

purohitsumit
Champ in-the-making
Champ in-the-making
Hi All,

I am trying to create a custom workflow and looking for way to create workflow level variable to store state of workflow. I am looking for an enum kind of variable with 8 custom states.

Is there a way to set it in the workflowModel.xml file ?

I agree that I do find "process variable" available in workflow.bpmn file as



<script>var scwf_approveCount = 0; var scwf_tpApproved = false;</script>



But I would prefer adding workflow level variable in model definition instead of adding enum variable in javascript of workflow definition file.



Thanks
Sumit Purohit
1 REPLY 1

romschn
Star Collaborator
Star Collaborator
One way of defining a workflow level vairable is as below -
If you want to define a workflow level variable in the custom workflowModel.xml then you can take below approach -
1. Create a base type having parent as bpm:workflowTask in custom workflowModel.xml, define the properties for the type.
2. For all your workflow tasks, instead of having parent as bpm:workflowTask now use the base type you have just defined.
3. The properties you have defined will be now available across all the workflow tasks throughout the workflow.
4. Setting up the values for the property can be controlled through tasklistener classes depending upon your requirement.