cancel
Showing results for 
Search instead for 
Did you mean: 

How to annotate process steps with further information

d00d
Champ in-the-making
Champ in-the-making
I'd like to add some information to my process steps that i want to retrieve programmatically during the execution of the process (e. g. typical execution time thresholds, name of the responsible persons etc). BPMN 2.0 offers the annotation artifact but based on what i've learned so far, activiti is not able to retrieve this information during the actual execution of the process.

Is there any better way?
3 REPLIES 3

jbarrez
Star Contributor
Star Contributor
- Any bpmn element should support 'documentation' tag. You can get it through the BpmnModel.
- Any bpmn element supports 'extensionElement', which is also parsed and retrieveable through the BpmnModel.

d00d
Champ in-the-making
Champ in-the-making
Thank you for your reply. I have one task with two attributes:

<code>
<userTask id="usertask1" name="Process A">
    <extensionElements>
     <activiti:field name="attribute a" stringValue="300"/>
     <activiti:field name="attribute b" stringValue="300"/>
    </extensionElements>   
    </userTask></code>

While i can easily retrieve the extensionElements of a process through the BpmnModel but i don't see any method to retrieve the extensionElements of the tasks…

jbarrez
Star Contributor
Star Contributor
a UserTask is a BaseElement, which  has a method getExtensionElements(). Find that usertask in the process and there you go