Select assignee button does not appear in parallel review activiti workflow

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2014 10:24 AM
Hi,
I am trying to customise the parallel review workflow in 4.0.d community edition. All I have done is simply changed the process id to a custom name in the .bpm file and addedd the form config of the parallel review workflow form with the new activiti id in the share config custom file. But the Assignees is not showing the reviewers label and select button. Please help.
my bpmn:
<?xml version="1.0" encoding="UTF-8" ?>
<definitions id="review-definitions"
typeLanguage="http://www.w3.org/2001/XMLSchema"
expressionLanguage="http://www.w3.org/1999/XPath"
targetNamespace="http://activiti.org/bpmn20"
xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"
xmlns
mgdc="http://www.omg.org/spec/DD/20100524/DC"
xmlns
mgdi="http://www.omg.org/spec/DD/20100524/DI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:activiti="http://activiti.org/bpmn">
<process id="capitalExpenApproval" name="Purchase team expense Parallel Review And Approve Activiti Process">
<extensionElements>
<activiti:executionListener event="start" class="org.alfresco.repo.workflow.activiti.listener.ScriptExecutionListener">
<activiti:field name="script">
<activiti:string>
execution.setVariable('wf_approveCount', 0);
execution.setVariable('wf_actualPercent', 0);
execution.setVariable('wf_reviewerCount', bpm_assignees.size());
execution.setVariable('wf_requiredPercent', wf_requiredApprovePercent);
</activiti:string>
</activiti:field>
</activiti:executionListener>
</extensionElements>
<startEvent id="start"
activiti:formKey="wf:submitParallelReviewTask" />
<sequenceFlow id='flow1'
sourceRef='start'
targetRef='reviewTask' />
<userTask id="reviewTask" name="Review Task"
activiti:formKey="wf:activitiReviewTask">
<extensionElements>
<activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string>
if (typeof bpm_workflowDueDate != 'undefined') task.setVariableLocal('bpm_dueDate', bpm_workflowDueDate);
if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_workflowPriority;
</activiti:string>
</activiti:field>
</activiti:taskListener>
<activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string>
if(task.getVariableLocal('wf_reviewOutcome') == 'Approve') {
var newApprovedCount = wf_approveCount + 1;
var newApprovedPercentage = (newApprovedCount / wf_reviewerCount) * 100;
execution.setVariable('wf_approveCount', newApprovedCount);
execution.setVariable('wf_actualPercent', newApprovedPercentage);
}
</activiti:string>
</activiti:field>
</activiti:taskListener>
</extensionElements>
<humanPerformer>
<resourceAssignmentExpression>
<formalExpression>${reviewAssignee.properties.userName}</formalExpression>
</resourceAssignmentExpression>
</humanPerformer>
<!– For each assignee, task is created –>
<multiInstanceLoopCharacteristics isSequential="false">
<loopDataInputRef>bpm_assignees</loopDataInputRef>
<inputDataItem name="reviewAssignee" />
<completionCondition>${wf_actualPercent >= wf_requiredApprovePercent}</completionCondition>
</multiInstanceLoopCharacteristics>
</userTask>
<sequenceFlow id='flow2'
sourceRef='reviewTask'
targetRef='reviewDecision' />
<exclusiveGateway id="reviewDecision" name="Review Decision" />
<sequenceFlow id='flow3' sourceRef='reviewDecision' targetRef='approved' >
<conditionExpression xsi:type="tFormalExpression">${wf_actualPercent >= wf_requiredApprovePercent}</conditionExpression>
</sequenceFlow>
<sequenceFlow id='flow4'
sourceRef='reviewDecision'
targetRef='rejected' />
<userTask id="approved" name="Document Approved"
activiti:formKey="wf:approvedParallelTask" >
<documentation>
The document was reviewed and approved.
</documentation>
<extensionElements>
<activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string>
if (typeof bpm_workflowDueDate != 'undefined') task.setVariableLocal('bpm_dueDate', bpm_workflowDueDate);
if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_workflowPriority;
// Set parallel review params on task, to be kept in history
task.setVariableLocal('wf_reviewerCount', wf_reviewerCount);
task.setVariableLocal('wf_requiredPercent', wf_requiredPercent);
task.setVariableLocal('wf_actualPercent', wf_actualPercent);
task.setVariableLocal('wf_approveCount', wf_approveCount);
</activiti:string>
</activiti:field>
</activiti:taskListener>
</extensionElements>
<humanPerformer>
<resourceAssignmentExpression>
<formalExpression>${initiator.properties.userName}</formalExpression>
</resourceAssignmentExpression>
</humanPerformer>
</userTask>
<userTask id="rejected" name="Document Rejected"
activiti:formKey="wf:rejectedParallelTask" >
<documentation>
The document was reviewed and rejected.
</documentation>
<extensionElements>
<activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string>
if (typeof bpm_workflowDueDate != 'undefined') task.setVariableLocal('bpm_dueDate', bpm_workflowDueDate);
if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_workflowPriority;
// Set parallel review params on task, to be kept in history
task.setVariableLocal('wf_reviewerCount', wf_reviewerCount);
task.setVariableLocal('wf_requiredPercent', wf_requiredPercent);
task.setVariableLocal('wf_actualPercent', wf_actualPercent);
task.setVariableLocal('wf_approveCount', wf_approveCount);
</activiti:string>
</activiti:field>
</activiti:taskListener>
</extensionElements>
<humanPerformer>
<resourceAssignmentExpression>
<formalExpression>${initiator.properties.userName}</formalExpression>
</resourceAssignmentExpression>
</humanPerformer>
</userTask>
<sequenceFlow id='flow5' sourceRef='approved'
targetRef='end' />
<sequenceFlow id='flow6' sourceRef='rejected'
targetRef='end' />
<endEvent id="end" />
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_ActivitiParallelReview">
<bpmndi:BPMNPlane bpmnElement="activitiParallelReview" id="BPMNPlane_ActivitiParallelReview">
<bpmndi:BPMNShape bpmnElement="start" id="BPMNShape_start">
<omgdc:Bounds height="35" width="35" x="30" y="200"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="reviewTask" id="BPMNShape_reviewTask">
<omgdc:Bounds height="55" width="105" x="105" y="190"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="reviewDecision" id="BPMNShape_reviewDecision">
<omgdc:Bounds height="40" width="40" x="250" y="197"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="approved" id="BPMNShape_approved">
<omgdc:Bounds height="55" width="105" x="330" y="137"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="end" id="BPMNShape_end">
<omgdc:Bounds height="35" width="35" x="620" y="147"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="rejected" id="BPMNShape_rejected">
<omgdc:Bounds height="55" width="105" x="330" y="257"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
<omgdi:waypoint x="65" y="217"></omgdi:waypoint>
<omgdi:waypoint x="105" y="217"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
<omgdi:waypoint x="210" y="217"></omgdi:waypoint>
<omgdi:waypoint x="250" y="217"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
<omgdi:waypoint x="270" y="197"></omgdi:waypoint>
<omgdi:waypoint x="270" y="164"></omgdi:waypoint>
<omgdi:waypoint x="330" y="164"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
<omgdi:waypoint x="270" y="237"></omgdi:waypoint>
<omgdi:waypoint x="270" y="284"></omgdi:waypoint>
<omgdi:waypoint x="330" y="284"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5">
<omgdi:waypoint x="435" y="164"></omgdi:waypoint>
<omgdi:waypoint x="620" y="164"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">
<omgdi:waypoint x="435" y="284"></omgdi:waypoint>
<omgdi:waypoint x="637" y="284"></omgdi:waypoint>
<omgdi:waypoint x="637" y="182"></omgdi:waypoint>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
form:
<config evaluator="string-compare" condition="activiti$capitalExpenApproval">
<forms>
<form>
<field-visibility>
<show id="bpm:workflowDescription" />
<show id="bpm:workflowDueDate" />
<show id="bpm:workflowPriority" />
<show id="bpm:assignees" />
<show id="packageItems" />
<show id="bpm:sendEMailNotifications" />
</field-visibility>
<appearance>
<set id="" appearance="title" label-id="workflow.set.general" />
<set id="info" appearance="" template="/org/alfresco/components/form/2-column-set.ftl" />
<set id="assignee" appearance="title" label-id="workflow.set.assignees" />
<set id="items" appearance="title" label-id="workflow.set.items" />
<set id="other" appearance="title" label-id="workflow.set.other" />
<field id="bpm:workflowDescription" label-id="workflow.field.message">
<control template="/org/alfresco/components/form/controls/textarea.ftl">
<control-param name="style">width: 95%</control-param>
</control>
</field>
<field id="bpm:workflowDueDate" label-id="workflow.field.due" set="info" />
<field id="bpm:workflowPriority" label-id="workflow.field.priority" set="info">
<control template="/org/alfresco/components/form/controls/workflow/priority.ftl" />
</field>
<field id="bpm:assignees" label-id="workflow.field.reviewers" set="assignee" />
<field id="packageItems" set="items" />
<field id="bpm:sendEMailNotifications" set="other">
<control template="/org/alfresco/components/form/controls/workflow/email-notification.ftl" />
</field>
</appearance>
</form>
</forms>
</config>
I am trying to customise the parallel review workflow in 4.0.d community edition. All I have done is simply changed the process id to a custom name in the .bpm file and addedd the form config of the parallel review workflow form with the new activiti id in the share config custom file. But the Assignees is not showing the reviewers label and select button. Please help.
my bpmn:
<?xml version="1.0" encoding="UTF-8" ?>
<definitions id="review-definitions"
typeLanguage="http://www.w3.org/2001/XMLSchema"
expressionLanguage="http://www.w3.org/1999/XPath"
targetNamespace="http://activiti.org/bpmn20"
xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"
xmlns

xmlns

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:activiti="http://activiti.org/bpmn">
<process id="capitalExpenApproval" name="Purchase team expense Parallel Review And Approve Activiti Process">
<extensionElements>
<activiti:executionListener event="start" class="org.alfresco.repo.workflow.activiti.listener.ScriptExecutionListener">
<activiti:field name="script">
<activiti:string>
execution.setVariable('wf_approveCount', 0);
execution.setVariable('wf_actualPercent', 0);
execution.setVariable('wf_reviewerCount', bpm_assignees.size());
execution.setVariable('wf_requiredPercent', wf_requiredApprovePercent);
</activiti:string>
</activiti:field>
</activiti:executionListener>
</extensionElements>
<startEvent id="start"
activiti:formKey="wf:submitParallelReviewTask" />
<sequenceFlow id='flow1'
sourceRef='start'
targetRef='reviewTask' />
<userTask id="reviewTask" name="Review Task"
activiti:formKey="wf:activitiReviewTask">
<extensionElements>
<activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string>
if (typeof bpm_workflowDueDate != 'undefined') task.setVariableLocal('bpm_dueDate', bpm_workflowDueDate);
if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_workflowPriority;
</activiti:string>
</activiti:field>
</activiti:taskListener>
<activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string>
if(task.getVariableLocal('wf_reviewOutcome') == 'Approve') {
var newApprovedCount = wf_approveCount + 1;
var newApprovedPercentage = (newApprovedCount / wf_reviewerCount) * 100;
execution.setVariable('wf_approveCount', newApprovedCount);
execution.setVariable('wf_actualPercent', newApprovedPercentage);
}
</activiti:string>
</activiti:field>
</activiti:taskListener>
</extensionElements>
<humanPerformer>
<resourceAssignmentExpression>
<formalExpression>${reviewAssignee.properties.userName}</formalExpression>
</resourceAssignmentExpression>
</humanPerformer>
<!– For each assignee, task is created –>
<multiInstanceLoopCharacteristics isSequential="false">
<loopDataInputRef>bpm_assignees</loopDataInputRef>
<inputDataItem name="reviewAssignee" />
<completionCondition>${wf_actualPercent >= wf_requiredApprovePercent}</completionCondition>
</multiInstanceLoopCharacteristics>
</userTask>
<sequenceFlow id='flow2'
sourceRef='reviewTask'
targetRef='reviewDecision' />
<exclusiveGateway id="reviewDecision" name="Review Decision" />
<sequenceFlow id='flow3' sourceRef='reviewDecision' targetRef='approved' >
<conditionExpression xsi:type="tFormalExpression">${wf_actualPercent >= wf_requiredApprovePercent}</conditionExpression>
</sequenceFlow>
<sequenceFlow id='flow4'
sourceRef='reviewDecision'
targetRef='rejected' />
<userTask id="approved" name="Document Approved"
activiti:formKey="wf:approvedParallelTask" >
<documentation>
The document was reviewed and approved.
</documentation>
<extensionElements>
<activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string>
if (typeof bpm_workflowDueDate != 'undefined') task.setVariableLocal('bpm_dueDate', bpm_workflowDueDate);
if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_workflowPriority;
// Set parallel review params on task, to be kept in history
task.setVariableLocal('wf_reviewerCount', wf_reviewerCount);
task.setVariableLocal('wf_requiredPercent', wf_requiredPercent);
task.setVariableLocal('wf_actualPercent', wf_actualPercent);
task.setVariableLocal('wf_approveCount', wf_approveCount);
</activiti:string>
</activiti:field>
</activiti:taskListener>
</extensionElements>
<humanPerformer>
<resourceAssignmentExpression>
<formalExpression>${initiator.properties.userName}</formalExpression>
</resourceAssignmentExpression>
</humanPerformer>
</userTask>
<userTask id="rejected" name="Document Rejected"
activiti:formKey="wf:rejectedParallelTask" >
<documentation>
The document was reviewed and rejected.
</documentation>
<extensionElements>
<activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string>
if (typeof bpm_workflowDueDate != 'undefined') task.setVariableLocal('bpm_dueDate', bpm_workflowDueDate);
if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_workflowPriority;
// Set parallel review params on task, to be kept in history
task.setVariableLocal('wf_reviewerCount', wf_reviewerCount);
task.setVariableLocal('wf_requiredPercent', wf_requiredPercent);
task.setVariableLocal('wf_actualPercent', wf_actualPercent);
task.setVariableLocal('wf_approveCount', wf_approveCount);
</activiti:string>
</activiti:field>
</activiti:taskListener>
</extensionElements>
<humanPerformer>
<resourceAssignmentExpression>
<formalExpression>${initiator.properties.userName}</formalExpression>
</resourceAssignmentExpression>
</humanPerformer>
</userTask>
<sequenceFlow id='flow5' sourceRef='approved'
targetRef='end' />
<sequenceFlow id='flow6' sourceRef='rejected'
targetRef='end' />
<endEvent id="end" />
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_ActivitiParallelReview">
<bpmndi:BPMNPlane bpmnElement="activitiParallelReview" id="BPMNPlane_ActivitiParallelReview">
<bpmndi:BPMNShape bpmnElement="start" id="BPMNShape_start">
<omgdc:Bounds height="35" width="35" x="30" y="200"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="reviewTask" id="BPMNShape_reviewTask">
<omgdc:Bounds height="55" width="105" x="105" y="190"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="reviewDecision" id="BPMNShape_reviewDecision">
<omgdc:Bounds height="40" width="40" x="250" y="197"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="approved" id="BPMNShape_approved">
<omgdc:Bounds height="55" width="105" x="330" y="137"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="end" id="BPMNShape_end">
<omgdc:Bounds height="35" width="35" x="620" y="147"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="rejected" id="BPMNShape_rejected">
<omgdc:Bounds height="55" width="105" x="330" y="257"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
<omgdi:waypoint x="65" y="217"></omgdi:waypoint>
<omgdi:waypoint x="105" y="217"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
<omgdi:waypoint x="210" y="217"></omgdi:waypoint>
<omgdi:waypoint x="250" y="217"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
<omgdi:waypoint x="270" y="197"></omgdi:waypoint>
<omgdi:waypoint x="270" y="164"></omgdi:waypoint>
<omgdi:waypoint x="330" y="164"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
<omgdi:waypoint x="270" y="237"></omgdi:waypoint>
<omgdi:waypoint x="270" y="284"></omgdi:waypoint>
<omgdi:waypoint x="330" y="284"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5">
<omgdi:waypoint x="435" y="164"></omgdi:waypoint>
<omgdi:waypoint x="620" y="164"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">
<omgdi:waypoint x="435" y="284"></omgdi:waypoint>
<omgdi:waypoint x="637" y="284"></omgdi:waypoint>
<omgdi:waypoint x="637" y="182"></omgdi:waypoint>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
form:
<config evaluator="string-compare" condition="activiti$capitalExpenApproval">
<forms>
<form>
<field-visibility>
<show id="bpm:workflowDescription" />
<show id="bpm:workflowDueDate" />
<show id="bpm:workflowPriority" />
<show id="bpm:assignees" />
<show id="packageItems" />
<show id="bpm:sendEMailNotifications" />
</field-visibility>
<appearance>
<set id="" appearance="title" label-id="workflow.set.general" />
<set id="info" appearance="" template="/org/alfresco/components/form/2-column-set.ftl" />
<set id="assignee" appearance="title" label-id="workflow.set.assignees" />
<set id="items" appearance="title" label-id="workflow.set.items" />
<set id="other" appearance="title" label-id="workflow.set.other" />
<field id="bpm:workflowDescription" label-id="workflow.field.message">
<control template="/org/alfresco/components/form/controls/textarea.ftl">
<control-param name="style">width: 95%</control-param>
</control>
</field>
<field id="bpm:workflowDueDate" label-id="workflow.field.due" set="info" />
<field id="bpm:workflowPriority" label-id="workflow.field.priority" set="info">
<control template="/org/alfresco/components/form/controls/workflow/priority.ftl" />
</field>
<field id="bpm:assignees" label-id="workflow.field.reviewers" set="assignee" />
<field id="packageItems" set="items" />
<field id="bpm:sendEMailNotifications" set="other">
<control template="/org/alfresco/components/form/controls/workflow/email-notification.ftl" />
</field>
</appearance>
</form>
</forms>
</config>
Labels:
- Labels:
-
Archive
4 REPLIES 4
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2014 03:33 AM
Hi,
Your bpmn file is not showing up, place the xml code inside <strong>code</strong> tags so that xml syntaxes are visible.
Your bpmn file is not showing up, place the xml code inside <strong>code</strong> tags so that xml syntaxes are visible.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2014 09:41 AM
Hi, the following are the expected files:
form:
form:
<field-visibility> <show id="bpm:workflowDescription" /> <show id="bpm:workflowDueDate" /> <show id="bpm:workflowPriority" /> <show id="bpm:assignees" /> <show id="wf:requiredApprovePercent" /> <show id="packageItems" /> <show id="bpm:sendEMailNotifications" /> </field-visibility> <appearance> <set id="" appearance="title" label-id="workflow.set.general" /> <set id="info" appearance="" template="/org/alfresco/components/form/2-column-set.ftl" /> <set id="assignee" appearance="title" label-id="workflow.set.assignees" /> <set id="items" appearance="title" label-id="workflow.set.items" /> <set id="other" appearance="title" label-id="workflow.set.other" /> <field id="bpm:workflowDescription" label-id="workflow.field.message"> <control template="/org/alfresco/components/form/controls/textarea.ftl"> <control-param name="style">width: 95%</control-param> </control> </field> <field id="bpm:workflowDueDate" label-id="workflow.field.due" set="info" /> <field id="bpm:workflowPriority" label-id="workflow.field.priority" set="info"> <control template="/org/alfresco/components/form/controls/workflow/priority.ftl" /> </field> <field id="wf:requiredApprovePercent" set="assignee" /> <field id="bpm:assignees" label-id="workflow.field.reviewers" set="assignee" /> <field id="packageItems" set="items" /> <field id="bpm:sendEMailNotifications" set="other"> <control template="/org/alfresco/components/form/controls/workflow/email-notification.ftl" /> </field> </appearance> </form>
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2014 09:45 AM
Hi,
form:
model:
form:
<field-visibility> <show id="bpm:workflowDescription" /> <show id="bpm:workflowDueDate" /> <show id="bpm:workflowPriority" /> <show id="bpm:assignees" /> <show id="wf:requiredApprovePercent" /> <show id="packageItems" /> <show id="bpm:sendEMailNotifications" /> </field-visibility> <appearance> <set id="" appearance="title" label-id="workflow.set.general" /> <set id="info" appearance="" template="/org/alfresco/components/form/2-column-set.ftl" /> <set id="assignee" appearance="title" label-id="workflow.set.assignees" /> <set id="items" appearance="title" label-id="workflow.set.items" /> <set id="other" appearance="title" label-id="workflow.set.other" /> <field id="bpm:workflowDescription" label-id="workflow.field.message"> <control template="/org/alfresco/components/form/controls/textarea.ftl"> <control-param name="style">width: 95%</control-param> </control> </field> <field id="bpm:workflowDueDate" label-id="workflow.field.due" set="info" /> <field id="bpm:workflowPriority" label-id="workflow.field.priority" set="info"> <control template="/org/alfresco/components/form/controls/workflow/priority.ftl" /> </field> <field id="wf:requiredApprovePercent" set="assignee" /> <field id="bpm:assignees" label-id="workflow.field.reviewers" set="assignee" /> <field id="packageItems" set="items" /> <field id="bpm:sendEMailNotifications" set="other"> <control template="/org/alfresco/components/form/controls/workflow/email-notification.ftl" /> </field> </appearance> </form>
<?xml version="1.0" encoding="UTF-8"?><definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://activiti.org/bpmn20"> <process id="capitalExpenApproval" name="Purchase team expense Parallel Review And Approve Activiti Process" isExecutable="true"> <extensionElements> <activiti:executionListener event="start" class="org.alfresco.repo.workflow.activiti.listener.ScriptExecutionListener"> <activiti:field name="script"> <activiti:string><![CDATA[execution.setVariable('wf_approveCount', 0); execution.setVariable('wf_actualPercent', 0); execution.setVariable('wf_reviewerCount', bpm_assignees.size()); execution.setVariable('wf_requiredPercent', wf_requiredApprovePercent);]]></activiti:string> </activiti:field> </activiti:executionListener> </extensionElements> <userTask id="reviewTask" name="Review Task" activiti:assignee="${bpm_assignee.properties.userName}" activiti:formKey="lnpwf:assigneeReviewTask"> <extensionElements> <activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener"> <activiti:field name="script"> <activiti:string><![CDATA[if (typeof bpm_workflowDueDate != 'undefined') task.setVariableLocal('bpm_dueDate', bpm_workflowDueDate); if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_workflowPriority;]]></activiti:string> </activiti:field> </activiti:taskListener> <activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener"> <activiti:field name="script"> <activiti:string><![CDATA[if(task.getVariableLocal('wf_reviewOutcome') == 'Approve') { var newApprovedCount = wf_approveCount + 1; var newApprovedPercentage = (newApprovedCount / wf_reviewerCount) * 100; execution.setVariable('wf_approveCount', newApprovedCount); execution.setVariable('wf_actualPercent', newApprovedPercentage); }]]></activiti:string> </activiti:field> </activiti:taskListener> </extensionElements> <humanPerformer> <resourceAssignmentExpression> <formalExpression>${reviewAssignee.properties.userName}</formalExpression> </resourceAssignmentExpression> </humanPerformer> <multiInstanceLoopCharacteristics isSequential="true" activiti:collection="bpm_assignees" activiti:elementVariable="reviewAssignee"> <loopDataInputRef>bpm_assignees</loopDataInputRef> <inputDataItem name="reviewAssignee" /> <completionCondition>${wf_actualPercent >= wf_requiredApprovePercent}</completionCondition> </multiInstanceLoopCharacteristics> </userTask> <sequenceFlow id="flow2" sourceRef="reviewTask" targetRef="reviewDecision"></sequenceFlow> <exclusiveGateway id="reviewDecision" name="Review Decision"></exclusiveGateway> <sequenceFlow id="flow3" sourceRef="reviewDecision" targetRef="approved"> <conditionExpression xsi:type="tFormalExpression"><![CDATA[${wf_actualPercent >= wf_requiredApprovePercent}]]></conditionExpression> </sequenceFlow> <sequenceFlow id="flow4" sourceRef="reviewDecision" targetRef="rejected"></sequenceFlow> <userTask id="approved" name="Document Approved" activiti:assignee="${initiator.properties.userName}" activiti:formKey="wf:approvedParallelTask"> <documentation>The document was reviewed and approved.</documentation> <extensionElements> <activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener"> <activiti:field name="script"> <activiti:string><![CDATA[if (typeof bpm_workflowDueDate != 'undefined') task.setVariableLocal('bpm_dueDate', bpm_workflowDueDate); if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_workflowPriority; // Set parallel review params on task, to be kept in history task.setVariableLocal('wf_reviewerCount', wf_reviewerCount); task.setVariableLocal('wf_requiredPercent', wf_requiredPercent); task.setVariableLocal('wf_actualPercent', wf_actualPercent); task.setVariableLocal('wf_approveCount', wf_approveCount);]]></activiti:string> </activiti:field> </activiti:taskListener> </extensionElements> </userTask> <userTask id="rejected" name="Document Rejected" activiti:assignee="${initiator.properties.userName}" activiti:formKey="wf:rejectedParallelTask"> <documentation>The document was reviewed and rejected.</documentation> <extensionElements> <activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener"> <activiti:field name="script"> <activiti:string><![CDATA[if (typeof bpm_workflowDueDate != 'undefined') task.setVariableLocal('bpm_dueDate', bpm_workflowDueDate); if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_workflowPriority; // Set parallel review params on task, to be kept in history task.setVariableLocal('wf_reviewerCount', wf_reviewerCount); task.setVariableLocal('wf_requiredPercent', wf_requiredPercent); task.setVariableLocal('wf_actualPercent', wf_actualPercent); task.setVariableLocal('wf_approveCount', wf_approveCount);]]></activiti:string> </activiti:field> </activiti:taskListener> </extensionElements> </userTask> <sequenceFlow id="flow5" sourceRef="approved" targetRef="end"></sequenceFlow> <sequenceFlow id="flow6" sourceRef="rejected" targetRef="end"></sequenceFlow> <endEvent id="end"></endEvent> <startEvent id="capitalExpenApproval" name="Purchase team expense Parallel Review And Approve Activiti Process" activiti:formKey="lnpwf:submitParalReviewTask"></startEvent> <sequenceFlow id="flow7" sourceRef="capitalExpenApproval" targetRef="reviewTask"></sequenceFlow> </process> <bpmndi:BPMNDiagram id="BPMNDiagram_capitalExpenApproval"> <bpmndi:BPMNPlane bpmnElement="capitalExpenApproval" id="BPMNPlane_capitalExpenApproval"> <bpmndi:BPMNShape bpmnElement="reviewTask" id="BPMNShape_reviewTask"> <omgdc:Bounds height="55.0" width="105.0" x="105.0" y="190.0"></omgdc:Bounds> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="reviewDecision" id="BPMNShape_reviewDecision"> <omgdc:Bounds height="40.0" width="40.0" x="250.0" y="197.0"></omgdc:Bounds> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="approved" id="BPMNShape_approved"> <omgdc:Bounds height="55.0" width="105.0" x="330.0" y="137.0"></omgdc:Bounds> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="rejected" id="BPMNShape_rejected"> <omgdc:Bounds height="55.0" width="105.0" x="330.0" y="257.0"></omgdc:Bounds> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="end" id="BPMNShape_end"> <omgdc:Bounds height="35.0" width="35.0" x="620.0" y="147.0"></omgdc:Bounds> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="capitalExpenApproval" id="BPMNShape_capitalExpenApproval"> <omgdc:Bounds height="45.0" width="51.0" x="20.0" y="195.0"></omgdc:Bounds> </bpmndi:BPMNShape> <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2"> <omgdi:waypoint x="210.0" y="217.0"></omgdi:waypoint> <omgdi:waypoint x="250.0" y="217.0"></omgdi:waypoint> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3"> <omgdi:waypoint x="270.0" y="197.0"></omgdi:waypoint> <omgdi:waypoint x="270.0" y="164.0"></omgdi:waypoint> <omgdi:waypoint x="330.0" y="164.0"></omgdi:waypoint> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4"> <omgdi:waypoint x="270.0" y="237.0"></omgdi:waypoint> <omgdi:waypoint x="270.0" y="284.0"></omgdi:waypoint> <omgdi:waypoint x="330.0" y="284.0"></omgdi:waypoint> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5"> <omgdi:waypoint x="435.0" y="164.0"></omgdi:waypoint> <omgdi:waypoint x="620.0" y="164.0"></omgdi:waypoint> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6"> <omgdi:waypoint x="435.0" y="284.0"></omgdi:waypoint> <omgdi:waypoint x="637.0" y="284.0"></omgdi:waypoint> <omgdi:waypoint x="637.0" y="182.0"></omgdi:waypoint> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="flow7" id="BPMNEdge_flow7"> <omgdi:waypoint x="71.0" y="217.0"></omgdi:waypoint> <omgdi:waypoint x="105.0" y="217.0"></omgdi:waypoint> </bpmndi:BPMNEdge> </bpmndi:BPMNPlane> </bpmndi:BPMNDiagram></definitions>
model:
<?xml version="1.0" encoding="UTF-8"?><model name="lnpwf:workflowmodel" xmlns="http://www.alfresco.org/model/dictionary/1.0"> <imports> <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/> <import uri="http://www.alfresco.org/model/bpm/1.0" prefix="bpm"/> <import uri="http://www.alfresco.org/model/workflow/1.0" prefix="wf"/> <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/> </imports> <namespaces> <namespace uri="http://www.lexisnexis.com/purchase/workflow/1.0" prefix="lnpwf"/> </namespaces> <types> <type name="lnpwf:submitParalReviewTask"> <!– <parent>wf:submitParallelReviewTask</parent> –> <parent>bpm:startTask</parent> <mandatory-aspects> <aspect>bpm:assignees</aspect> </mandatory-aspects> </type> <type name="lnpwf:assigneeReviewTask"> <parent>wf:activitiReviewTask</parent> </type> </types> </model>
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2014 01:01 AM
see this code
error-1
——————————————————————————————
<extensionElements>
<activiti:executionListener event="start" class="org.alfresco.repo.workflow.activiti.listener.ScriptExecutionListener">
<activiti:field name="script">
<activiti:string><![CDATA[execution.setVariable('wf_approveCount', 0);
execution.setVariable('wf_actualPercent', 0);
execution.setVariable('wf_reviewerCount', bpm_assignees.size());
execution.setVariable('wf_requiredPercent', wf_requiredApprovePercent);]]></activiti:string>
</activiti:field>
</activiti:executionListener>
</extensionElements>
———————————————————————————————————–
you are creating a event that is related to start tag but u have not declare the start event.
and when you are declaring the start event you have to mention the activiti:formkey:"your model type related with start",
e.g. <start event id="start" name="start" activiti:formkey="lnpwf:submitParalReviewTask"> </startevent> as per your code.
If this code is useful,please mark this comment as usefull. Thanku
error-1
——————————————————————————————
<extensionElements>
<activiti:executionListener event="start" class="org.alfresco.repo.workflow.activiti.listener.ScriptExecutionListener">
<activiti:field name="script">
<activiti:string><![CDATA[execution.setVariable('wf_approveCount', 0);
execution.setVariable('wf_actualPercent', 0);
execution.setVariable('wf_reviewerCount', bpm_assignees.size());
execution.setVariable('wf_requiredPercent', wf_requiredApprovePercent);]]></activiti:string>
</activiti:field>
</activiti:executionListener>
</extensionElements>
———————————————————————————————————–
you are creating a event that is related to start tag but u have not declare the start event.
and when you are declaring the start event you have to mention the activiti:formkey:"your model type related with start",
e.g. <start event id="start" name="start" activiti:formkey="lnpwf:submitParalReviewTask"> </startevent> as per your code.
If this code is useful,please mark this comment as usefull. Thanku
