Alfresco:在另一个任务中显示任务字段(查看它们) [英] Alfresco: Show task fields in another task(view them)

查看:84
本文介绍了Alfresco:在另一个任务中显示任务字段(查看它们)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将新的工作流程部署到alfresco4.0.e。
我有一个带有formkey = cwf:submitLeaveTask的任务
这是代码:

I'm deploying new workflow to alfresco 4.0.e. I have a task with formkey="cwf:submitLeaveTask" here is the code:

    <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

This task connected to another task with 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中有此代码

I need to show cwf:startDate and cwf:duration in my second task. I have this code in 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。
有什么问题以及我应该怎么做?

But I cant see cwf:startDate and cwf:duration in my form. What is wrong and how I should do it?

推荐答案

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

You can't see those properties because you put them in the property xml field in the workflow model, appended to another task type (cwf:submitLeaveTask). You should use aspects instead of properties. Aspects in Alfresco are like objects that you can reuse in every type in that particular model, instead of properties that can only be bound to one type at once:

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

然后,您应该将其绑定这样:

Then, you should bind that as this:

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

这篇关于Alfresco:在另一个任务中显示任务字段(查看它们)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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