Alfresco Workflow表单中的多个受让人控件 [英] Multiple assignee controls in Alfresco Workflow form

查看:144
本文介绍了Alfresco Workflow表单中的多个受让人控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要构建一个工作流程,允许管理员在工作流程的第一个任务中从两个不同的组中选择两个受理人。我可以在一个表格中使用两个受让人控件吗?怎么样?

I'm required to build a workflow that allows the admin to select two assignees from two different groups in the first task of the workflow. Can I use two assignee controls in one form ? How?

推荐答案

你需要:


  • 在任务内容模型中,将2个受理人定义为您的任务类型的2个单独关联。

  • In the task content model, define the 2 assignees as 2 seperate associations of your task type.

    <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>


  • 在您的共享配置自定义中,将2个关联定义为权限控制:

  • In your share config custom, define the 2 associations as authority controls:

          <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>
    


  • 在你的bpm20文件中,在你的进程中定义两个ActivitiScriptNode变量,在usertask中定义一个ExecutionListener / starttask有两个cm:person关联。该执行监听器应该获取输入的值并将它们放入进程范围的变量中,如下所示:

  • In your bpm20 file, define two ActivitiScriptNode vars in your process and an ExecutionListener to the usertask/starttask having the two cm:person associations. That execution listener should be taking the entered values and placing them into the process scoped variables like this:

      <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>
    


  • 然后将此代码添加到UserTasks,分配给输入的用户,如下所示:

  • Then add this code to the UserTasks you which to assign to the entered users like this:

    <humanPerformer>
                <resourceAssignmentExpression>
                    <formalExpression>${firstActivitiScriptNodeVar.properties.userName}</formalExpression>
                </resourceAssignmentExpression>
    </humanPerformer>
    


  • 这篇关于Alfresco Workflow表单中的多个受让人控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    相关文章
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆