我需要从工作流程详细信息和任务详细信息页面隐藏工作流任务自定义属性,并仅在任务编辑页面上显示。目前,它在所有三个页面上都可见。 的 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>
答案 0 :(得分:2)
您可以使用form-id来控制它们。 要在工作流程详细信息页面中隐藏字段(abc:det),可以使用like,
<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>
我希望您可以使用''来配置任务详细信息,但我还没有尝试过。
<强> 更新 强>
对于任务详细信息,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>
一切都准备好了,它对我来说很好。