【问题标题】:Edit task workflow FORM change编辑任务工作流 FORM 更改
【发布时间】:2012-02-01 10:55:00
【问题描述】:

我已经创建了自己的自定义工作流(现在这只是临时工作流自定义)并且我已经设法自定义启动工作流表单,但是无法自定义第二个表单,这是编辑任务表单(当用户启动流程并分配到“某人”,“某人”在收件箱中获取任务,他会看到编辑任务表单)。第二种形式与我的第一种形式相同,加上一些额外的字段。这是因为我需要“某人”可以查看和编辑在启动工作流表单上输入的数据。所以我基本上将第一个表单配置复制到第二个表单,但这不起作用,只呈现集合和文本区域。任何人现在我该如何定制这个?

工作流程定义

<process id="appppV1" name="Proces otvaranja projekta">

<startEvent id="start" name="Start" activiti:formKey="mcwm:submitStart"></startEvent>

<userTask id="preparationOfProjectCharter" name="Priprema projektne povelje" activiti:assignee="${bpm_assignee.properties.userName}" activiti:formKey="mcwm:preparationOfProjectCharter">
  <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);</activiti:string>
      </activiti:field>
    </activiti:taskListener>
  </extensionElements>
</userTask>

工作流模型:

<types>
    <type name="mcwm:submitStart">
        <parent>bpm:startTask</parent>
        <properties>
            <property name="mcwm:projectName">
                <title>Naziv projekta</title>
                <type>d:text</type>
                <mandatory>true</mandatory>
            </property>
            <property name="mcwm:shortProjectName">
                <title>Skraćeni naziv projekta</title>
                <type>d:text</type>
                <mandatory>false</mandatory>
            </property>
            <property name="mcwm:projectOrderer">
                <title>Naručitelj projekta</title>
                <type>d:text</type>
                <mandatory>false</mandatory>
            </property>
            <property name="mcwm:shortProjectOrderer">
                <title>Skraćeni naziv naručitelja projekta</title>
                <type>d:text</type>
                <mandatory>false</mandatory>
            </property>
            <property name="mcwm:isoProcess">
                <title>ISO 9000 proces</title>
                <type>d:text</type>
                <mandatory>true</mandatory>
                <default> </default>
                <constraints>
                    <constraint name="mcwm:isoProcessChoices" type="LIST">
                        <parameter name="allowedValues">
                            <list>
                                <value> </value>
                                <value>održavanje - aplikativno</value>
                                <value>održavanje - sistemsko</value>
                                <value>konsalting</value>
                                <value>razvoj - sa odobrenjem arhitekture</value>
                                <value>razvoj - bez odobrenjem arhitekture</value>
                                <value>mali razvoj</value>
                                <value>implementacija</value>
                            </list>
                        </parameter>
                    </constraint>
                </constraints>
            </property>
            <property name="mcwm:reporting">
                <title>Učestalost izveštavanja</title>
                <type>d:text</type>
                <mandatory>true</mandatory>
                <default>mesečno</default>
                <constraints>
                    <constraint name="mcwm:reportingChoices" type="LIST">
                        <parameter name="allowedValues">
                            <list>
                                <value>mesečno</value>
                                <value>kvartalno</value>
                                <value>po okončanju</value>
                            </list>
                        </parameter>
                    </constraint>
                </constraints>
            </property>
            <property name="mcwm:projectGoals">
                <title>Ciljevi projekta</title>
                <type>d:text</type>
                <mandatory>false</mandatory>
            </property>

            <property name="mcwm:beginDate">
                <title>Datum početka projekta</title>
                <type>d:date</type>
                <mandatory>true</mandatory>
            </property>

            <property name="mcwm:endDate">
                <title>Datum okončanja projekta</title>
                <type>d:date</type>
                <mandatory>false</mandatory>
            </property>

            <property name="mcwm:team">
                <title>Projektni tim (*promena tipa kontorle)</title>
                <type>d:text</type>
                <mandatory>false</mandatory>
            </property>

            <property name="mcwm:teamResource">
                <title>Predviđeni utrošak ljudskih resursa (*promena tipa kontorle)</title>
                <type>d:text</type>
                <mandatory>false</mandatory>
            </property>

            <property name="mcwm:teamComent">
                <title>Komentar na predviđeni utrošak ljudskih resursa</title>
                <type>d:text</type>
                <mandatory>false</mandatory>
            </property>

            <property name="mcwm:changeComent">
                <title>Komentar izmene</title>
                <type>d:text</type>
                <mandatory>false</mandatory>
            </property>
        </properties>   
     <!--  To select a user -->
     <mandatory-aspects>
        <aspect>bpm:assignee</aspect>
     </mandatory-aspects>
    </type>

    <type name="mcwm:preparationOfProjectCharter">
        <parent>bpm:workflowTask</parent>
        <properties>
            <property name="mcwm:editTask">
                <title>Edit task</title>
                <type>d:text</type>
                <mandatory>true</mandatory>
            </property>
        </properties>
    </type>

share-config-custom.xml

<config evaluator="string-compare" condition="activiti$appppV1">
  <forms>
     <form>
        <field-visibility>
           <hide id="bpm:workflowDescription" />
           <hide id="bpm:workflowDueDate" />
           <hide id="bpm:workflowPriority" />
           <show id="bpm:assignee" />

           <show id="mcwm:projectName" />
           <show id="mcwm:shortProjectName" />
           <show id="mcwm:projectOrderer" />
           <show id="mcwm:shortProjectOrderer" />
           <show id="mcwm:isoProcess" />
           <show id="mcwm:reporting"/>
           <show id="mcwm:projectGoals"/>
           <show id="mcwm:beginDate"/>
           <show id="mcwm:endDate"/>

           <show id="mcwm:team"/>
           <show id="mcwm:teamResource"/>
           <show id="mcwm:teamComent"/>
           <show id="mcwm:changeComent"/>


           <hide id="packageItems" />
           <hide id="bpm:sendEMailNotifications" />
        </field-visibility>
        <appearance>
            <set id="" appearance="title" label-id="apppv1.set.projekat" />
            <set id="general" appearance="fieldset" label-id="appppV1.set.general" />
            <set id="date" template="/org/alfresco/components/form/2-column-set.ftl" appearance="fieldset" label-id="appppV1.set.date" />
            <set id="team" appearance="fieldset" label-id="appppV1.set.team" />
            <set id="change" appearance="fieldset" label-id="appppV1.set.change" />


           <field id="mcwm:projectName" set="general" />
           <field id="mcwm:shortProjectName" set="general" />
           <field id="mcwm:projectOrderer" set="general" />
           <field id="mcwm:shortProjectOrderer" set="general" />
           <field id="mcwm:isoProcess" set="general" />
           <field id="mcwm:reporting" set="general" />

           <field id="mcwm:projectGoals" set="general">
                <control template="/org/alfresco/components/form/controls/textarea.ftl">
                    <control-param name="style">width: 65%</control-param>
                    <control-param name="rows">5</control-param>
                </control>
            </field>

            <field id="mcwm:beginDate" set="date"/>
            <field id="mcwm:endDate" set="date"/>
            <field id="bpm:assignee" set="team" label="Voditelj projekta"/>
            <field id="mcwm:team" set="team">
                <control template="/org/alfresco/components/form/controls/textarea.ftl">
                    <control-param name="style">width: 65%</control-param>
                    <control-param name="rows">5</control-param>
                </control>
            </field>
            <field id="mcwm:teamResource" set="team"/>
            <field id="mcwm:teamComent" set="team">
                <control template="/org/alfresco/components/form/controls/textarea.ftl">
                    <control-param name="style">width: 65%</control-param>
                    <control-param name="rows">5</control-param>
                </control>
            </field>

            <field id="mcwm:changeComent" set="change">
                <control template="/org/alfresco/components/form/controls/textarea.ftl">
                    <control-param name="style">width: 65%</control-param>
                    <control-param name="rows">5</control-param>
                </control>
            </field>
        </appearance>
     </form>
  </forms>

share-config-custom.xml - 第二种形式

<config evaluator="task-type" condition="mcwm:preparationOfProjectCharter">
    <forms>
        <form>
            <field-visibility>
                <show id="mcwm:projectName"/>
                <show id="mcwm:editTask"/>
                <hide id="bpm:workflowDescription" />
                <hide id="bpm:workflowDueDate" />
                <hide id="bpm:workflowPriority" />
                <show id="bpm:assignee" />

                <show id="mcwm:projectName" />
                <show id="mcwm:shortProjectName" />
                <show id="mcwm:projectOrderer" />
                <show id="mcwm:shortProjectOrderer" />
                <show id="mcwm:isoProcess" />
                <show id="mcwm:reporting"/>
                <show id="mcwm:projectGoals"/>
                <show id="mcwm:beginDate"/>
                <show id="mcwm:endDate"/>

                <show id="mcwm:team"/>
                <show id="mcwm:teamResource"/>
                <show id="mcwm:teamComent"/>
                <show id="mcwm:changeComent"/>
             </field-visibility>
            <appearance>
                <set id="" appearance="title" label-id="apppv1.set.projekat" />
                <set id="general" appearance="fieldset" label-id="appppV1.set.general" />
                <set id="date" template="/org/alfresco/components/form/2-column-set.ftl" appearance="fieldset" label-id="appppV1.set.date" />
                <set id="team" appearance="fieldset" label-id="appppV1.set.team" />
                <set id="change" appearance="fieldset" label-id="appppV1.set.change" />


               <field id="mcwm:projectName" set="general" />
               <field id="mcwm:shortProjectName" set="general" />
               <field id="mcwm:projectOrderer" set="general" />
               <field id="mcwm:shortProjectOrderer" set="general" />
               <field id="mcwm:isoProcess" set="general" />
               <field id="mcwm:reporting" set="general" />

               <field id="mcwm:projectGoals" set="general">
                    <control template="/org/alfresco/components/form/controls/textarea.ftl">
                        <control-param name="style">width: 65%</control-param>
                        <control-param name="rows">5</control-param>
                    </control>
                </field>

                <field id="mcwm:beginDate" set="date"/>
                <field id="mcwm:endDate" set="date"/>
                <field id="bpm:assignee" set="team" label="Voditelj projekta"/>
                <field id="mcwm:team" set="team">
                    <control template="/org/alfresco/components/form/controls/textarea.ftl">
                        <control-param name="style">width: 65%</control-param>
                        <control-param name="rows">5</control-param>
                    </control>
                </field>
                <field id="mcwm:teamResource" set="team"/>
                <field id="mcwm:teamComent" set="team">
                    <control template="/org/alfresco/components/form/controls/textarea.ftl">
                        <control-param name="style">width: 65%</control-param>
                        <control-param name="rows">5</control-param>
                    </control>
                </field>

                <field id="mcwm:changeComent" set="change">
                    <control template="/org/alfresco/components/form/controls/textarea.ftl">
                        <control-param name="style">width: 65%</control-param>
                        <control-param name="rows">5</control-param>
                    </control>
                </field>
                <field id="mcwm:editTask" set="general" read-only="true"/>
            </appearance>
        </form>
    </forms>

我尝试在带有 force="true" 属性的显示标签中使用,这显示了我的归档,但数据没有从我开始传输?!

提前感谢您的帮助。

问候, 亚历山大

【问题讨论】:

    标签: workflow share alfresco activiti


    【解决方案1】:

    我认为您没有看到任何字段,因为 mcwm:preparationOfProjectCharter 任务没有您要显示的属性。

    如果您希望第二个任务具有与第一个任务相同的属性,则必须在任务模型中定义它们。

    如果属性完全相同且重复很多,您可以将它们指定为方面,并将它们作为强制方面添加到任务模型中。

    【讨论】:

    • 嗨,我又来了。 :) 我上面描述的解决方案有效,但必须明确地将任务属性放在流程上,并且这些属性完全相同并且重复(流程中的每个任务都有它们)所以我决定定义自定义方面并将它们添加为您的强制性描述。有一个小问题没关系。就我而言,我有三个属性,都是强制性的。在我的第二个任务中,我添加了该方面,我想将方面属性强制设置为 false,我使用覆盖属性标签,但这不起作用,这可能吗?
    • 你在哪里使用覆盖标签?
    • 在我的第二个任务模型中。我在第一个和第二个任务中添加方面作为强制性。默认情况下,方面的属性设置为强制,这对于我的第一个任务来说没问题,但我希望在第二个任务中将这些属性设置为强制 = false。我在第二个任务模型中使用 false 但这没有效果。
    【解决方案2】:

    感谢您的帮助。 :) 我做了一些非常相似的事情。我刚刚设置了我的第二个任务,父母是第一个任务

    <type name="mcwm:preparationOfProjectCharter">
    <parent>mcwm:submitStart</parent>
    

    现在我在第二个任务上拥有第一个任务的所有属性。

    问候,

    亚历山大

    【讨论】:

    • 现在对我有用 :)。我正在使用 Alfresco Enterprise Edition 4.0。
    猜你喜欢
    • 2011-03-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-11-04
    • 2021-08-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多