仅在编辑任务页面上显示工作流任务自定义属性(不在工作流详细信息或任务详细信息页面上) alfresco share

display workflow task custom properties on edit task page only (not on workflow details or task details page) alfresco share

我需要从工作流详细信息和任务详细信息页面隐藏工作流任务自定义属性,并仅在任务编辑中显示 page.Currently 它在所有三个页面上都可见。 abcmodel.xml

<type name="abc:review">
            <parent>bpm:activitiOutcomeTask</parent>
            <mandatory-aspects>  
            <aspect>abc:Info</aspect>
            </mandatory-aspects> 
            </type>
<aspects>
      <aspect name="abc:Info">
         <properties>
             <property name="abc:Det">
             <type>d:mltext</type>
             </property> 
        </properties>
      </aspect>
</aspects>

shareconfigcustom.xml

<config evaluator="task-type" condition="abc:review">
                    <forms>
                         <form>
                            <field-visibility>
                                <show id="abc:Det"/>
                                <show id="bpm:comment" />
                            </field-visibility>
                            <appearance>
                                <field id="abc:Det" label="customproperty" read-only="true">
                                <control template="/org/alfresco/components/form/controls/textarea.ftl">
                                <control-param name="style">color: black</control-param>
                                <control-param name="rows">6</control-param>
                                <control-param name="columns">6</control-param>
                                </control>
                                </field>
                                <field id="bpm:comment" label="Comments">
                                    <control template="/org/alfresco/components/form/controls/textarea.ftl" />
                                </field>
                            </appearance>
                        </form>
                    </forms>
                </config>

你可以使用form-id来控制它们。 要隐藏工作流详细信息页面中的字段 (abc:det),您可以使用

    <config evaluator="task-type" condition="abc:review">
    <forms>
         <form>
            <field-visibility>
                <show id="abc:Det"/>
                <show id="bpm:comment" />
            </field-visibility>
            <appearance>
                <field id="abc:Det" label="customproperty" read-only="true">
                <control template="/org/alfresco/components/form/controls/textarea.ftl">
                <control-param name="style">color: black</control-param>
                <control-param name="rows">6</control-param>
                <control-param name="columns">6</control-param>
                </control>
                </field>
                <field id="bpm:comment" label="Comments">
                    <control template="/org/alfresco/components/form/controls/textarea.ftl" />
                </field>
            </appearance>
        </form>
         <!-- Form configuration for workflow-details page -->
        <form id="workflow-details">
            <field-visibility>
                <hide id="abc:Det"/>
                <show id="bpm:comment" />
             </field-visibility> 
             <appearance>                               
                .....
            </appearance>
        </form> 
         <!-- Form configuration for task-details page -->
        <form id="task-details">
            <field-visibility>
                <hide id="abc:Det"/>
                <show id="bpm:comment" />
             </field-visibility> 
             <appearance>                               
                .....
            </appearance>
        </form>
    </forms>
</config>

希望大家可以使用,''来配置task-details,我还没试过

更新 对于任务详细信息,data-form 部分没有使用特定的表单 ID。参考 C:\<Alfresco_Home>\tomcat\webapps\share\WEB-INF\classes\alfresco\site-data\pages\task-details.xml

  <!-- Data Form -->
  <component>
     <region-id>data-form</region-id>
     <url>/components/form</url>
     <properties>
        <itemKind>task</itemKind>
        <itemId>{taskId}</itemId>
        <mode>view</mode>
        <formUI>true</formUI>
     </properties>
  </component>

为了自定义此任务详细信息表单,我添加了 <formId>task-details</formId>,如下所述。

  <!-- Data Form -->
  <component>
     <region-id>data-form</region-id>
     <url>/components/form</url>
     <properties>
        <itemKind>task</itemKind>
        <itemId>{taskId}</itemId>
        <mode>view</mode>
        <formUI>true</formUI>
        <formId>task-details</formId>
     </properties>
  </component>

您需要使用共享扩展/自定义最佳实践来更改共享中的 OOTB 文件。 Alfresco Share extensions

最后在 share-config-custom.xml 文件中添加如下配置,

 <form id="task-details">
    <field-visibility>
        <hide id="abc:Det"/>
        <show id="bpm:comment" />
     </field-visibility> 
     <appearance>                               
        .....
    </appearance>
</form>     

一切就绪,对我来说一切正常。