jBPM Overview &  Alfresco Workflows
Upcoming SlideShare
Loading in...5
×
 

jBPM Overview & Alfresco Workflows

on

  • 23,177 views

A talk about workflows in jBPM and some real use cases, including detailed explanation on Alfresco Advanced Workflows.

A talk about workflows in jBPM and some real use cases, including detailed explanation on Alfresco Advanced Workflows.

Statistics

Views

Total Views
23,177
Views on SlideShare
22,982
Embed Views
195

Actions

Likes
11
Downloads
997
Comments
3

5 Embeds 195

http://www.slideshare.net 188
http://www.linkedin.com 3
http://swazzy.com 2
http://www.lmodules.com 1
http://posterous.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

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

jBPM Overview &  Alfresco Workflows jBPM Overview & Alfresco Workflows Presentation Transcript

  • JBPM Overview & Alfresco Workflows @author: Francesco Valente @email: francesco83.valente@gmail.com @franko_valente
  • ./Road map 1. Introduction Business Process Management Domain Specific Languages Graph Oriented Programming 2. jBPM Overview Workflows Process Definition 3. jBPM-jPDL Suite Installing the jBPM engine Installing the jBPM Designer 4. jBPM In Action! Review & Approve workflow Step-by-Step jBoss jBPM WF API usage A Real jBPM use case: Alfresco WF Step-by-Step Alfresco Advanced Workflow
  • ./Introduction | BPM Goals of BPM systems? The main goal of BPM systems is to facilitate the automation of business processes. Two main roles can be distinguished: The business analyst : studies and describes the business process and specifies the software requirements The developer : creates executable software In small teams, these two roles can of course be fullfilled by one person.
  • ./Introduction | BPM The business analyst and the developer NEED to communicate in a common language with the help of the graphical view of the process.
  • ./Introduction |DSL Each process language can be considered a Domain Specific Language (DSL)
  • ./Introduction |DSL Domain Specific Languages Each language has a certain grammar That grammar can be expressed as a domain model. (In case of java this is Class, Method, Field, Constructor,... In jPDL this is Node, Transition, Action...) Developers think in those grammars when authoring artifacts for a specific language. The IDE is build around the grammar of a language. E.g. a jPDL process has a graphical editor and a XML source view editor.
  • ./Introduction |DSL Domain Specific Languages Internal DSLs are particular ways of using a host language to give the host language the feel of a particular language. This approach has recently been popularized by the Ruby community. Internal DSLs are also referred to as embedded DSLs or FluentInterfaces External DSLs have their own custom syntax and you write a full parser to process them. Many XML configurations have ended up as external DSLs, although XML's syntax is badly suited to this purpose. (www.martinfowler.com)
  • ./Introduction |GOP Graph Oriented Programming Is the foundation for all domain specific languages that are based on executing a graph. Is a very simple technique that describes how graphs can be defined and executed on a plain OOP language
  • ./Introduction |GOP Graph Oriented Programming Two main features: support for wait states graphical rappresentation
  • ./Introduction |GOP Support for wait states With an imperative language there's no wait instruction Blocking threads is not a solution: threads are not persistable To achive persistance we need a database interaction. RAM based programs are not sufficients.
  • ./Introduction |GOP Graphical rappresentation The communication between a business analyst and the developer is improved using the graph based diagram of the business process as the common language.
  • ./jBPM Overview JBoss JBPM JBoss JBPM is the open source WFMS (WorkFlow Management System) suited by JBoss. JBPM processes are created using a proprietary language of process definition called jPDL. State Management with jBPM is based on a graph with nodes and transitions that make up the definition of a process (Process Definition).
  • ./jBPM |Workflows A workflow therefore, consists of a set of activities related to each other through different types of relationships. Example: BPMN notation of a process of monitoring the availability of an agricultural product in stock.
  • ./jPDL |Process Definition Example: jPDL notation of an approve & reject process of documents.
  • ./jPDL |Process Definition
  • ./jPDL |Process Definition The graph of the states provides the structure of the process. The interaction with the process occurs, at "low-level", through the use of specially designed API. The actions are business logic (classes that implement the interface org.jbpm.graph.def.ActionHandler) that can be performed after special events such as entry in a node, the output from one node and the transition between states. The process definitions are contained within the XML file that can be constructed by hand or by using the graphical tool JBoss jBPM Graphical Process Designer (GPD) distributed as an Eclipse plugin.
  • ./jPDL |Process Definition The definition of a process represent what needs to happen within the system during a business process and can be composed of a set of sub-processes. It is formalized in terms of: State (node) : A state within a process specifies a dependency on external actors. At runtime this means that the workflow engine must wait until an outside actor notification that the execution has been completed.
  • ./jPDL |Process Definition Action : An action is the application logic that must be performed by the workflow engine after the occurrence of a specific event. Flows of concurrent execution are modeled with forks and joins, while the exclusive execution flows are modeled with merge and decision points. Transitions : are about moving the process from one state to another through the application of a predetermined action. Process Context : the context of the process managed by workflow.
  • ./jBPM-jPDL Suite Architecture
  • ./Installing jBPM-jPDL suite Step 1/3 - Install Java (easy) Required java 5.0 or above (I used java 6) Set properly the environment variable JAVA_HOME
  • ./Installing jBPM-jPDL suite Step 2/3 - Install the jBPM engine and the JBoss application server We need exactly the jbpm-jpdl-suite-3.2.3.zip file from this url NOTE: Recent versions (recently has been released Version 4 of jBPM) are not well documented and introduce substantial changes in libraries. Moreover, most of the resources available on the network relies on this version.
  • ./Installing jBPM-jPDL suite ... The suite is a download that contains all the jBPM components bundled in one easy download. The download includes the following folders: config, configuration files for a standard java environment db, SQL scripts for DB creation and compatibility information designer, the eclipse plugin to author jPDL processes and installation scripts (this is not part of the plain jpdl download ).
  • ./Installing jBPM-jPDL suite ... doc, userguide and javadocs examples lib, libraries on which jbpm depends server, a preconfigured jboss that contains jbpm inside the console web application (this is not part of the plain jpdl download) src, the jbpm and identity component java sources
  • ./Installing jBPM-jPDL suite ... Let's make sure the installation is working correctly: Go into the server directory and lunch ./start.sh Open the url http://localhost:8080/jbpm-console/
  • ./Installing jBPM-jPDL suite ... The workflow application bundled with jBPM
  • ./Installing jBPM-jPDL suite Step 3/3 - Install the JBoss jBPM designer We need Eclipse 3.3.x NOTE: for the installation of Eclipse jBPM Designer, consult the guide on the official site of JBoss.
  • ./Installing jBPM-jPDL suite ...
  • ./jBPM Workflow |In action! We'll cover 3 examples: Review & Approve Workflow API usage A real jBPM use case: Alfresco Workflows
  • ./Review & Approve Workflow Review & Approve (the Hello World) A simple workflow for approval and rejection of documents. Consider the case of a news organization that write articles for a magazine. There are "editors" who write articles and submit them to review to a group of "approvers" who decide to approve or deny a particular article.
  • ./Review & Approve Workflow Process Graphical Design
  • ./Review & Approve Workflow Process Definition Properties Two swimlanes : editors approvers
  • ./Review & Approve Workflow Start State Properties
  • ./Review & Approve Workflow Start State Properties Process Variables declaration: Data inizio Descrizione (... si potrebbero aggiungere altre variabili come ad esempio il corpo dell'articolo)
  • ./Review & Approve Workflow Transition Properties Transition "submit" start -> review It's possible to bind it an Action to perform...
  • ./Review & Approve Workflow processdefinition.xml
  • ./Review & Approve Workflow The prototype user interface Before you deploy the process on the JBoss server should create the so-called "task forms", or graphical user interfaces pertaining to different tasks, whereby each user can complete tasks assigned to him.
  • ./Review & Approve Workflow Generate the task forms We need to generate one of these task forms for every task node in our process. The task forms use XHTML JavaServer Faces tags.
  • ./Review & Approve Workflow JSF ???
  • ./Review & Approve Workflow
  • ./Review & Approve Workflow Fortunately we have the jBPM Designer ... For each task you can automatically generate the form!
  • ./Review & Approve Workflow submitReviewTask.xhtml
  • ./Review & Approve Workflow Deploying the process
  • ./Review & Approve Workflow Investigate the web console First we create two groups: editors and approvers . Then we add two users respectively: editor1 and approver1
  • ./Review & Approve Workflow Investigate the web console
  • ./Review & Approve Workflow Investigate the web console
  • ./Review & Approve Workflow Investigate the web console
  • ./Review & Approve Workflow Investigate the web console
  • ./Review & Approve Workflow Investigate the web console
  • ./jBPM API Usage Hello World Test
  • ./jBPM API Usage ...
  • ./jBPM API Usage Process Variables Test
  • ./jBPM API Usage Custom Action Example
  • ./jBPM API Usage Custom Action Example
  • ./jBPM API Usage ...
  • ./Alfresco Workflows Alfresco supports two different types of workflow: Simple Workflow: content-oriented. Advanced Workflow: task-oriented.
  • ./Alfresco Workflows Simple Workflow Simple Workflow allows you to implement a type of workflow in which the change of status of the document entails moving the document from one folder to another folder of an organization space. Each state is represented by a folder through which "walk" the documents and move from one state to the next. For more details on Simple Workflow consult the official Alfresco wiki.
  • ./Alfresco Workflows Simple Workflow Limitazioni: It's impossible to create a workflow definition multi-state; Confined to one or two output transitions (the only ones allowed are approve , reject ); It's impossible to define "parallel" workflows; There is no concept of task or assignment ;
  • ./Alfresco Workflows Advanced Workflow The Advanced Workflow is task-oriented: a task is created, to which are attached documents, and should be assigned to a particular user. Each user can track the list of tasks assigned to him or instantiated from him. It's possible to change the status of a task, or reassign it to another user, or delete it.
  • ./Alfresco Workflows A real use case In our system we have two workgroups: editors and approvers. And we have two separated and simmetric spaces or folders into Alfresco, under the main space called "QBR intranet" : "restricted "and "public" . Editors have write privileges only on the restricted space. John, member of the editors group, create his own article and upload it into any place under the "restricted" folder, then he submit the doc for approval to every approvers in pooled task mode. If the document will be approved (by one of the approvers that has taken the ownership of the revision), the system automatically will copy it from its "restricted" location into the simmetric "public" location, replicating the tree structure of subfolders if the case.
  • ./Alfresco Workflows A real use case
  • ./Alfresco Workflows Components
  • ./Alfresco Workflows Components Process definition Task Model: provides a description of any human-based tasks within the process. The task description is used to guide the dialogue between the user and the interface in the display and management of the task. Within the Task Model is used the Alfresco Data Dictionary for a description of the object types to store, view or modify. Each task description consists of: Name e Title Properties e Associations
  • ./Alfresco Workflows Components Web client configuration: Specifies the presentation of the Task inside the Alfresco Web Client. The configuration allows you to: Control which task properties are displayed Control which task properties are read-only or required Check how task properties are displayed in the UI. Resource Bundle (optional): The resource bundle provides all the human-readable messages that appear in the UI for workflow management (eg titles of task, the names of properties, etc. ..), thus facilitating also the location of the UI.
  • ./Creating an Advanced Workflow Step 1: Create the Process Definition Two way for creating the process definition document: 1. “By hand” creating a jPDL xml document 2. Using the jBPM Process Designer
  • ./Creating an Advanced Workflow Step 1: Create the Process Definition
  • ./Creating an Advanced Workflow ...processdefinition.xml
  • ./Creating an Advanced Workflow ...processdefinition.xml Swimlane Swimlanes are used to declare the roles within the workflow, ie who should do what. A special swimlane is called 'initiator' with which the actor in the workflow is the one that started the workflow. Pooled Task A task become a 'pooled task' when it is assigned to a group of people, but only one of them can take the ownership. Once he has taken ownership, the person can perform the task, completes it, or he can put it back again in the pool to be available to other people group.
  • ./Creating an Advanced Workflow ...processdefinition.xml Alfresco provide all the power of Javascript to express the business logic within a workflow
  • ./Creating an Advanced Workflow ...processdefinition.xml
  • ./Creating an Advanced Workflow ...processdefinition.xml
  • ./Creating an Advanced Workflow ...processdefinition.xml
  • ./Creating an Advanced Workflow Step 2: Deploying into Alfresco ...from the Designer Through the Process Designer, you can deploy the process on the Alfresco server: 1. Make sure the Alfresco server is runnin 2. On the Deployment tab enter: 1. Server Name = name of the machine where you installed Alfresco 2. Server Port = port number assigned to Alfresco (default: 8080) 3. Server Deployer = /alfresco/jbpm/deployprocess 3. Press Test Connection ... to test the connection. 4. Finally, Deploy Process Archive.
  • ./Creating an Advanced Workflow Step 2: Deploying into Alfresco ...from the Alfresco workflow-console 1. Hand-copy the files related to the process within /alfresco/extension/workflows/{nome_processo}/ 2. Start Alfresco and go in the workflow-console URL http://localhost:8080/alfresco/faces/jsp/admin/workflow-console.jsp 3. Deploy the new workflow by typing: deploy alfresco/extension/workflows/{nome_processo}/processdefinition.xml 4. Restart Alfresco
  • ./Creating an Advanced Workflow ...
  • ./Creating an Advanced Workflow Step 3:The Task Model A Task Model is simply a type of Content Model as supported by the Data Dictionary. To create a Task Model: 1. Create a new Content Model for the definition of the process. 2. Create a 'type' for each task. 3. Within each 'type' describe Properties and Associations required for that task.
  • ./Creating an Advanced Workflow ... reviewPublishModel.xml
  • ./Creating an Advanced Workflow ... reviewPublishModel.xml
  • ./Creating an Advanced Workflow ... reviewPublishModel.xml A Workflow Package is used to hold the content that's routed through the workflow. Content within the package may be viewed, edited, or removed. Some Action Groups available for Workflow Packages: read_package_item_actions allow viewing of package items edit_package_item_actions above + allow modification (edit, checkout, ...) of package items edit_and_remove_package_item_actions above + allow removal of package items remove_package_item_actions allow removal (but not modification) of package items
  • ./Creating an Advanced Workflow ... reviewPublishModel.xml Alfresco provides a pre-registered Content Model for the description of common attributes to all tasks, which are: Start Date Due Date Completion Date Priority Status Workflow Package Context …....
  • ./Creating an Advanced Workflow ... reviewPublishModel.xml These info are defined in the 'bpm:businessprocessmodel' Model, within the file alfresco/model/bpmModel.xml . In this model the two most important type definitions are: 'bpm:workflowTask' and 'bpm:startTask'. All the custom workflow task definitions must inherit from one of these two onces. The start-task in the Task Model must inherit from 'bpm:startTask'. Usually in the Start-task we select participants who have a role within the workflow: bpm:assignee select a single person. bpm:assignees select one or more persons. bpm:groupAssignee select a single group bpm:groupAssignees select one or more groups.
  • ./Creating an Advanced Workflow Step 3: Update the Web client configuration The configuration allows you to: Control which Tasks properties are displayed Control which Tasks properties are read-only or required Control how Tasks properties are displayed into the UI. The file interested is the web-client-config-custom.xml :
  • ./Creating an Advanced Workflow ...web-client-config-custom.xml
  • ./Creating an Advanced Workflow Step 4: Create the resource bundle The resource bundle provides all the human-readable messages that appear in the UI for workflow management (eg titles of task, the names of properties, etc. ..), thus facilitating also the location of the UI.
  • ./Creating an Advanced Workflow Step 5: Deploy the Task Model and the resource bundle The Task Model is just a Content Model, so may be deployed like any other Content Model.
  • ./References jBPM jBoss jBPMWebsite http://www.jboss.org/jbossjbpm/ jPDL Guide http://docs.jboss.com/jbpm/v3.2/userguide/html_single/ jbpm-jpdl-3.2.3.zip http://bit.ly/j357v Javadoc API http://docs.jboss.org/jbpm/v3/javadoc/index.html [PACKT-BOOK] - "Business Process Management with jBoss jBPM" - Matt Cumberlidge
  • ./References Alfresco Website http://www.alfresco.com/ Alfresco Wiki http://wiki.alfresco.com WorkflowAdministration http://wiki.alfresco.com/wiki/WorkflowAdministration Javascript API http://wiki.alfresco.com/wiki/Workflow_JavaScript_API [PACKT-BOOK] - "Alfresco Developer Guide" - Jeff Potts Others Wikipedia Mokabyte http://bit.ly/4D8ZKz
  • Copyright (C) 2009 - QBR engineering http://www.qbreng.it released under CreativeCommons 3.0 by-nc-sa NOTE:Some images and contents are property of the respective copyright holders and are used for purely educational purposes.