The Learning Pathway: Actions, Rules and Simple and Advanced Workflow Integration Use Cases

Uploaded on

Slide deck, for the webinar presented on 21st of September 2011 in the

Slide deck, for the webinar presented on 21st of September 2011 in the

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads


Total Views
On Slideshare
From Embeds
Number of Embeds



Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

    No notes for slide


  • 1. The Learning PathwayActions Rules and Simple and Advanced Workflow Integration Use CasesJörg Sauer
  • 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
    1 Drafts
    3 Approve
    4 Published
    2 Review
  • 4. Simple Workflow
    User can build workflow
    Easy to understand
    No State: Implicit state by location (folder)
    No Task: Implicit task by folder access
    No branching: Serial workflow only
    1 Drafts
    3 Approve
    4 Published
    2 Review
  • 5. Demo Simple Workflow
  • 6. Adding Status
    Content Model:
    Provide custom Aspect to hold workflow status
  • 7. Amend Workflow with status
    Set Status on each workflow folder
    Add Aspect: Workflow Status
    Set workflow status accordingly
    1 Drafts
    3 Approve
    4 Published
    2 Review
    • Status: draft
    • 8. Status: under review
    • 9. Status: pend. approval
    • 10. Status: published
  • After configuration
  • 11. Transfer Status to incoming documents
    JavaScript to copy status
    Execute by Rule
  • 12. Simple Workflow Status Demo
  • 13. Alfresco Repository Actions
    Action: Unit of work that is performed against a node
    Move node
    Transform content of node
    Send email
    Out of the Box Actions
    Custom Actions
    Implement own Action class
    Deploy in Application Context
  • 14. Implement Copy Workflow Status Action
  • 15. Deploy Action (Application Context)
    Beans: webinar-action-context.xml
  • 16. Simple Workflow: Implementation Details
    Documents amended with properties for
    Approve step label, copy/move, destination
    Reject step label, copy/move, destination(all optional)
  • 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
    No notification emails
    No need to check simple workflow folders
  • 18. Simple Workflow Task Architecture
    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
    Bug Fix for Alfresco StartWorkflowActionExecuter
    UI for Rule Config
  • 19. Workflow Description Aspect
  • 20. Simple Workflow Task Advanced Workflow
  • 21. Content Model for Workflow
    simpleWorflow: Manage Action Labels
    Content Types:
    simpleWfTaskStart: Properties for Start Task
    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
  • 22. Workflow Model (partial)
  • 23. Simple Process Definition
    Create Process Definition
    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
    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!
  • 27. Review Alfresco implementation
  • 28. Direct Code reuse
    From Package org.alfresco.web.bean
    Workflow Event not within web context.
    DocNode not core object
    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
    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
    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
    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
  • 34. JavaScript to start workflow
  • 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
    Alfresco API Development Course (3 days)
    Alfresco Workflow Course (2 days)
    Alfresco (API) Documentation
    Wiki Resources
    Alfresco Developer Guide (Packt Publishing)
    Professional Alfresco (Wrox Press)
  • 39. Questions?
    Twitter: joergsauer
    In Person: DevCon 2011 London
  • 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