2. The longest title ever Actions, Rules and Simple and Advanced Workflow Integration Use Casesis about Actions to extend Alfresco functionality Rules to automate execution of Actions Use Simple Workflows to implement a Workflow without coding Add Rules to run certain Actions in Workflow steps Use a simple Advanced Workflow to leverage Tasks in Simple Workflows
3. Basic Example to be extended Review Publish Workflow with 2 phase approval review approve publish reject 1 Drafts 3 Approve 4 Published 2 Review reject
4. Simple Workflow Pros: User can build workflow Easy to understand Cons: No State: Implicit state by location (folder) No Task: Implicit task by folder access No branching: Serial workflow only review approve publish reject 1 Drafts 3 Approve 4 Published 2 Review reject
13. Alfresco Repository Actions Action: Unit of work that is performed against a node Examples: Move node Transform content of node Send email Out of the Box Actions Custom Actions Implement own Action class Deploy in Application Context
17. Intention: Create User Task Every time simple workflow is assigned, create advanced workflow task for specific user. User can access task in task list see task description access attached document approve or reject directly from within task Advantage No notification emails No need to check simple workflow folders
18. Simple Workflow Task Architecture Required: Custom aspect for task description.(attached to simple workflow folder) Advanced workflow to be started by rule Configure user Provide task Implement simple workflow actions for Approve Reject Bug Fix for Alfresco StartWorkflowActionExecuter UI for Rule Config
21. Content Model for Workflow Aspects: simpleWorflow: Manage Action Labels Content Types: simpleWfTaskStart: Properties for Start Task Assignee Task Description Simple Workflow Approve & Reject Action Labels All above become process variables! ApprovalOnlyTask: Task properties to approve document ApproveOrRejectTask: Properties for approving or rejecting the document Simplicity: all in sample model Best practice: own workflow model
23. Simple Process Definition Create Process Definition Graphically Change root tag: Add Swimlanes Add tasks to task node, will render UI
24. Workflow Deployment Attention: No actions implemented yet! But want to check if model is correct &workflow deploys Context file: Redeploy off on production systems!
25. Workflow Actions User decides in task to Approve Reject Workflow will transition to nodes approveDocument: code will approve simple workflow rejectDocument: code will reject simple workflow Todo: Implement Event Handler for node-enter event(approve / reject)
26. Code (sneaking) UI has actions for approve/reject Look for action definition in web-client-config-actions.xml Sample implementation can be found in DocumentDetailsDialog.approve() / reject() methods! OpenSource Rules!
28. Direct Code reuse Problem: From Package org.alfresco.web.bean Workflow Event not within web context. DocNode not core object Solution: Reprogram but use native Foundation Services API Should be fool proof ;-)
29. Lets get the event Define in Process Definition Derive from JBPMSpringActionHandler
30. What to Implement Where initializeHandler(): Get all services needed from the factory ServiceRegistry (in case you need something) NodeService to deal with the node CopyService to copy/move the document execute(): Get the process variables through executionContext Implement the approve / reject action
31. Hiding Reject Transition if Not Set Hide reject transition accordingly task-assign event (has to be this event!) use bpm:hiddenTransitions (bpm_hiddenTransitions)
32. Testing First Version Redeploy Manually start Simple Workflow Task workflow Fill in all details in the start form Test both scenarios: Approval only (reject transition hidden?) Approve or Reject Task should show up in task list Open Task and pick Action Check if document has been moved / copied according to Simple Workflow configuration.
33. What’s Missing Action to start Simple Workflow Task Workflow Repository Action UI to fill in Assignee in Rules Configuration Action Handler Simple approach: Use JavaScript to start Workflow Either fixed assignee or assignee is property of folder
35. Life Code Review in IDE JavaScript to start workflow Action Executer Action Handler Event Implementation
36. Final Demo Configured Simple Workflow Add Rule to kick off Simple Workflow Task Workflow Push Document into folder with simple workflow. Review document status Search for documents with status Review task list Manage tasks See documents transition through simple workflow by using advanced workflows functionality
37. Resume Actions extend Alfresco Simple workflows can be configured easily Rules are the binding glue Small advanced workflows can be leveraged in actions and simple workflows. Your imagination is the border Alfresco OpenSource helps you to code and find solutions to your problems.
38. Resources Training Alfresco API Development Course (3 days) Alfresco Workflow Course (2 days) Alfresco (API) Documentation http://docs.alfresco.com/3.4/index.jsp Wiki Resources http://wiki.alfresco.com/wiki/Data_Dictionary_Guide http://wiki.alfresco.com/wiki/Custom_Actions http://wiki.alfresco.com/wiki/Custom_Action_UI http://wiki.alfresco.com/wiki/Workflow http://wiki.alfresco.com/wiki/WorkflowAdministration Books Alfresco Developer Guide (Packt Publishing) Professional Alfresco (Wrox Press)
40. Have you got your ticket yet? DevCon Americas 201126-27th October at the Hard Rock Hotel, San Diego, CA Get some preconference training in on 25th October choose from Jump Start or Advanced Alfresco ∞∞∞∞∞∞∞∞∞ DevCon EMEA & APAC 20119-10th November at Prospero House, Central London, UKGet some preconference training in on 8th Novemberchoose from Jump Start or Advanced Alfresco