AnsweredAssumed Answered

CUSTOM 'advanced' workflow

Question asked by dteca on May 27, 2008
Latest reply on Jun 2, 2008 by poptarts
Hi,
i want to make a advanced workflow. My SO is Windows XP Pro SP2, alfresco version: alfresco-community-war-2.1.0.zip, apache-tomcat-5.5.23.exe!

I edit the follow files:
1) tirocino_processdefinition.xml;
2) tirocinioModel.xml;
3) web-client-tirocinio-config-properties.xml;
4) tirocinio.properties;
5) tirocinio-context.xml

I placed the files in the folder:
C:\Programmi\Apache Software Foundation\Tomcat 5.5\webapps\alfresco\WEB-INF\classes\alfresco\extension\tirocinio

1) tirocinio_processdefinition.xml
?xml version="1.0" encoding="UTF-8"?>

<process-definition xmlns="urn:jbpm.org:jpdl-3.1" name="tir:tirocinio">

   <swimlane name="initiator"/>

   <start-state name="start">
      <task name="tir:richiestaTirocinio" swimlane="initiator"/>
      <transition name="" to="analisiTirocinio"/>
   </start-state>

   <swimlane name="assegnee">
      <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
         <actor>#{bpm_assignee}</actor>
      </assignment>
   </swimlane>
  
   <task-node name="analisiTirocinio">
      <task name="tir:analisiTirocinio" swimlane="assignee">
         <event type="task-create">
            <script>
               if (bpm_workflowDueDate != void) taskInstance.dueDate = bpm_workflowDueDate;
               if (bpm_workflowPriority != void) taskInstance.priority = bpm_workflowPriority;
            </script>
         </event>
      </task>
      <transition name="" to="completato">
         <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
           <script>
              if (wf_notifyMe)
              {
                 var mail = actions.create("mail");
                 mail.parameters.to = initiator.properties.email;
                 mail.parameters.subject = "Adhoc Task " + bpm_workflowDescription;
                 mail.parameters.from = bpm_assignee.properties.email;
                 mail.parameters.text = "It's done";
                 mail.execute(bpm_package);
              }
           </script>
         </action>
      </transition>
   </task-node>
  
   <task-node name="completato">
      <task name="tir:analisiTirocinioCompletata" swimlane="initiator"/>
      <transition name="" to="end"/>
   </task-node>
     
   <end-state name="end"/>
  
</process-definition>

2) tirocinioModel.xml
<?xml version="1.0" encoding="UTF-8"?>

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

  <imports>
    <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
    <import uri="http://www.alfresco.org/model/system/1.0" prefix="sys" />
    <!– Import Alfresco Content Domain Model Definitions –>
    <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm" />
    <!– Import User Model Definitions –>
    <import uri="http://www.alfresco.org/model/user/1.0" prefix="usr"/>
  </imports>

  <namespaces>
    <namespace uri="http://www.alfresco.org/model/workflow/1.0" prefix="tir"/>
  </namespaces>

 
  
        <constraints>
   
           <constraint name="tir:allowedPriority" type="LIST">
               <parameter name="allowedValues">
                   <!–  TODO: Determine if priority values can be mapped to human-readable strings –>
                   <list>
                       <value>1</value>
                       <value>2</value>
                       <value>3</value>
                       <value>4</value>
                   </list>
               </parameter>
           </constraint>
   
           <constraint name="tir:allowedStatus" type="LIST">
               <parameter name="allowedValues">
                   <!–  TODO: Determine if status values can be mapped to human-readable strings –>
                   <list>
                       <value>non è partito</value>
                       <value>ci sto lavorando</value>
                       <value>in attesa</value>
                       <value>Cancellato</value>
                       <value>Completato</value>
                   </list>
               </parameter>
           </constraint>
   
           <constraint name="tir:percentage" type="MINMAX">
               <parameter name="minValue">
                   <value>0</value>
               </parameter>
               <parameter name="maxValue">
                   <value>100</value>
               </parameter>
           </constraint>
   
     </constraints>
   
     <types>
   
           <!–                                 –>
           <!–  Base definition for all Tasks  –>
           <!–                                 –>
   
           <type name="tir:task">
               <parent>cm:content</parent>
   
               <properties>
   
                   <!–             –>
                   <!–  Assignment –>
                   <!–             –>
                   <!–  Note: Implemented via cm:ownable aspect –>
   
                   <!–                  –>
                   <!–  Task Identifier –>
                   <!–                  –>
                   <property name="tir:taskId">
                       <type>d:long</type>
                       <protected>true</protected>
                       <mandatory>true</mandatory>
                   </property>
   
                   <!–  Task Description –>
                   <property name="tir:description">
                       <type>d:text</type>
                   </property>
   
                   <!–             –>
                   <!–  Task Dates –>
                   <!–             –>
                   <property name="tir:startDate">
                       <type>d:date</type>
                       <protected>true</protected>
                   </property>
                   <property name="tir:completionDate">
                       <type>d:date</type>
                       <protected>true</protected>
                   </property>
                   <property name="tir:dueDate">
                       <type>d:date</type>
                   </property>
   
                   <!–                –>
                   <!–  Task Progress –>
                   <!–                –>
                   <property name="tir:status">
                       <type>d:text</type>
                       <mandatory>true</mandatory>
                       <default>non è partito</default>
                       <constraints>
                           <constraint ref="tir:allowedStatus" />
                       </constraints>
                   </property>
                   <property name="tir:priority">
                       <type>d:int</type>
                       <mandatory>true</mandatory>
                       <default>3</default>
                       <constraints>
                           <constraint ref="tir:allowedPriority" />
                       </constraints>
                   </property>
                   <property name="tir:percentComplete">
                       <type>d:int</type>
                       <mandatory>true</mandatory>
                       <default>0</default>
                       <constraints>
                           <constraint ref="tir:percentage" />
                       </constraints>
                   </property>
   
                   <!–             –>
                   <!–  Task Notes –>
                   <!–             –>
                   <property name="tir:comment">
                       <type>d:text</type>
                   </property>
   
               </properties>
   
               <associations>
   
                   <!–  List of users who may potentially get assigned to the task –>
                   <association name="tir:pooledActors">
                       <source>
                           <mandatory>false</mandatory>
                           <many>false</many>
                       </source>
                       <target>
                           <!– For now, this may consists of cm:person or usr:authorityContainer –>
                           <class>sys:base</class>
                           <mandatory>false</mandatory>
                           <many>true</many>
                       </target>
                   </association>
   
               </associations>
   
               <mandatory-aspects>
                   <aspect>cm:ownable</aspect>
               </mandatory-aspects>
           </type>
   
   
           <!–                                                 –>
           <!–  The base for all Tasks assigned via a Workflow –>
           <!–                                                 –>
   
           <type name="tir:workflowTask">
               <parent>tir:task</parent>
   
               <properties>
   
                   <!–  Task Context          –>
                   <!–  e.g. Space, Document  –>
                   <property name="tir:context">
                       <type>d:noderef</type>
                   </property>
   
                   <!–  Task Outcome –>
                   <property name="tir:outcome">
                       <!– NOTE: Transition id –>
                       <type>d:text</type> 
                   </property>
   
                   <!–  Items within package marked as complete –>
                   <property name="tir:completedItems">
                       <type>d:noderef</type>
                       <multiple>true</multiple>
                   </property>
   
                   <!–  Applicable actions for workflow package –>
                   <property name="tir:packageActionGroup">
                       <type>d:text</type>
                       <!– NOTE: empty default specified, therefore no actions –>
                       <default></default>
                   </property>
   
                   <!–  Applicable actions for workflow package item –>
                   <property name="tir:packageItemActionGroup">
                       <type>d:text</type>
                       <default>read_package_item_actions</default>
                   </property>
   
               </properties>
   
               <associations>
   
                   <association name="tir:package">
                       <source>
                           <mandatory>false</mandatory>
                           <many>false</many>
                       </source>
                       <target>
                           <class>tir:workflowPackage</class>
                           <mandatory>true</mandatory>
                           <many>false</many>
                       </target>
                   </association>
   
               </associations>
   
           </type>
   
   
           <!–                     –>
           <!–  Default Start Task –>
           <!–                     –>
   
           <type name="tir:startTask">
               <parent>tir:workflowTask</parent>
   
               <properties>
   
                   <!–  Description for the workflow as a whole –>
                   <property name="tir:workflowDescription">
                       <type>d:text</type>
                   </property>
   
                   <!–  Due date for the workflow as a whole –>
                   <property name="tir:workflowDueDate">
                       <type>d:date</type>
                   </property>
   
                   <!–  Priority for the workflow as a whole –>
                   <property name="tir:workflowPriority">
                       <type>d:int</type>
                       <default>2</default>
                       <constraints>
                           <constraint ref="tir:allowedPriority" />
                       </constraints>
                   </property>
   
               </properties>
   
               <overrides>
   
                   <property name="tir:packageActionGroup">
                       <default>add_package_item_actions</default>
                   </property>
   
                   <property name="tir:packageItemActionGroup">
                       <default>start_package_item_actions</default>
                   </property>
   
               </overrides>
   
           </type>
   
   
          <!–  tirocinioModel–>              
          <!–                –>
         
          <type name="tir:analisiTirocinio">
             <parent>bpm:startTask</parent>
             <properties>
                <property name="tir:notifyMe">
                   <type>d:boolean</type>
                   <default>false</default>
                </property>
             </properties>
             <mandatory-aspects>
                <aspect>tir:assignee</aspect>
             </mandatory-aspects>
          </type>
   
          <type name="tir:analisiTirocinio">
             <parent>bpm:workflowTask</parent>
             <overrides>
                <property name="tir:packageActionGroup">
                   <default>add_package_item_actions</default>
                </property>
                <property name="tir:packageItemActionGroup">
                   <default>edit_package_item_actions</default>
                </property>
             </overrides>
          </type>
   
          <type name="tir:analisiTirocinioCompletata">
             <parent>tir:workflowTask</parent>
             <mandatory-aspects>
                <aspect>tir:assignee</aspect>
             </mandatory-aspects>
          </type>
  
   
   
   </types>
   
       <aspects>
      
           <!–                       –>
           <!–  Single Task Assignee –>
           <!–                       –>
          
           <aspect name="tir:assignee">
               <associations>
   
                   <association name="tir:assignee">
                       <source>
                           <mandatory>false</mandatory>
                           <many>false</many>
                       </source>
                       <target>
                           <class>cm:person</class>
                           <mandatory>true</mandatory>
                           <many>false</many>
                       </target>
                   </association>
   
               </associations>
           </aspect>
      
           <!–                          –>
           <!–  Multiple Task Assignees –>
           <!–                          –>
   
           <aspect name="tir:assignees">
               <associations>
   
                   <association name="tir:assignees">
                       <source>
                           <mandatory>false</mandatory>
                           <many>false</many>
                       </source>
                       <target>
                           <class>cm:person</class>
                           <mandatory>true</mandatory>
                           <many>true</many>
                       </target>
                   </association>
   
               </associations>
           </aspect>
   
           <!–                          –>
           <!–  Single Group Assignee   –>
           <!–                          –>
   
           <aspect name="tir:groupAssignee">
               <associations>
   
                   <association name="tir:groupAssignee">
                       <source>
                           <mandatory>false</mandatory>
                           <many>false</many>
                       </source>
                       <target>
                           <!– TODO: Refactor when group is pulled into content model –>
                           <class>usr:authorityContainer</class>
                           <mandatory>true</mandatory>
                           <many>false</many>
                       </target>
                   </association>
   
               </associations>
           </aspect>
   
           <!–                             –>
           <!–  Multiple Group Assignees   –>
           <!–                             –>
   
           <aspect name="tir:groupAssignees">
               <associations>
   
                   <association name="tir:groupAssignees">
                       <source>
                           <mandatory>false</mandatory>
                           <many>false</many>
                       </source>
                       <target>
                           <!– TODO: Refactor when group is pulled into content model –>
                           <class>usr:authorityContainer</class>
                           <mandatory>true</mandatory>
                           <many>true</many>
                       </target>
                   </association>
   
               </associations>
           </aspect>
   
           <!–                                                             –>
           <!–  A collection of content routed through a workflow.         –>
           <!–                                                             –>
           <!–  Note: this aspect should be applied to a container such as –>
           <!–        a folder, versioned folder or layered folder.        –>
           <!–                                                             –>
   
           <aspect name="tir:workflowPackage">
               <properties>
   
                   <!–  Created by Workflow Service (true), or provided from outside (false) –>               
                   <property name="bpm:isSystemPackage">
                       <type>d:boolean</type>
                   </property>
   
                   <!–                        –>
                   <!–  Associated Workflow   –>
                   <!–                        –>
                   <property name="tir:workflowDefinitionId">
                       <type>d:text</type>
                   </property>
                   <property name="bpm:workflowDefinitionName">
                       <type>d:text</type>
                   </property>
                   <property name="tir:workflowInstanceId">
                       <type>d:text</type>
                   </property>
   
                   <!–  TODO: Define properties (replicated from Workflow/Task Engine) for –>
                   <!–        search within Alfresco e.g. task info, workflow info …     –>
   
               </properties>
   
           </aspect>
   
          </aspects>

</model>


3) web-client-tirocinio-config-properties.xml;
<alfresco-config>


<!– tirocinio workflow tasks –>

   <config evaluator="node-type" condition="tir:richiestaTirocinio" replace="true">
      <property-sheet>
         <separator name="sep1" display-label-id="generale" component-generator="HeaderSeparatorGenerator" />
         <show-property name="tir:workflowDescription" component-generator="TextAreaGenerator" />
         <show-property name="tir:workflowPriority" display-label-id="wf_adhoc_priority" />
         <show-property name="tir:workflowDueDate" display-label-id="wf_adhoc_due_date" />
         <show-property name="tir:notifyMe" />
         <separator name="sep2" display-label-id="user_filter_user" component-generator="HeaderSeparatorGenerator" />
         <show-association name="tir:assignee" display-label-id="wf_adhoc_assign_to" />
      </property-sheet>
   </config>

   <config evaluator="node-type" condition="tir:analisiTirocinio" replace="true">
      <property-sheet>
         <separator name="sep1" display-label-id="general" component-generator="HeaderSeparatorGenerator" />
         <show-property name="tir:taskId" />
         <show-property name="tir:description" component-generator="TextAreaGenerator" read-only="true" />
         <show-property name="tir:dueDate" read-only="true" />
         <show-property name="tir:priority" read-only="true" />
         <show-property name="tir:status" />
         <show-property name="tir:comment" component-generator="TextAreaGenerator" />
      </property-sheet>
   </config>

   <config evaluator="node-type" condition="tir:analisiTirocinioCompletata" replace="true">
      <property-sheet>
         <separator name="sep1" display-label-id="general" component-generator="HeaderSeparatorGenerator" />
         <show-property name="tir:taskId" />
         <show-property name="tir:description" component-generator="TextAreaGenerator" read-only="true" />
         <show-property name="tir:dueDate" read-only="true" />
         <show-property name="tir:priority" read-only="true" />
         <separator name="sep2" display-label-id="users_and_roles" component-generator="HeaderSeparatorGenerator" />
         <show-association name="tir:assignee" display-label-id="wf_adhoc_assignee" read-only="true" />
      </property-sheet>
   </config>
  
</alfresco-config>

4) tirocinio.properties;
# Display labels for base Business Process Model

tir_tirocinioModel.title=Business Process Model
tir_tirocinioModel.description=Base definitions of all Business Processes

# Default transition
tir_tirocinioModel.transition.title=Task Done
tir_tirocinioModel.transition.description=Task Done

# Base Task
tir_tirocinioModel.type.tir_task.title=Task
tir_tirocinioModel.type.tir_task.description=Task
tir_tirocinioModel.property.tir_taskId.title=Identifier
tir_tirocinioModel.property.tir_taskId.description=Identifier
tir_tirocinioModel.property.tir_startDate.title=Start Date
tir_tirocinioModel.property.tir_startDate.description=Start Date
tir_tirocinioModel.property.tir_completionDate.title=Completion Date
tir_tirocinioModel.property.tir_completionDate.description=Completion Date
tir_tirocinioModel.property.tir_dueDate.title=Scadenza
tir_tirocinioModel.property.tir_dueDate.description=Scadenza
tir_tirocinioModel.property.tir_status.title=Status
tir_tirocinioModel.property.tir_status.description=Status
tir_tirocinioModel.property.tir_priority.title=Priorità tir
tir_tirocinioModel.property.tir_priority.description=Priorità tir
tir_tirocinioModel.property.tir_percentComplete.title=Percent Complete
tir_tirocinioModel.property.tir_percentComplete.description=Percent Complete
tir_tirocinioModel.property.tir_comment.title=Comment
tir_tirocinioModel.property.tir_comment.description=Comment
tir_tirocinioModel.association.tir_pooledActors.title=Pooled Users
tir_tirocinioModel.association.tir_pooledActors.description=Pool

# Workflow Task
tir_tirocinioModel.type.tir_workflowTask.title=Workflow Task
tir_tirocinioModel.type.tir_workflowTask.description=Task assigned by a Workflow
tir_tirocinioModel.property.tir_workflowDefinitionId.title=Workflow Definition Id
tir_tirocinioModel.property.tir_workflowDefinitionId.description=Workflow Definition Id
tir_tirocinioModel.property.tir_workflowInstanceId.title=Workflow Instance Id
tir_tirocinioModel.property.tir_workflowInstanceId.description=Workflow Instance Id
tir_tirocinioModel.property.tir_context.title=Task Context
tir_tirocinioModel.property.tir_context.description=The context within which this task has been assigned
tir_tirocinioModel.property.tir_description.title=Description
tir_tirocinioModel.property.tir_description.description=Description of what needs to be achieved
tir_tirocinioModel.property.tir_outcome.title=Outcome
tir_tirocinioModel.property.tir_outcome.description=Decision made on completing Task
tir_tirocinioModel.property.tir_completedItems.title=Completed Items
tir_tirocinioModel.property.tir_completedItems.description=Package items marked as complete
tir_tirocinioModel.property.tir_packageActionGroup.title=Package Actions
tir_tirocinioModel.property.tir_packageActionGroup.description=Actions available on workflow package
tir_tirocinioModel.property.tir_packageItemActionGroup.title=Package Item Actions
tir_tirocinioModel.property.tir_packageItemActionGroup.description=Actions available on workflow package items
tir_tirocinioModel.association.tir_package.title=Content Package
tir_tirocinioModel.association.tir_package.description=The collection of content routed through the workflow
tir_tirocinioModel.aspect.tir_workflowPackage.title=Workflow Package
tir_tirocinioModel.aspect.tir_workflowPackage.description=The collection of content routed through the workflow

# Workflow Start Task
tir_tirocinioModel.type.tir_startTask.title=Workflow Start Task
tir_tirocinioModel.type.tir_startTask.description=Task used to collect information required for initiating Workflow
tir_tirocinioModel.property.tir_workflowDescription.title=Descrizione tirocinio
tir_tirocinioModel.property.tir_workflowDescription.description=Description
tir_tirocinioModel.property.tir_workflowDueDate.title=Workflow Due Date
tir_tirocinioModel.property.tir_workflowDueDate.description=Workflow Due Date
tir_tirocinioModel.property.tir_workflowPriority.title=Workflow Priority
tir_tirocinioModel.property.tir_workflowPriority.description=Workflow Priority
tir_tirocinioModel.association.tir_assignee.title=Workflow Assignee
tir_tirocinioModel.association.tir_assignee.description=Workflow Assignee
tir_tirocinioModel.association.tir_assignees.title=Workflow Assignees
tir_tirocinioModel.association.tir_assignees.description=Workflow Assignees
tir_tirocinioModel.association.tir_groupAssignee.title=Workflow Group Assignee
tir_tirocinioModel.association.tir_groupAssignee.description=Workflow Group Assignee
tir_tirocinioModel.association.tir_groupAssignees.title=Workflow Group Assignees
tir_tirocinioModel.association.tir_groupAssignees.description=Workflow Group Assignees

#cerco di aggiungere qualcosina io
generale=Generale Cataldo

# Workflow Definitions
wf_adhoc_due_date=Scadenza
wf_adhoc_priority=Priorità
wf_adhoc_assign_to=Assegnare a
wf_adhoc_assignee=Assegnato a

#
# Adhoc Task Workflow
#

wf_adhoc.workflow.title=Adhoc Task
wf_adhoc.workflow.description=Assign task to colleague

# Adhoc Task Definitions

wf_workflowmodel.type.wf_submitAdhocTask.title=Inizia richiesta tirocinio
wf_workflowmodel.type.wf_submitAdhocTask.description=Allocate task to colleague
wf_workflowmodel.property.wf_notifyMe.title=Notify Me
wf_workflowmodel.property.wf_notifyMe.description=Notify me when task is complete
wf_workflowmodel.type.wf_adhocTask.title=Adhoc Task
wf_workflowmodel.type.wf_adhocTask.description=Adhoc Task allocated by colleague
wf_workflowmodel.type.wf_completedAdhocTask.title=Adhoc Task Completed
wf_workflowmodel.type.wf_completedAdhocTask.description=Adhoc Task Complete

5) tirocinio-context.xml
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>

    <beans>

        <bean id="extension.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
           <property name="models">
      <list>
           <value>alfresco/extension/tirocinio/tirocinioModel.xml</value>
        </list>
        </property>
   </bean>

       
       
        <bean id="extension.workflowBootstrap" parent="workflowDeployer">

          <property name="workflowDefinitions">
             <list>
          <props>
            <prop key="engineId">jbpm</prop>
            <prop key="location">alfresco/extension/tirocinio/tirocinio_processdefinition.xml</prop>
            <prop key="mimetype">text/xml</prop>
            <prop key="redeploy">true</prop>
          </props>
             </list>
          </property>

           <property name="labels">
             <list>
              <value>alfresco/extension/tirocinio/tirocinio</value>
             </list>
          </property>

       </bean>
   
    </beans>

When i run Start Advanced Workflow Wizard my workflow is not listed.
What i'm wrog? this is the  way to make an advanced custom workflow?

thank you

m.

Outcomes