AnsweredAssumed Answered

implement alfresco-share-datatable-property-type in workflow

Question asked by crescenzo on Mar 15, 2012
Latest reply on Mar 20, 2012 by jpotts
Hy,

I'm implementing this project http://code.google.com/p/alfresco-share-datatable-property-type/ in my workflow

my model is
<?xml version="1.0" encoding="UTF-8"?>

<model name="newricfer:NewRichiestaFerieModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <description>Nuovo Modello di richiesta ferie</description>
   <author>Crescenzo Rega</author>
   <version>1.0</version>

   <imports>
        <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"></import>
        <import uri="http://www.alfresco.org/model/bpm/1.0" prefix="bpm"></import>
        <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm" />
        <import uri="http://www.alfresco.org/model/workflow/1.0" prefix="wf"></import>
   </imports>
   
   <namespaces>
      <namespace uri="newricfer.model" prefix="newricfer" />
   </namespaces>
   
   <constraints>
      <constraint name="newricfer:tipoNumero" type="LIST">
         <parameter name="allowedValues">
            <list>
               <value>giorni</value>
               <value>ore</value>
            </list>
         </parameter>         
      </constraint>      
      <constraint name="newricfer:tipoRichiesta" type="LIST">
         <parameter name="allowedValues">
            <list>
               <value>Ferie</value>
               <value>Aziendale</value>
               <value>Permessi</value>
               <value>Malattie</value>
               <value>Recuperi</value>
               <value>Maternita Obbligatoria</value>
               <value>Maternita Facoltativa</value>
               <value>Permesso Donazione Sangue</value>
               <value>Festa Patronale</value>
               <value>Festa Patronale Sede Cliente</value>
               <value>Festivita</value>
               <value>Assenze Parentali</value>
               <value>Permessi Elettorali</value>
               <value>Lutto Parenti e Affini</value>
               <value>Legge 104 sui disabili</value>
               <value>Diritto allo Studio</value>
               <value>Congedo Matrimoniale</value>
               <value>Altro/non in elenco</value>
               <value>Permesso per Allattamento</value>
            </list>
         </parameter>
      </constraint>      
   </constraints>
   
   <types>
      <!– Submit review to multiple people (as included in a group) –>
      <type name="newricfer:submitNewRichiestaFerie">
         <parent>bpm:startTask</parent>

      </properties>
         <mandatory-aspects>
            <aspect>newricfer:intervallodata</aspect>            
            <aspect>bpm:assignee</aspect>
         </mandatory-aspects>         
      </type>
      
      <type name="newricfer:verificaNewRichiestaFerie">
         <parent>bpm:activitiOutcomeTask</parent>
         <properties>
            <property name="newricfer:reviewOutcome">
               <type>d:text</type>
               <default>Reject</default>
               <constraints>
                  <constraint name="newricfer:reviewOutcomeOptions" type="LIST">
                     <parameter name="allowedValues">
                        <list>
                           <value>Approve</value>
                           <value>Reject</value>
                        </list>
                     </parameter>
                  </constraint>
               </constraints>
            </property>
         </properties>
         <overrides>
            <property name="bpm:outcomePropertyName">
               <default>{http://www.alfresco.org/model/workflow/1.0}reviewOutcome
               </default>
            </property>
         </overrides>
         <mandatory-aspects>
            <aspect>newricfer:intervallodata</aspect>
         </mandatory-aspects>
      </type>
      <type name="newricfer:approvataNewRichiestaFerie">
         <parent>bpm:workflowTask</parent>
         <mandatory-aspects>
            <aspect>bpm:assignee</aspect>
            <aspect>newricfer:intervallodata</aspect>
         </mandatory-aspects>
      </type>
      <type name="newricfer:respintaNewRichiestaFerie">
         <parent>bpm:workflowTask</parent>
         <mandatory-aspects>
            <aspect>bpm:assignee</aspect>
            <aspect>newricfer:intervallodata</aspect>
         </mandatory-aspects>
      </type>
   </types>

   <aspects>
      <aspect name="newricfer:intervallodata">      
         <properties>
            <property name="newricfer:dal">
               <type>d:date</type>
               <mandatory>true</mandatory>
            </property>
            <property name="newricfer:al">
               <type>d:date</type>
               <mandatory>true</mandatory>
            </property>
            <property name="newricfer:numero">
               <type>d:int</type>
               <mandatory>true</mandatory>
            </property>
            <property name="newricfer:giorniore">
               <type>d:text</type>
               <mandatory>true</mandatory>
               <constraints>
                  <constraint ref="newricfer:tipoNumero" />
               </constraints>
            </property>
            <property name="newricfer:tipoAssenza">
               <type>d:text</type>
               <mandatory>true</mandatory>
               <constraints>
                  <constraint ref="newricfer:tipoRichiesta" />
               </constraints>               
            </property>
            <property name="newricfer:ListOfItems">
               <title>Items</title>
               <type>d:text</type>
         </property>
         </properties>
      </aspect>         
      </aspect>
   </aspects>
</model>

my share-workflow-form-config.xml
   <config evaluator="string-compare" condition="activiti$NewRichiestaFerie">
      <forms>
         <form>
            <field-visibility>
               <show id="bpm:workflowDescription" />
               <show id="newricfer:dal" />
               <show id="newricfer:al" />
               <show id="newricfer:numero" />
               <show id="newricfer:giorniore" />
               <show id="newricfer:tipoAssenza" />
               <show id="riepilogo" />
               <show id="newricfer:ListOfItems" />
               <show id="bpm:assignee" />
               <show id="packageItems" />
               <show id="bpm:sendEMailNotifications" />
            </field-visibility>
            <appearance>
               <set id="" appearance="title" label-id="New Richiesta assenza" />
               <set id="info" appearance="" template="/org/alfresco/components/form/2-column-set.ftl" />
               <set id="assignee" appearance="title" label-id="workflow.set.assignee" />
               <set id="items" appearance="title" label-id="workflow.set.items" />
               <set id="other" appearance="title" label-id="workflow.set.other" />

               <field id="bpm:workflowDescription" label-id="workflow.field.message">
                  <control template="/org/alfresco/components/form/controls/textarea.ftl">
                     <control-param name="style">width: 95%</control-param>
                  </control>
               </field>
               <field id="newricfer:dal" set="info" label-id="Data inizio" />

               <field id="newricfer:al" set="info" label-id="Data fine" />

               <field id="newricfer:numero" set="info" label-id="Numero">
                  <control template="/org/alfresco/components/form/controls/textfield.ftl">
                     <control-param name="style">width: 130px</control-param>
                  </control>
               </field>

               <field id="newricfer:giorniore" set="info" label-id="Di" />

               <field id="newricfer:tipoAssenza" set="info" label-id="Tipo richiesta assenza" />

               <field id="riepilogo" set="info">
                  <control template="/org/alfresco/components/form/controls/cregaFreeMarkerTemplate/addText.ftl" />
               </field>

               <field id="newricfer:ListOfItems" >
                  <control template="/org/alfresco/form/controls/cregaFreeMarkerTemplate/datatable-property.ftl">
                     <control-param name="config">
                        id, ID, number;
                        name, Item, text;
                        quantity, Quantity, number;
                        price, Price, currency;
                        paid, Was paid, radio, ["Yes", "No"];
                        features, Features, checkbox, ["JPEG", "MPEG", "MOV"];
                        color, Color, dropdown, ["Black", "White", "Blue"];
                        date, Date, date;
                     </control-param>
                  </control>
               </field>

               <field id="bpm:assignee" label-id="workflow.field.assign_to" set="assignee" />
               <field id="packageItems" set="items" />
               <field id="bpm:sendEMailNotifications" set="other">
                  <control template="/org/alfresco/components/form/controls/workflow/email-notification.ftl" />
               </field>
            </appearance>
         </form>
      </forms>
   </config>

this implementation is that possible? it off?

Outcomes