As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
event (required): the type of task event on which the task listener will be invoked. Possible events arecreate: occurs when the task has been created an all task properties are set. assignment: occurs when the task is assigned to somebody. Note: when process execution arrives in a userTask, first an assignment event will be fired, before the create event is fired. This might seem an unnatural order, but the reason is pragmatic: when receiving the create event, we usually want to inspect all properties of the task including the assignee. complete: occurs when the task is completed and just before the task is deleted from the runtime data.
<userTask id="verifyReport" name="verify the report"> <extensionElements> <activiti:taskListener event="create" delegateExpression="${fourEyesTaskListener}"> <activiti:field name="fourEyesTask" stringValue="createReport"/> </activiti:taskListener> </extensionElements> <potentialOwner> <resourceAssignmentExpression> <formalExpression>ROLE_EDIT</formalExpression> </resourceAssignmentExpression> </potentialOwner> </userTask>
<br> protected void handleAssignments(TaskEntity task, ActivityExecution execution) {<br> if (taskDefinition.getAssigneeExpression() != null) {<br> task.setAssignee((String) taskDefinition.getAssigneeExpression().getValue(execution));<br> }<br> ….<br>
<br> <process id="FourEyesExample"><br><br> <startEvent id="begin"/><br><br> <sequenceFlow id="flow1" sourceRef="begin" targetRef="createReport"/><br><br> <userTask id="createReport" name="create the report"><br> <potentialOwner><br> <resourceAssignmentExpression><br> <formalExpression>ROLE_CREATE</formalExpression><br> </resourceAssignmentExpression><br> </potentialOwner><br> </userTask><br><br> <sequenceFlow id="flow2" sourceRef="createReport" targetRef="end"/><br><br> <endEvent id="end"/><br><br> </process><br><br>
… when process execution arrives in a userTask, first an assignment event will be fired, before the create event is fired.