cancel
Showing results for 
Search instead for 
Did you mean: 

Custom fields in Advanced workflows

roseta
Champ in-the-making
Champ in-the-making
Hello everybody,

I've build a couple of custom workflows with xml files in my Alfresco 3.4d. For one of them I've made a custom field, similar to the basic "priority" field but for a "calification" for the document involved in the workflow.

I would like to take off all the innecesary fields in my custom advanced workflow and add this calification field. I've tryed editing the "share-workflow-form-config.xml" file (in C:\Alfresco\tomcat\webapps\share\WEB-INF\classes\alfresco\share-workflow-form-config.xml) copying the existent task with the name of my tasks but: it adds the "calification" field to ALL my workflow tasks, not just the one I eddited, and it doesn't hide the fields I tell to hide. Here is my code:


   <!–CUSTOMIZED BY ME–>
  
   <config evaluator="task-type" condition="new:evaluationTask">
      <forms>
         <form>
            <field-visibility>
               <show id="message" />
               <show id="taskOwner" />

              <show id="bpm:calification/>
              <hide id="bpm:priority" />
               <hide id="bpm:dueDate" />
               <hide id="bpm:taskId" />
               <hide id="bpm:status" />

               <show id="packageItems" />
               <show id="bpm:comment" />
               <show id="transitions" />
            </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="progress" appearance="title" label-id="workflow.set.task.progress" />
               <set id="items" appearance="title" label-id="workflow.set.items" />
               <set id="response" appearance="title" label-id="workflow.set.response" />
              
               <field id="message">
                  <control template="/org/alfresco/components/form/controls/info.ftl" />
               </field>
               <field id="taskOwner" set="info" />
               <field id="bpm:calification" label-id="workflow.field.calification" set="info" />
               <field id="packageItems" set="items" />
               <field id="bpm:comment" label-id="workflow.field.comment" set="response">
                  <control template="/org/alfresco/components/form/controls/textarea.ftl" />
               </field>
               <field id="transitions" set="response" />
            </appearance>
         </form>
      </forms>
   </config>


Copied from:
 …  <config evaluator="task-type" condition="wf:approvedTask">
      <forms>
         <form>
            <field-visibility>
               <show id="message" />
               <show id="taskOwner" />
               <show id="bpm:priority" />
               <show id="bpm:dueDate" />
               <show id="bpm:taskId" />
               <show id="bpm:status" />
               <show id="packageItems" />
               <show id="bpm:comment" />
               <show id="transitions" />
            </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="progress" appearance="title" label-id="workflow.set.task.progress" />
               <set id="items" appearance="title" label-id="workflow.set.items" />
               <set id="response" appearance="title" label-id="workflow.set.response" />
              
               <field id="message">
                  <control template="/org/alfresco/components/form/controls/info.ftl" />
               </field>
               <field id="taskOwner" set="info" />
               <field id="bpm:taskId" set="info">
                  <control template="/org/alfresco/components/form/controls/info.ftl" />
               </field>
               <field id="bpm:priority" set="info" read-only="true">
                  <control template="/org/alfresco/components/form/controls/workflow/priority.ftl" />
               </field>
               <field id="bpm:dueDate" set="info" label-id="workflow.field.due">
                  <control template="/org/alfresco/components/form/controls/info.ftl" />
               </field>
               <field id="bpm:status" set="progress" />
               <field id="packageItems" set="items" />
               <field id="bpm:comment" label-id="workflow.field.comment" set="response">
                  <control template="/org/alfresco/components/form/controls/textarea.ftl" />
               </field>
               <field id="transitions" set="response" />
            </appearance>
         </form>
      </forms>
   </config>
   

Is there anywhere else where I can customize my advanced workflow taks for Alfresco Share? I would really appreciate any help in here. THANKS
3 REPLIES 3

amitev
Champ in-the-making
Champ in-the-making
The workflow forms can be defined in *alfresco/web-extension/share-config-custom.xml*. You have to put this file in the class path (WEB-INF/classes, /tomcat/shared/classes). And there you define your form configurations.

roseta
Champ in-the-making
Champ in-the-making
Thank you! I will try it right now.

But, do you mean to paste the share-config-custom.xml file into /tomcat/shared/classes??? I think I didn't get you well….

amitev
Champ in-the-making
Champ in-the-making
When you install Alfresco Community edition there is a bundled tomcat where Alfresco and Share are deployed. Go in /Alfresco/tomcat/shared/classes/alfresco/web-extension and there you will see a file named share-config-custom.xml.sample. Remove .sample extension from the file name and it is ready to use.