Lab 17 - Running rewards process

Lab Goal

To build, deploy, and complete rewards process including task forms for approving an employee rewards submission

Running rewards process

Time to run our new rewards process by submitting ourselves for a reward, evaulating this award as the HR department in the user task, submit that decision in the form provided, and verify that the personnel file got updated and that we are notified of the results with an email.

Intermezzo

  • We have e-mail task, but no SMTP server?
  • Let's use custom WorkItemHandler to log instead of mail:
  • Project Authoring -> Tools -> Project Editor

Intermezzo

  • We need to get a specific KnowledgeBase setup
  • Project Settings -> Knowledge bases and sessions

Intermezzo

  • Add -> 'rewards' in pop-up -> OK
  • Select 'rewards' KnowledgeBase and make it default.

Intermezzo

  • Add a specific KnowledgeSession
  • Add -> 'rewardsSession' in pop-up
  • check 'Default' box
  • State: 'Stateful'
  • Clock: 'Realtime'

Intermezzo

  • Finally, add EMAIL Work Item Handler.
  • click on 'rewardsSession' entry pencil mini-icon to edit session
  • click ADD
  • Name: 'Email'
  • Type:new org.jbpm.process.instance.impl.demo.SystemOutWorkItemHandler()
  • Close pop-up and save Project Editor

Intermezzo

  • Now when we run our project, the email task will not fail.
  • Instead of using SMTP server, we write to server log.
  • This is an example of overriding a default work item handler with a custom implementation.

Running rewards process

  • Are you ready to build and deploy our rewards project?
  • Project Authoring -> Tools -> Project Editor

Running rewards process

  • click on Build & Deploy button in top right corner

Running rewards process

  • Click on No in Information popup to just build and deploy
  • Watch for the green popup bar stating that the build was successful

Running rewards process

  • Now we can examine our deployed process definition
  • Project Authoring -> Process Mangement -> Process Definitions
  • To view our definition details, click on the magnifying glass icon under Actions

Running rewards process

  • An overview of the various process definition details is given in this view
  • You can start a process instance from here by clicking the New Instance button

Running rewards process

  • We can also start a process instance from the Process Definition view by clicking the start-icon under Actions

Running rewards process

  • Either way, we get a popup start process form that we designed previously
  • We fill in the rewards submission details and click on the arrow at the bottom

Running rewards process

  • Watch for the yellow popup bar stating Process instance started
  • We are then presented with the process instance view, notice progression to Approve Reward task

Running rewards process

  • Open the task list to view waiting user tasks
  • Project Authoring -> Tasks -> Tasks List
  • Our task is in the Active and Group lists until claimed

Running rewards process

  • Click on open lock icon to claim the task, a yellow popup bar confirms claim
  • We are presented with the details of our task

Running rewards process

  • To start working on this item, click on the check-icon or Work button
  • Presented the task form on the right as we designed it, data read-only, approval check box
  • But wait.... something is wrong???

Intermezzo

  • The read-only data for amount and explaination from our Award object is missing?
  • This is a problem and left to you for extra credit to fix
  • Hint: mappings of data in forms...

Running rewards process

  • Even though the data is not available for viewing right now, we can approve or deny the request
  • We will approve this request by checking the box (leave blank to deny)
  • Finally, to complete task, click on Complete button at the bottom

Running rewards process

  • You should see a yellow popup bar stating task was completed
  • Then we are presented with an empty task list as we are done
  • Now we can go back and view the completed process instance
  • Process Management -> Process Instances

Running rewards process

  • The initial view is empty as you are looking at Active process instances
  • We need the Completed instances, here I have two, yours might differ
  • Click on magnifying glass icon to open your instance

Running rewards process

  • Here we selected process instance with ID 2
  • There are various details we can examine, like the Instance Log to see the path taken

Running rewards process

  • What is more interesting is an image of the paths taken which is found under Views button
  • Views -> Process Model
  • The grey path is the one taken by this instance

Running rewards process

  • Also interesting are the values that the process variables contained, also found under Views button
  • Views -> Process Variables
  • View variable values over time by clicking any clock icon

Running rewards process

  • Now lets start a new process instance (remember how?) and not complete it
  • We will leave it to make the BAM (Business Activity Monitoring) dashboards interesting
  • After starting a new process let's open the Process & Task Dashboard
  • Dashboards -> Process & Task Dashboard

Running rewards process

  • The dashboard shows the history information on process and tasks

Running rewards process

  • Drill down into Instances by process pie chart by clicking on it (top right)
  • Now you see the status of the instances, a not assigned task from our active process instance

Running rewards process

  • Video tour showing how it works:

Rewards process project

(next up, new requirements leads to next evolution of the reward process project...)
Eric D. Schabell
JBoss Technology Evangelist
@ericschabell
http://schabell.org

JBoss BPM Suite Workshop

Lab 18 - Automated task reassignment