我需要构建一个工作流,允许管理员在工作流的第一个任务中从两个不同的组中选择两个受让人。我可以在一种形式中使用两个受让人控件吗?如何?
最佳答案
你需要:
<type name="my:starttask">
<parent>bpm:startTask</parent>
<associations>
<association name="my:firstassignee">
<title>firstassignee</title>
<source>
<mandatory>false</mandatory>
<many>false</many>
</source>
<target>
<class>cm:person</class>
<mandatory>false</mandatory>
<many>false</many>
</target>
</association>
<association name="my:secondassignee">
<title>secondassignee</title>
<source>
<mandatory>false</mandatory>
<many>false</many>
</source>
<target>
<class>cm:person</class>
<mandatory>false</mandatory>
<many>false</many>
</target>
</association>
</associations>
</type>
<config condition="activiti$myworkflow" evaluator="string-compare">
<forms>
<form>
<field-visibility>
<show id="my:firstassignee" />
<show id="my:secondassignee" />
</field-visibility>
<appearance>
<field set="actors" id="my:firstassignee" >
<control template="/org/alfresco/components/form/controls/authority.ftl">
</control>
</field>
<field set="actors" id="my:secondassignee">
<control template="/org/alfresco/components/form/controls/authority.ftl">
</control>
</field>
<extensionElements>
<activiti:taskListener class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener" event="complete">
<activiti:field name="script">
<activiti:string>
execution.setVariable('firstActivitiScriptNodeVar', task.getVariable('my_firstassignee'));
execution.setVariable('secondActivitiScriptNodeVar', task.getVariable('my_secondassignee'));
</activiti:string>
</activiti:field>
</activiti:taskListener>
</extensionElements>
<humanPerformer>
<resourceAssignmentExpression>
<formalExpression>${firstActivitiScriptNodeVar.properties.userName}</formalExpression>
</resourceAssignmentExpression>
</humanPerformer>
关于jakarta-ee - Alfresco Workflow 表单中的多个受理人控件,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/34612055/