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

cancel
Showing results for 
Search instead for 
Did you mean: 
alf_developer09
Active Member II

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

Jump to solution

I need to hide workflow task custom properties from the workflow-details and task-details page and show only on task-edit page.

Used this below configuration but custom property is still visible on  page on task-details though not visible on workflow-details. 

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>                 
  
<!-- 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 id="task-details">    
     <field-visibility>       
        <hide id="abc:Det"/>   
</field-visibility>           
   <appearance>    
    .....
   </appearance> 
  </form>
</forms>         
</config>

Still able to see custom aspect/property on task  details page with this configuration

1 Solution

Accepted Solutions
alf_developer09
Active Member II

Re: display workflow task custom properties on edit task page ONLY(not on workflow details or task details page) in alfresco share

Jump to solution

For the task-details, there is no specific form-id is used in data-form section. Refer 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>

To customise this task-details form, I added <formId>task-details</formId> as mentioned below.

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

Finally in the share-config-custom.xml file add the configuration like,

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

View solution in original post

3 Replies
vhelmut
Active Member II

Re: display workflow task custom properties on edit task page ONLY(not on workflow details or task details page) in alfresco share

Jump to solution

Hi, defining two forms in one configuration file doesn't solve your problem

You can read about this clearly in Custom Share Workflow UI 

Pay attention to following part:

All tasks, including start tasks should have form configuration defined in this way, they will be shown in both view (task details page) and edit (edit task page) modes so that should be considered when defining forms. As shown above the new info.ftl form control can be used to display metadata on an edit form but in an 'informational' way i.e. not in a disabled form control!

The easiest way to solve your problem:

  1. define your custom .ftl file based on default ftl. For example, try to modify hidden.ftl   
  2. after that use your control in config file to describe the fields that you going to hide:
    <control template="/org/alfresco/components/form/controls/your_custom_ftl_name.ftl"/>

Good luck!

alf_developer09
Active Member II

Re: display workflow task custom properties on edit task page ONLY(not on workflow details or task details page) in alfresco share

Jump to solution

For the task-details, there is no specific form-id is used in data-form section. Refer 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>

To customise this task-details form, I added <formId>task-details</formId> as mentioned below.

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

Finally in the share-config-custom.xml file add the configuration like,

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

alf_developer09
Active Member II

Re: display workflow task custom properties on edit task page ONLY(not on workflow details or task details page) in alfresco share

Jump to solution

Hi Victoria Helmut, Thanks a lot for your response !!