Workflow Console

From AlfrescoWiki

Jump to: navigation, search


Back to Workflow.


The Workflow Console is an administrator/developer tool for interacting with workflows. Its primary use is to test newly developed workflow definitions. However, it also supports the debugging/diagnosis of current "in-flight" workflows.

Test lifecycles are shortened as the tool allows a workflow definition to be deployed and redeployed without ever needing to the restart the Alfresco server. Once deployed, a workflow may be started and interacted with step-by-step. At each step, the state of the workflow may be interrogated or updated.


Contents

[edit] Accessing the Console

  • Alfresco Web Client via the url http://<host>:<port>/alfresco/faces/jsp/admin/workflow-console.jsp
    1. Note: You must be logged-in as admin to access this page

or

  • Command line tool via the class org.alfresco.repo.workflow.WorkflowInterpreter - supports main() function

[edit] Console Commands

   ##
   ##  Meta commands 
   ## 
   
   ok> help 
   
       List this help. 
   
   ok> r 
   
       Repeat last command. 
   
   ok> user [<userName>] 
   
       Switch to specified <userName>.  If <userName> is omitted, the currently 
       selected user is shown. 
   
   ok> quit | exit
   
       Quit this workflow console.
       
   ok> use
   
       Show current workflow context.
   
   ## 
   ##  Workflow Definition Commands 
   ## 
   
   ok> show file <definitionClassPath>
   
       Output the contents of the file located at <definitionClassPath>.
       
       <definitionClassPath> class path to workflow definition file. 
   
   ok> deploy <definitionClassPath> 
   
       Deploy workflow definition to Alfresco server. 
   
       <definitionClassPath> class path to workflow definition. 
   
   ok> redeploy
   
       Redeploy the last workflow definition.
   
   ok> show definitions [all]  ** from v2.1 onwards
   
       List latest deployed workflow definitions.  Or, display all workflows
       definitions (including previous versions) with the additional keyword
       'all'.
   
   ok> use definition [<workflowDefId>] 
   
       Switch to use the workflow definition identified by <workflowDefId>.  If 
       <workflowDefId> is ommited, the currently selected workflow definition 
       is shown. 
   
   ok> undeploy definition <workflowDefId>
   
       Undeploy the latest version of the workflow definition identified by 
       <workflowDefId>.  This will also terminate and remove all "in-flight" 
       workflows associated with the definition.
       
       If multiple versions of the definition exist, you will have to undeploy
       each in turn to remove the definition completely or issue the 'undeploy
       definition name' command.
   
   ok> undeploy definition name <workflowName>  ** from v2.1 onwards
   
       Undeploy all versions of a workflow definition.  As with 'undeploy
       definition', all "in-flight" workflows associated with each version
       are terminated.
   
   ## 
   ##  Variable Commands 
   ## 
   
   Note: The following variables are defined automatically when the console
         starts.  They may be deleted or modified.  ** from v2.1 onwards
         
         var bpm:package package 1       (test package of one document)
         var bpm:assignee person admin   (test assignee who is admin)
   
   
   ok> var 
   
       Show all defined variables. 
   
   ok> var <varName>[*]=<varValue> 
   
       Define or update a variable. 
   
       <varName> variable name 
       [*] if specified, define a collection 
       <varValue> variable value (comma-seperate to specify a list of values) 
   
       e.g. 
   
       var bpm:assignee*=admin,fred 
       var wf:notifyMe=true 
   
   ok> var <varName>[*] person <varValue> 
   
       Define or update a (cm:person) node ref variable. 
   
       <varName> variable name 
       [*] if specified, define a collection 
       <varValue> variable value (comma-seperate to specify a list of values) 
   
       e.g. 
       
       var bpm:assignee* person admin,fred 
   
   ok> var <varName>[*] group <varValue> 
   
       Define or update a (usr:authorityContainer) node ref variable. 
   
       <varName> variable name 
       [*] if specified, define a collection 
       <varValue> variable value (comma-seperate to specify a list of values) 
   
       e.g. 
       
       var bpm:groupAssignee group GROUP_Engineering
   
   ok> var <varName> package <itemCount>
   
       Define or update a (bpm:workflowPackage) node ref variable.
       
       A new workflow package is created containing <itemCount> content items.
       
       e.g.
       
       var bpm:package package 4    
   
   ok> var <varName>= 
   
       Delete an existing variable. 
   
       <varName> variable name 
   
   ## 
   ##  Workflow Commands 
   ## 
       
   ok> start [<varName[=varValue>]]* 
   
       Start a new workflow using the currently selected workflow definition.  Start 
       Task parameters are provided as name/value pairs or references to pre-defined 
       variables. 
       
       e.g. 
       
       start bpm:assignee=david wf:predefined 
       
   ok> show workflows [all]  ** from v2.1 onwards
   
       Display the list of active workflows for the currently selected workflow 
       definition.  Or, display the list of all workflows (latest and previous
       versions of process definitions) when used with the additional keyword 'all'.
   
   ok> use workflow <workflowId>
   
       Use the specified <workflowId>.
   
   ok> desc workflow <workflowId> 
   
       Describe the specified <workflowId>. 
   
   ok> show paths [<workflowId>] 
   
       Display the workflow paths for the specified <workflowId>.  If <workflowId> 
       is omitted, the paths for the currently started workflow are shown. 
   
   ok> desc path <pathId>  ** from v2.1 onwards
   
       Describe the specified <pathId>.  Includes the list of properties associated
       with the path.
   
   ok> show transitions [<workflowId>] 
   
       Display all available transitions for the specified <workflowId>.  If 
       <workflowId> is omitted, the transitions for the currently started workflow 
       are shown. 
   
   ok> signal <pathId> [<transitionName>] 
   
       Signal transition on specified <pathId>.  If <transitionName> is omitted, the 
       default transition is taken. 
   
   ok> event <pathId> <eventtype>  ** from v2.1 onwards
   
       Fire an event of custom 'eventtype' against the specified path.
   
   ok> end workflow <workflowId> 
   
       End (cancel) the specified <workflowId>. 
   
   ok> delete workflow <workflowId>
   
       Force deletion of the specified <workflowId>.
   
   ok> delete all workflows
   
       Force deletion of all "in-flight" workflows.  Use with care!
   
   ##
   ##  Timer Commands
   ##
   
   ok> show timers [all]  ** from v2.1 onwards
   
       Display the list of active timers for the currently selected workflow 
       definition.  Or, display the list of all timers when used with the 
       additional keyword 'all'.
   
   ## 
   ##  Task Commands 
   ## 
   
   ok> show my tasks 
   
       List tasks assigned to the currently selected user. 
   
   ok> show my completed 
   
       List tasks completed by the currently selected user. 
   
   ok> show my pooled
   
       List tasks in a pool for the currently selected user.
       
   ok> show tasks [<pathId>] 
   
       List tasks associated with the specified workflow <pathId>.  If <pathId> is 
       omitted, the tasks associated with the currently selected workflow path are 
       shown. 
   
   ok> desc task <taskId> 
   
       Describe the task identified by <taskId>. 
   
   ok> update task <taskid> [<varName[=varValue>]]* 
   
       Update the state of the specified <taskId>.  Task properties are provided as 
       name/value pairs or references to pre-defined variables. 
   
       <varName> variable name 
       [*] if specified, define a collection 
       <varValue> variable value (comma-seperate to specify a list of values) 
       
       e.g. 
       
       update task jbpm$122 bpm:assignee=fred wf:notifyMe=false 
   
   ok> end task <taskId> [<transitionName>] 
   
       End the task identified by <taskId>.  If <transitionName> is omitted, the 
       default transition is taken. 
      
   ok> query task [predicate]*  ** from v2.1 onwards
   
       Query for tasks.  If no predicates are provided, all "in-progress" tasks 
       are returned (across all "active" workflows).
       
       Predicates are:
       
       taskId=<taskId>
       taskName=<taskName>              e.g. taskName=wf:reviewTask
       taskState=IN_PROGRESS|COMPLETED
       taskActor=<actorId>              e.g. taskActor=admin
       task.<propqname>=<propvalue>     e.g. task.bpm:outcome=approve
       processId=<processId>
       processName=<processName>        e.g. processName=wf:review
       processActive=true|false         e.g. processActive=true
       process.<propqname>=<propvalue>  e.g. process.initiator=admin
       orderBy=<orderBy>*               e.g. orderBy=TaskDue_Desc,TaskActor_Asc
       
       Where <orderBy> is one of:
       
       TaskId_Asc,
       TaskId_Desc,
       TaskCreated_Asc,
       TaskCreated_Desc,
       TaskDue_Asc,
       TaskDue_Desc,
       TaskName_Asc,
       TaskName_Desc,
       TaskActor_Asc,
       TaskActor_Desc,
       TaskState_Asc,
       TaskState_Desc     
       
       e.g. query all in-progress pending submissions for web project X, ordered by pending due date, submitter
       
       query task taskName=wcmwf:submitpending taskState=IN_PROGRESS \
         process.wcwmf:webproject=workspace://SpacesStore/projectx orderBy=TaskDue_Desc,TaskActor_Asc
       
   ## 
   ##  end 
   ##

[edit] Example Interaction

 ok> deploy alfresco/workflow/parallelreview_processdefinition.xml
 [WARNING] swimlane 'initiator' does not have an assignment
 [WARNING] warning: no swimlane or assignment specified for task '<task xmlns="urn:jbpm.org:jpdl-3.1" name="wf:reviewTask" blocking="false" signalling="true" priority="normal">
             <event type="task-create">
                <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript" config-type="field" accept-propagated-events="true">
                    <script accept-propagated-events="true">
                       taskInstance.actorId = reviewer.properties["cm:userName"];
                    </script>
                 </action>
             </event>
         </task>'
 deployed definition id: jbpm$15 , name: wf:parallelreview , title: Group Review & Approve , version: 13
 definition: jbpm$15 , name: Group Review & Approve
 workflow: None
 path: None
 359ms
 ok> var bpm:assignees* person admin,david,fred
 set var {http://www.alfresco.org/model/bpm/1.0}assignees = [workspace://SpacesStore/e6e44b26-5f68-11db-9c69-735731735e3a, workspace://SpacesStore/7e1dc0dc-5f90-11db-9dcd-a9c28c21fc86, workspace://SpacesStore/7e9513c3-5f90-11db-9dcd-a9c28c21fc86]
 63ms
 ok> start bpm:assignees
 started workflow id: jbpm$10, path: jbpm$10-@ , node: start , def: Group Review & Approve
 250ms
 ok> show transitions
 path: jbpm$10-@ , node: start , active: true
  task id: jbpm$25 , name: wf:submitParallelReviewTask , properties: 15
  transition id: [default] , title: Task Done
 78ms
 ok> end task jbpm$25
 signal sent - path id: jbpm$10-@ , node: startreview
 500ms
 ok> show transitions
 path: jbpm$10-@ , node: startreview , active: true
  transition id: review , title: review
 path: jbpm$10-@review.0 , node: review , active: true
  task id: jbpm$26 , name: wf:reviewTask , properties: 16
  transition id: reject , title: Reject
  transition id: approve , title: Approve
 path: jbpm$10-@review.1 , node: review , active: true
  task id: jbpm$27 , name: wf:reviewTask , properties: 16
  transition id: reject , title: Reject
  transition id: approve , title: Approve
 path: jbpm$10-@review.2 , node: review , active: true
  task id: jbpm$28 , name: wf:reviewTask , properties: 16
  transition id: reject , title: Reject
  transition id: approve , title: Approve
 250ms
 ok> desc task jbpm$26
 id: jbpm$26
 name: wf:reviewTask
 title: Review
 description: Review Documents to Approve or Reject them
 state: IN_PROGRESS
 path: jbpm$10-@review.0
 transitions: 2
  transition: reject , title: Reject , desc: Reject
  transition: approve , title: Approve , desc: Approve
 properties: 16
  {http://www.alfresco.org/model/bpm/1.0}context = null
  {http://www.alfresco.org/model/bpm/1.0}dueDate = null
  {http://www.alfresco.org/model/bpm/1.0}description = Review
  {http://www.alfresco.org/model/bpm/1.0}pooledActors = []
  {http://www.alfresco.org/model/content/1.0}created = 2006-10-19 17:43:35.0
  {http://www.alfresco.org/model/bpm/1.0}outcome = 
  {http://www.alfresco.org/model/bpm/1.0}status = Not Yet Started
  {http://www.alfresco.org/model/bpm/1.0}completionDate = null
  {http://www.alfresco.org/model/content/1.0}owner = admin
  {http://www.alfresco.org/model/bpm/1.0}packageActionGroup = 
  {http://www.alfresco.org/model/bpm/1.0}priority = 3
  {http://www.alfresco.org/model/bpm/1.0}startDate = null
  {http://www.alfresco.org/model/bpm/1.0}percentComplete = 0
  {http://www.alfresco.org/model/bpm/1.0}taskId = 26
  {http://www.alfresco.org/model/bpm/1.0}package = null
  {http://www.alfresco.org/model/bpm/1.0}packageItemActionGroup = edit_package_item_actions
 94ms
 ok> show workflows
 id: jbpm$10 , desc: null , start date: 2006-10-19 17:43:26.0 , def: Group Review & Approve
 187ms
 ok> end workflow jbpm$10
 workflow jbpm$10 cancelled.
 594ms

[edit] Workflow Console Web Page