Я хочу создать пользовательский рабочий процесс для просмотра документа группой, в которую входят два пользователя, и эти два пользователя должны иметь возможность просматривать документ параллельно. Как я могу это сделать?
Все, что я сделал, это просмотр документа одним пользователем (см. Прилагаемый код), что мне нужно изменить, чтобы назначить задачу проверки группе?
Activiti спрос документооборот-context.xml
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
<bean id="lifecycle.workflowaBootstrap" parent="workflowDeployer">
<property name="workflowDefinitions">
<list>
<props>
<prop key="engineId">activiti</prop>
<prop key="location">alfresco/extension/activiti-demand.bpmn20.xml</prop>
<prop key="mimetype">text/xml</prop>
<prop key="redeploy">false</prop>
</props>
</list>
</property>
<property name="models">
<list>
<value>alfresco/extension/workflowdemandModel.xml</value>
</list>
</property>
<property name="labels">
<list>
<value>alfresco/extension/activiti-demand-messages</value>
</list>
</property>
</bean>
</beans>
activiti-demand-messages.properties
activitiDemand.workflow.title=Demand
activitiDemand.workflow.description=Process of demand validation
wfa_workflowmodelk.type.wfa_submitReviewTaskk.title=review demand
wfa_workflowmodelk.type.wfa_submitReviewTaskk.description=review demand
workflowdemandModel.xml
<?xml version="1.0" encoding="UTF-8"?>
<model name="wfa:workflowmodelk" 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"/>
</imports>
<namespaces>
<namespace uri="wfa.workflow.model" prefix="wfa"/>
</namespaces>
<types>
<!-- -->
<!-- Basic Review & Approve Tasks -->
<!-- -->
<type name="wfa:submitReviewTaskk">
<parent>bpm:startTask</parent>
<mandatory-aspects>
<aspect>bpm:assignee</aspect>
</mandatory-aspects>
</type>
<type name="wfa:activitiReviewTaskk">
<parent>bpm:activitiOutcomeTask</parent>
<properties>
<property name="wfa:reviewOutcome">
<type>d:text</type>
<default>Reject</default>
<constraints>
<constraint name="wfa:reviewOutcomeOptions" type="LIST">
<parameter name="allowedValues">
<list>
<value>Approve</value>
<value>Reject</value>
</list>
</parameter>
</constraint>
</constraints>
</property>
</properties>
<overrides>
<property name="bpm:packageItemActionGroup">
<default>edit_package_item_actions</default>
</property>
<property name="bpm:outcomePropertyName">
<default>{http://www.alfresco.org/model/workflow/1.0}reviewOutcome</default>
</property>
</overrides>
</type>
<type name="wfa:approvedTaskk">
<parent>bpm:workflowTask</parent>
</type>
<type name="wfa:rejectedTaskk">
<parent>bpm:workflowTask</parent>
</type>
</types>
</model>
Activiti-demand.bpmn20.xml
<?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://alfresco.org">
<process id="activitiDemand" name="review process">
<startEvent id="start" name="Submit Review Task"
activiti:formKey="wfa:submitReviewTaskk" />
<sequenceFlow id='flow1'
sourceRef='start'
targetRef='reviewTask' />
<userTask id="reviewTask" name="Review Task"
activiti:formKey="wfa:activitiReviewTaskk">
<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.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>
execution.setVariable('wfa_reviewOutcome', task.getVariable('wfa_reviewOutcome'));
if (task.getVariable('wfa_reviewOutcome') == 'Approve')
{
bpm_package.children[0].addTag("Approved_demand");
}
else
{
if (task.getVariable('wfa_reviewOutcome') == 'Reject')
{
bpm_package.children[0].addTag("Rejected_demand");
}
}
</activiti:string>
</activiti:field>
<activiti:field name="runAs">
<activiti:string>admin</activiti:string>
</activiti:field>
</activiti:taskListener>
</extensionElements>
<humanPerformer>
<resourceAssignmentExpression>
<formalExpression>${bpm_assignee.properties.userName}</formalExpression>
</resourceAssignmentExpression>
</humanPerformer>
</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">${wfa_reviewOutcome == 'Approve'}</conditionExpression>
</sequenceFlow>
<sequenceFlow id='flow4'
sourceRef='reviewDecision'
targetRef='rejected' />-->
<!-- <userTask id="approved" name="Document Approved"
activiti:formKey="wfa:approvedTaskk" >
<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>
execution.setVariable("bpm_assignee", task.getVariable("bpm_assignee"));
if (typeof bpm_workflowDueDate != 'undefined') task.dueDate = bpm_workflowDueDate
if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_workflowPriority;
</activiti:string>
</activiti:field>
</activiti:taskListener>
</extensionElements>
<humanPerformer>
<resourceAssignmentExpression>
<formalExpression>${initiator.exists() ? initiator.properties.userName : 'admin'}</formalExpression>
</resourceAssignmentExpression>
</humanPerformer>
</userTask>-->
<!-- <userTask id="rejected" name="Document Rejected"
activiti:formKey="wfa:rejectedTaskk" >
<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>
execution.setVariable("bpm_assignee", task.getVariable("bpm_assignee"));
if (typeof bpm_workflowDueDate != 'undefined') task.dueDate = bpm_workflowDueDate
if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_workflowPriority;
</activiti:string>
</activiti:field>
</activiti:taskListener>
</extensionElements>
<humanPerformer>
<resourceAssignmentExpression>
<formalExpression>${initiator.exists() ? initiator.properties.userName : 'admin'}</formalExpression>
</resourceAssignmentExpression>
</humanPerformer>
</userTask>-->
<!-- <sequenceFlow id='flow5' sourceRef='approved'
targetRef='end' />
<sequenceFlow id='flow6' sourceRef='rejected'
targetRef='end' />-->
<endEvent id="end" />
</process>
<!-- Graphical representaion of diagram -->
<bpmndi:BPMNDiagram id="BPMNDiagram_activitiReview">
<bpmndi:BPMNPlane bpmnElement="activitiReview"
id="BPMNPlane_activitiReview">
<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="125"
y="190"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="reviewDecision"
id="BPMNShape_reviewDecision">
<omgdc:Bounds height="40" width="40" x="290" y="197"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="approved"
id="BPMNShape_approved">
<omgdc:Bounds height="55" width="105" x="390"
y="97"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="rejected"
id="BPMNShape_rejected">
<omgdc:Bounds height="55" width="105" x="390"
y="297"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="end" id="BPMNShape_end">
<omgdc:Bounds height="35" width="35" x="555" y="307"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
<omgdi:waypoint x="65" y="217"></omgdi:waypoint>
<omgdi:waypoint x="125" y="217"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
<omgdi:waypoint x="230" y="217"></omgdi:waypoint>
<omgdi:waypoint x="290" y="217"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
<omgdi:waypoint x="310" y="197"></omgdi:waypoint>
<omgdi:waypoint x="310" y="124"></omgdi:waypoint>
<omgdi:waypoint x="390" y="124"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
<omgdi:waypoint x="310" y="237"></omgdi:waypoint>
<omgdi:waypoint x="310" y="324"></omgdi:waypoint>
<omgdi:waypoint x="390" y="324"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5">
<omgdi:waypoint x="495" y="124"></omgdi:waypoint>
<omgdi:waypoint x="572" y="124"></omgdi:waypoint>
<omgdi:waypoint x="572" y="307"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">
<omgdi:waypoint x="495" y="324"></omgdi:waypoint>
<omgdi:waypoint x="555" y="324"></omgdi:waypoint>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>