The Learning Pathway: Actions, Rules and Simple and Advanced Workflow Integration Use Cases
Upcoming SlideShare
Loading in...5
×
 

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

on

  • 997 views

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

Statistics

Views

Total Views
997
Views on SlideShare
997
Embed Views
0

Actions

Likes
0
Downloads
35
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

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

  • The Learning PathwayActions Rules and Simple and Advanced Workflow Integration Use CasesJörg Sauer
  • 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
  • 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
  • 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
  • Demo Simple Workflow
  • Adding Status
    Content Model:
    Provide custom Aspect to hold workflow status
  • Amend Workflow with status
    Set Status on each workflow folder
    Add Aspect: Workflow Status
    Set workflow status accordingly
    reject
    review
    approve
    publish
    reject
    1 Drafts
    3 Approve
    4 Published
    2 Review
    • Status: draft
    • Status: under review
    • Status: pend. approval
    • Status: published
  • After configuration
  • Transfer Status to incoming documents
    JavaScript to copy status
    Execute by Rule
  • Simple Workflow Status Demo
  • 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
  • Implement Copy Workflow Status Action
  • Deploy Action (Application Context)
    Beans: webinar-action-context.xml
    Labels: webinar-action.properties
  • Simple Workflow: Implementation Details
    Documents amended with properties for
    Approve step label, copy/move, destination
    Reject step label, copy/move, destination(all optional)
  • 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
  • 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
  • Workflow Description Aspect
  • Simple Workflow Task Advanced Workflow
  • 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
  • Workflow Model (partial)
  • Simple Process Definition
    Create Process Definition
    Graphically
    Change root tag:
    Add Swimlanes
    Add tasks to task node, will render UI
  • Workflow Deployment
    Attention: No actions implemented yet!
    But want to check if model is correct &workflow deploys
    Context file:
    Redeploy off on production systems!
  • 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)
  • 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!
  • Review Alfresco implementation
    DocumentDetailsDialog.approve()
  • 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 ;-)
  • Lets get the event
    Define in Process Definition
    Derive from JBPMSpringActionHandler
  • 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
  • Hiding Reject Transition if Not Set
    Hide reject transition accordingly
    task-assign event (has to be this event!)
    use bpm:hiddenTransitions (bpm_hiddenTransitions)
  • 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.
  • 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
  • JavaScript to start workflow
  • Life Code Review in IDE
    JavaScript to start workflow
    Action Executer
    Action Handler
    Event Implementation
  • 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
  • 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.
  • 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)
  • Questions?
    Email: joerg.sauer@averi.de
    Twitter: joergsauer
    In Person: DevCon 2011 London
  • 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