2

我正在将新的工作流程部署到 alfresco 4.0.e。我有一个 formkey="cwf:submitLeaveTask" 的任务,这里是代码:

    <type name="cwf:submitLeaveTask">
        <parent>bpm:startTask</parent>
        <properties>
            <property name="cwf:leaveDescription">
                <type>d:text</type>
            </property>
            <property name="cwf:duration">
                <type>d:int</type>
                <mandatory>true</mandatory>
            </property>
            <property name="cwf:startDate">
                <type>d:date</type>
                <mandatory>true</mandatory>
            </property>
            <property name="cwf:leaveType">
                <type>d:text</type>
                <mandatory>true</mandatory>
                <constraints>
                    <constraint name="cwf:leaveType" type="LIST">
                        <parameter name="allowedValues">
                            <list>
                                <value>paid leave</value>
                                <value>sick leave</value>
                            </list>
                        </parameter>
                    </constraint>
                </constraints>
            </property>
        </properties>
    </type>

此任务使用 formkey:"cwf:submitSubstitutinUSer" 连接到另一个任务

    <type name="cwf:submitSubstitutingUser">
        <parent>bpm:activitiOutcomeTask</parent>
        <properties>
            <property name="cwf:substitutingDecisionForLeaveOutcome">
                <type>d:text</type>
                <default>Reject</default>
                <constraints>
                    <constraint name="cwf:substitutingDecisionForLeaveOutcomeOptions"
                        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>{custom.workflow.model}submitSubstitutingUserDecisionForLeaveOutcome
                </default>
            </property>
        </overrides>
    </type>

我需要在第二个任务中显示 cwf:startDate 和 cwf:duration 。我在 share-workflow-form-config.xml 中有这段代码

<config evaluator="task-type" condition="cwf:submitSubstitutingUser">
    <forms>
        <form>
            <field-visibility>
                <show id="taskOwner" />
                <show id="cwf:startDate"  /> 
                <show id="cwf:duration" /> 
                <show id="cwf:substitutingDecisionForLeaveOutcome" />
            </field-visibility>
            <appearance>
                <set id="" appearance="title" label-id="workflow.set.task.info" />
                <set id="info" appearance="" template="/org/alfresco/components/form/3-column-set.ftl" />
                <set id="response" appearance="title" />

                <field id="taskOwner" set="info"></field>
                <field id="cwf:startDate" set="info"></field>
                <field id="cwf:duration" set="info"></field>
                <field id="cwf:substitutingDecisionForLeaveOutcome" label-id="workflow.field.outcome"
                    set="response">
                    <control
                        template="/org/alfresco/components/form/controls/workflow/activiti-transitions.ftl" />
                </field>

            </appearance>
        </form>
    </forms>

</config>

但是我在我的表单中看不到 cwf:startDate 和 cwf:duration 。出了什么问题,我应该怎么做?

4

2 回答 2

4

您看不到这些属性,因为您将它们放在工作流模型的属性 xml 字段中,附加到另一个任务类型 (cwf:submitLeaveTask)。您应该使用方面而不是属性。Alfresco 中的方面就像您可以在该特定模型的每种类型中重用的对象,而不是一次只能绑定到一种类型的属性:

 <aspects>
  <aspect name="cwf:myAspect">
     <title>My Aspect</title>
     <properties>
        <property name="cwf:startDate">
           <type>d:date</type>
        </property>
        <property name="cwf:duration">
           <type>d:int</type>
        </property>
     </properties>
  </aspect>

然后,您应该将其绑定为:

<type name="cwf:submitLeaveTask">
        <parent>bpm:startTask</parent>
        <properties>
            <property name="cwf:leaveDescription">
                <type>d:text</type>
            </property>
            <property name="cwf:leaveType">
                <type>d:text</type>
                <mandatory>true</mandatory>
                <constraints>
                    <constraint name="cwf:leaveType" type="LIST">
                        <parameter name="allowedValues">
                            <list>
                                <value>paid leave</value>
                                <value>sick leave</value>
                            </list>
                        </parameter>
                    </constraint>
                </constraints>
            </property>
        </properties>
        <mandatory-aspects>
           <aspect>cwf:myAspect</aspect>
        </mandatory-aspects>
    </type>
于 2013-04-30T17:21:34.060 回答
1

在第二个任务中,您必须执行以下操作:

<parent>bpm:cwf:submitLeaveTask</parent>

这将继承第一个表单/任务的字段。

于 2016-05-04T20:10:37.197 回答