AnsweredAssumed Answered

Edit task workflow FORM change

Question asked by azivotic on Feb 1, 2012
Latest reply on Feb 2, 2012 by azivotic
Hi,

I have created my own custom workflow (for now this is just adhoc workflow customization)  and i have managed to customize start workflow form, however a can not customize second form, this is edit task form (when user start process and assign to "someone", "someone" get task in inbox and he see edit task form). This second form is the same as my first plus some extra fields. This is because i need that "someone" can view and edit data entered on start workflow form. So i basically copied first form configuration to second form but this doesn't work, only sets and textareas are rendered. Anybody now how can i customize this?

workflow definition

<process id="appppV1" name="Proces otvaranja projekta">
   
    <startEvent id="start" name="Start" activiti:formKey="mcwm:submitStart"></startEvent>
   
    <userTask id="preparationOfProjectCharter" name="Priprema projektne povelje" activiti:assignee="${bpm_assignee.properties.userName}" activiti:formKey="mcwm:preparationOfProjectCharter">
      <extensionElements>
        <activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
          <activiti:field name="script">
            <activiti:string>if (typeof bpm_workflowDueDate != 'undefined') task.setVariableLocal('bpm_dueDate', bpm_workflowDueDate);</activiti:string>
          </activiti:field>
        </activiti:taskListener>
      </extensionElements>
    </userTask>


model for workflow:

<imports>
      <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d" />
      <import uri="http://www.alfresco.org/model/bpm/1.0" prefix="bpm" />
   </imports>

   <!– Introduction of new namespaces defined by this model –>
   <namespaces>
      <namespace uri="http://www.custom.ch/model/workflow/1.0" prefix="mcwm" />
   </namespaces>

   <types>
      <type name="mcwm:submitStart">
         <parent>bpm:startTask</parent>
         <properties>
            <property name="mcwm:projectName">
               <title>Naziv projekta</title>
               <type>d:text</type>
               <mandatory>true</mandatory>
            </property>
            <property name="mcwm:shortProjectName">
               <title>Skraćeni naziv projekta</title>
               <type>d:text</type>
               <mandatory>false</mandatory>
            </property>
            <property name="mcwm:projectOrderer">
               <title>Naručitelj projekta</title>
               <type>d:text</type>
               <mandatory>false</mandatory>
            </property>
            <property name="mcwm:shortProjectOrderer">
               <title>Skraćeni naziv naručitelja projekta</title>
               <type>d:text</type>
               <mandatory>false</mandatory>
            </property>
            <property name="mcwm:isoProcess">
               <title>ISO 9000 proces</title>
               <type>d:text</type>
               <mandatory>true</mandatory>
               <default> </default>
               <constraints>
                  <constraint name="mcwm:isoProcessChoices" type="LIST">
                     <parameter name="allowedValues">
                        <list>
                           <value> </value>
                           <value>održavanje - aplikativno</value>
                           <value>održavanje - sistemsko</value>
                           <value>konsalting</value>
                           <value>razvoj - sa odobrenjem arhitekture</value>
                           <value>razvoj - bez odobrenjem arhitekture</value>
                           <value>mali razvoj</value>
                           <value>implementacija</value>
                        </list>
                     </parameter>
                  </constraint>
               </constraints>
            </property>
            <property name="mcwm:reporting">
               <title>Učestalost izveštavanja</title>
               <type>d:text</type>
               <mandatory>true</mandatory>
               <default>mesečno</default>
               <constraints>
                  <constraint name="mcwm:reportingChoices" type="LIST">
                     <parameter name="allowedValues">
                        <list>
                           <value>mesečno</value>
                           <value>kvartalno</value>
                           <value>po okončanju</value>
                        </list>
                     </parameter>
                  </constraint>
               </constraints>
            </property>
            <property name="mcwm:projectGoals">
               <title>Ciljevi projekta</title>
               <type>d:text</type>
               <mandatory>false</mandatory>
            </property>
            
            <property name="mcwm:beginDate">
               <title>Datum početka projekta</title>
               <type>d:date</type>
               <mandatory>true</mandatory>
            </property>
            
            <property name="mcwm:endDate">
               <title>Datum okončanja projekta</title>
               <type>d:date</type>
               <mandatory>false</mandatory>
            </property>
            
            <property name="mcwm:team">
               <title>Projektni tim (*promena tipa kontorle)</title>
               <type>d:text</type>
               <mandatory>false</mandatory>
            </property>
            
            <property name="mcwm:teamResource">
               <title>Predviđeni utrošak ljudskih resursa (*promena tipa kontorle)</title>
               <type>d:text</type>
               <mandatory>false</mandatory>
            </property>
            
            <property name="mcwm:teamComent">
               <title>Komentar na predviđeni utrošak ljudskih resursa</title>
               <type>d:text</type>
               <mandatory>false</mandatory>
            </property>
            
            <property name="mcwm:changeComent">
               <title>Komentar izmene</title>
               <type>d:text</type>
               <mandatory>false</mandatory>
            </property>
         </properties>   
         <!–  To select a user –>
         <mandatory-aspects>
            <aspect>bpm:assignee</aspect>
         </mandatory-aspects>
      </type>

      <type name="mcwm:preparationOfProjectCharter">
         <parent>bpm:workflowTask</parent>
         <properties>
            <property name="mcwm:editTask">
               <title>Edit task</title>
               <type>d:text</type>
               <mandatory>true</mandatory>
            </property>
         </properties>
      </type>
   </types>


share-config-custom.xml

<!– **************************************** –>
   <!– Start Form appppV1 Workflow Configuration–>
   <!–       Project Initiation              –>
   <!– **************************************** –>
   <config evaluator="string-compare" condition="activiti$appppV1">
      <forms>
         <form>
            <field-visibility>
               <hide id="bpm:workflowDescription" />
               <hide id="bpm:workflowDueDate" />
               <hide id="bpm:workflowPriority" />
               <show id="bpm:assignee" />
           
               <show id="mcwm:projectName" />
            <show id="mcwm:shortProjectName" />
            <show id="mcwm:projectOrderer" />
            <show id="mcwm:shortProjectOrderer" />
            <show id="mcwm:isoProcess" />
            <show id="mcwm:reporting"/>
            <show id="mcwm:projectGoals"/>
            <show id="mcwm:beginDate"/>
            <show id="mcwm:endDate"/>
           
            <show id="mcwm:team"/>
            <show id="mcwm:teamResource"/>
            <show id="mcwm:teamComent"/>
            <show id="mcwm:changeComent"/>
           
           
               <hide id="packageItems" />
               <hide id="bpm:sendEMailNotifications" />
            </field-visibility>
            <appearance>
            <set id="" appearance="title" label-id="apppv1.set.projekat" />
            <set id="general" appearance="fieldset" label-id="appppV1.set.general" />
            <set id="date" template="/org/alfresco/components/form/2-column-set.ftl" appearance="fieldset" label-id="appppV1.set.date" />
            <set id="team" appearance="fieldset" label-id="appppV1.set.team" />
            <set id="change" appearance="fieldset" label-id="appppV1.set.change" />
              
           
            <field id="mcwm:projectName" set="general" />
               <field id="mcwm:shortProjectName" set="general" />
            <field id="mcwm:projectOrderer" set="general" />
            <field id="mcwm:shortProjectOrderer" set="general" />
            <field id="mcwm:isoProcess" set="general" />
            <field id="mcwm:reporting" set="general" />
          
            <field id="mcwm:projectGoals" set="general">
               <control template="/org/alfresco/components/form/controls/textarea.ftl">
                  <control-param name="style">width: 65%</control-param>
                  <control-param name="rows">5</control-param>
               </control>
            </field>
            
            <field id="mcwm:beginDate" set="date"/>
            <field id="mcwm:endDate" set="date"/>
            <field id="bpm:assignee" set="team" label="Voditelj projekta"/>
            <field id="mcwm:team" set="team">
               <control template="/org/alfresco/components/form/controls/textarea.ftl">
                  <control-param name="style">width: 65%</control-param>
                  <control-param name="rows">5</control-param>
               </control>
            </field>
            <field id="mcwm:teamResource" set="team"/>
            <field id="mcwm:teamComent" set="team">
               <control template="/org/alfresco/components/form/controls/textarea.ftl">
                  <control-param name="style">width: 65%</control-param>
                  <control-param name="rows">5</control-param>
               </control>
            </field>
            
            <field id="mcwm:changeComent" set="change">
               <control template="/org/alfresco/components/form/controls/textarea.ftl">
                  <control-param name="style">width: 65%</control-param>
                  <control-param name="rows">5</control-param>
               </control>
            </field>
            </appearance>
         </form>
      </forms>
   </config>
  
   <!– ****************************************************** –>
   <!–             Task Form Configuration             –>
   <!– Preparation Of Project Charter Task Form Configuration –>
   <!– This is the problem!!! –>
   <!– ****************************************************** –>
  
   <config evaluator="task-type" condition="mcwm:preparationOfProjectCharter">
      <forms>
         <form>
            <field-visibility>
               <show id="mcwm:projectName"/>
               <show id="mcwm:editTask"/>
               <hide id="bpm:workflowDescription" />
               <hide id="bpm:workflowDueDate" />
               <hide id="bpm:workflowPriority" />
               <show id="bpm:assignee" />
                 
               <show id="mcwm:projectName" />
               <show id="mcwm:shortProjectName" />
               <show id="mcwm:projectOrderer" />
               <show id="mcwm:shortProjectOrderer" />
               <show id="mcwm:isoProcess" />
               <show id="mcwm:reporting"/>
               <show id="mcwm:projectGoals"/>
               <show id="mcwm:beginDate"/>
               <show id="mcwm:endDate"/>
                 
               <show id="mcwm:team"/>
               <show id="mcwm:teamResource"/>
               <show id="mcwm:teamComent"/>
               <show id="mcwm:changeComent"/>
             </field-visibility>
            <appearance>
               <set id="" appearance="title" label-id="apppv1.set.projekat" />
               <set id="general" appearance="fieldset" label-id="appppV1.set.general" />
               <set id="date" template="/org/alfresco/components/form/2-column-set.ftl" appearance="fieldset" label-id="appppV1.set.date" />
               <set id="team" appearance="fieldset" label-id="appppV1.set.team" />
               <set id="change" appearance="fieldset" label-id="appppV1.set.change" />
              
           
               <field id="mcwm:projectName" set="general" />
               <field id="mcwm:shortProjectName" set="general" />
               <field id="mcwm:projectOrderer" set="general" />
               <field id="mcwm:shortProjectOrderer" set="general" />
               <field id="mcwm:isoProcess" set="general" />
               <field id="mcwm:reporting" set="general" />
          
               <field id="mcwm:projectGoals" set="general">
                  <control template="/org/alfresco/components/form/controls/textarea.ftl">
                     <control-param name="style">width: 65%</control-param>
                     <control-param name="rows">5</control-param>
                  </control>
               </field>
               
               <field id="mcwm:beginDate" set="date"/>
               <field id="mcwm:endDate" set="date"/>
               <field id="bpm:assignee" set="team" label="Voditelj projekta"/>
               <field id="mcwm:team" set="team">
                  <control template="/org/alfresco/components/form/controls/textarea.ftl">
                     <control-param name="style">width: 65%</control-param>
                     <control-param name="rows">5</control-param>
                  </control>
               </field>
               <field id="mcwm:teamResource" set="team"/>
               <field id="mcwm:teamComent" set="team">
                  <control template="/org/alfresco/components/form/controls/textarea.ftl">
                     <control-param name="style">width: 65%</control-param>
                     <control-param name="rows">5</control-param>
                  </control>
               </field>
               
               <field id="mcwm:changeComent" set="change">
                  <control template="/org/alfresco/components/form/controls/textarea.ftl">
                     <control-param name="style">width: 65%</control-param>
                     <control-param name="rows">5</control-param>
                  </control>
               </field>
               <field id="mcwm:editTask" set="general" read-only="true"/>
            </appearance>
         </form>
      </forms>

I try to use in show tag with force="true" attribute and this show my filed but data aren't transfered from my start from?!

Thanks in advance for help.

Regards,
Aleksandar

Outcomes