WorkflowTraining

cancel
Showing results for 
Search instead for 
Did you mean: 

WorkflowTraining

resplin
Intermediate
0 0 1,267

Obsolete Pages{{Obsolete}}

The official documentation is at: http://docs.alfresco.com



Workflow

Please Note: This capability is available from v1.4 onwards!

Back to Workflow.



This document provides training on writing your own custom workflows.


jPDL


Follows are very simple jPDL examples which may be deployed to the Alfresco Repository and stepped through via the Workflow Console.

To deploy any of the following:


  1. Copy the jPDL sample to a file in your Application Server classpath e.g. alfresco/WEB-INF/classes/alfresco/workflow/simplest.xml
  2. Launch the Workflow Console
  3. Deploy the jPDL sample via the deploy command e.g. deploy alfresco/workflow/simplest.xml

Simplest


<process-definition name='simplest'>
  <start-state name='start'>
     <transition name='' to='end' />
  </start-state>
  <end-state name='end' />
</process-definition>

Steps


<process-definition name='steps'>
   <start-state name='start'>
      <transition name='toStep1' to='step1' />
      <transition name='toStep2' to='step2' />
   </start-state>
   <state name='step1'>
      <transition name='' to='end' />
   </state>
   <state name='step2'>
      <transition name='' to='end' />
   </state>
   <end-state name='end' />
</process-definition>

Fork


<process-definition name='fork'>
  <start-state name='start'>
     <transition name='' to='split' />
  </start-state>
  <fork name='split'>
     <transition name='toStep1' to='step1' />
     <transition name='toStep2' to='step2' />
  </fork>
  <state name='step1'>
     <transition name='' to='end' />
  </state>
  <state name='step2'>
     <transition name='' to='end' />
  </state>
  <end-state name='end' />
</process-definition>

Join


<process-definition name='join'>
  <start-state name='start'>
     <transition name='' to='split' />
  </start-state>
  <fork name='split'>
     <transition name='toStep1' to='step1' />
     <transition name='toStep2' to='step2' />
  </fork>
  <state name='step1'>
     <transition name='' to='toJoin' />
  </state>
  <state name='step2'>
     <transition name='' to='toJoin' />
  </state>
  <join name='toJoin'>
     <transition to='end' />
  </join>
  <end-state name='end' />
</process-definition>

Tasks


<process-definition name='task'>
  <swimlane name='initiator' />
  <swimlane name='reviewer'>
     <assignment actor-id='davidc' />
  </swimlane>
  <start-state name='start'>
     <transition name='' to='review' />
  </start-state>
  <task-node name='review'>
     <task name='reviewTask' swimlane='reviewer' />
     <transition name='' to='end' />
  </task-node>
  <end-state name='end' />
</process-definition>

Events


<process-definition name='events'>
  <event type='process-start'>
     <script>System.out.println('Workflow Started');</script>
  </event>
  <start-state name='start'>
     <transition name='' to='end' >
        <script>System.out.println('Signal');</script>
     </transition>
     <event type='node-leave'>
        <script>System.out.println('Leaving Start');</script>
     </event>
  </start-state>
  <end-state name='end' />
  <event type='process-end'>
     <script>System.out.println('Workflow Ended');</script>
  </event>
</process-definition>

Data


<process-definition name='dataflow'>
  <start-state name='start'>
     <transition name='' to='review'>
        <script>
           <expression>
              process_var = 'process';
           </expression>
           <variable name='process_var' access='write'/>
        </script>
     </transition>
  </start-state>
  <task-node name='review'>
     <task name='reviewTask'>
        <event type='task-create'>
           <script>
              <expression>
                 task_var = process_var;
              </expression>
              <variable name='task_var' access='write'/>
           </script>
        </event>
     </task>
     <transition name='' to='end'/>
  </task-node>
  <end-state name='end' />
  <event type='process-end'>
     <script>System.out.println(process_var + ',' + task_var);</script>
  </event>
</process-definition>