07-28-2011 02:07 PM
<decision name="check_if_language_exam_required">
<!– Language exam required for Simplified Chinese. –>
<transition name="to complete language exam" to="complete_language_exam">
<condition expr="#{ (!isLanguageExamComplete) and jobLanguage == 'zh' }" />
</transition>
<transition name="to check applicant auto rejection" to="check_applicant_auto_rejection" />
</decision>
<task name="complete_language_exam" assignee="#{ stringId }">
<transition name="completed" to="check_applicant_auto_rejection" />
<transition name="abandoned" to="abandoned" />
<transition name="to abandoned" to="abandoned" ends-task="true">
<timer duedate="45 days" />
</transition>
</task>
<exclusiveGateway id="isLanguageExamRequiredGw" name="Check if language exam required" default="langExamNotRequiredFlow" />
<sequenceFlow id="langExamRequiredFlow" sourceRef="isLanguageExamRequiredGw" targetRef="completeLangExamTaskSetup">
<!– Language exam required for Simplified Chinese. –>
<conditionExpression xsi:type="tFormalExpression">${ (!isLanguageExamComplete) and jobLanguage == 'zh' }</conditionExpression>
</sequenceFlow>
<sequenceFlow id="langExamNotRequiredFlow" sourceRef="isLanguageExamRequiredGw" targetRef="sendRegisteredEmailTask" />
<scriptTask id="completeLangExamTaskSetup" name="Complete language exam setup (hidden)" scriptFormat="groovy">
<script>execution.setVariable('AvailableOutcomes', 'completed,abandoned')</script>
</scriptTask>
<sequenceFlow id="completeLangExamSetupFlow" sourceRef="completeLangExamTaskSetup" targetRef="completeLangExamTask" />
<userTask id="completeLangExamTask" name="Complete language exam">
<documentation>
Complete the required language screening exam.
</documentation>
<extensionElements>
<activiti:formProperty id="TaskOutcome" variable="TaskOutcome" required="true" />
</extensionElements>
<humanPerformer>
<resourceAssignmentExpression>
<formalExpression>${ stringId }</formalExpression>
</resourceAssignmentExpression>
</humanPerformer>
</userTask>
<boundaryEvent id="completeLangExamTaskAbandonedTimer" cancelActivity="true" attachedToRef="completeLangExamTask">
<timerEventDefinition>
<timeDuration>P45D</timeDuration>
</timerEventDefinition>
</boundaryEvent>
<sequenceFlow id="completeLangExamTaskAbandonedTimerFlow" sourceRef="completeLangExamTaskAbandonedTimer" targetRef="abandonedOutcome" />
<sequenceFlow id="langExamCompletedFlow" sourceRef="completeLangExamTask" targetRef="completeLangExamTaskOutcomeGw" />
<exclusiveGateway id="completeLangExamTaskOutcomeGw" name="Check language exam outcome (hidden)" default="completeLangExamCompletedFlow" />
<sequenceFlow id="completeLangExamCompletedFlow" sourceRef="completeLangExamTaskOutcomeGw" targetRef="sendRegisteredEmailTask" />
<sequenceFlow id="completeLangExamAbandonedFlow" sourceRef="completeLangExamTaskOutcomeGw" targetRef="abandonedOutcome">
<conditionExpression xsi:type="tFormalExpression">${ (LastTaskOutcome == 'abandoned') }</conditionExpression>
</sequenceFlow>
07-28-2011 03:07 PM
07-28-2011 03:22 PM
07-28-2011 04:45 PM
Thanks for the pointer on the task assignment. I did see that in the documentation, but I prefer to stick with the bpmn conventions where possible.
I guess the way I am handling task transitions is the proper way of doing it and I will have to live with the verbose and complicated XML then.The way you handle the transitions with the exclusive gateway is 'normal' but you still do not need to use a form property. I do not use the Activiti forms at all (use JSF) and just set a variable based on a button on a form that is clicked. So that part can be left out and the difference is even smaller then.
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.