Lab 15 - Completing process details

Lab Goal

To complete the details of rewards process for submitting employee rewards and processing by HR department

Rewards process details

  • The process we designed is incomplete, we need configuration, task group assignments, variables, etc.
  • In this lab we will walk through the process to:
    • assign process variables to map in our domain model
    • configure and assign the user task to a group
    • configure domain specific tasks (Log and Email)
    • showcase process designer features that make life easier

Rewards process details

  • In project authoring we open rewards process and Properties tray
    • AUTHORING -> PROJECT AUTHORING -> PROJECT EXPLORER PANEL (right) -> BUSINESS PROCESSES -> rewards-approval
    • slide out Properties panel, but it overlaps...

Rewards process details

  • There is a tool at the top of the designer on far right
    • no matter what the canvas size is for the process, click on the mini-icon of a screen, process now fits!

Rewards process details

  • Let's do one more resizing of your process:
    • slide out left tray, resize using mini-icon, now fits between trays
    • this is one of the most used features of the process designer

Rewards process details

  • Now back to the process details, starting with process variables
  • We will be submitting an Employee to our process
  • Also two variables during processing; name & outcome
    • slide out right Properties tray
    • click on process canvas (background), select Variable Definitions, click drop down arrow
    • Editor for Variable Definitions displayed

Rewards process details

  • click Add Variable to start row 1 entry
    • Name: employee
    • Standard Type: Object
    • Custom Type: com.redhat.jboss.hr.rewards.Employee

Rewards process details

  • click Add Variable to add two more entries
    • outcome, Boolean
    • name, String

Rewards process details

  • click OK to close editor
  • note variables field Variable Definitions
  • save process under mini-floppy menu in upper right corner
  • click Save, submit commit message, see green conformation pop-up

Rewards process details

  • click on Approve Reward user task
  • in right Properties pane assign fields:
    • DataInputSet: use editor to map into task employee_in

Rewards process details

  • click on Approve Reward user task
  • in right Properties pane assign fields:
    • DataOutputSet: use editor to Add Data Output
    • Name: approval
    • Standard Type: Boolean

Rewards process details

  • click on Approve Reward user task
  • in right Properties pane assign fields:
    • Assignments:
      • New Data Input Assignment: employee object mapped to employee_in task variable
      • New Data Output Assignment: approval mapped out to outcome process variable

Rewards process details

  • click on Approve Reward user task
  • In right Properties pane assign fields:
    • Groups: manager
    • Name: Approve Reward
    • Task Name: Approve Reward
    • On Exit Action: kcontext.setVariable("name", employee.getName());
  • Last action is to copy employee name out to our name process variable

Rewards process details

  • The Approve Reward user task properties should look like this when done:

Save rewards process

  • Save process under mini-floppy menu in upper right corner
  • Click Save, submit commit message, see green conformation pop-up

Rewards process details

  • Click on the Log node, select Assignments in the properties to map a message to be logged.
  • New Data Input Assignement:
    • From Object: Message
    • Assigment Type: is equal to
    • To value: Reward for employee #{name} transaction logged.

Save rewards process

  • Save process under mini-floppy menu in upper right corner
  • Click Save, submit commit message, see green conformation pop-up

Rewards process details

  • Click on the top sequence flow arrow leading to rejected path
  • in Properties pane right open Expression editor
  • In Editor tab select:
    • Process variable: outcome
    • Condition: is false

Rewards process details

  • Click on the top sequence flow arrow leading to rejected path
  • in Properties pane right open Expression editor
  • View source in Script tab

Save rewards process

  • Save process under mini-floppy menu in upper right corner
  • Click Save, submit commit message, see green conformation pop-up

Rewards process details

  • Click on the bottom sequence flow arrow leading to accepted path
  • in Properties pane right open Expression editor
  • In Editor tab select:
    • Process variable: outcome
    • Condition: is true

Rewards process details

  • Click on the bottom sequence flow arrow leading to accepted path
  • in Properties pane right open Expression editor
  • View source in Script tab

Save rewards process

  • Save process under mini-floppy menu in upper right corner
  • Click Save, submit commit message, see green conformation pop-up

Rewards process details

  • Select the script task Note Personnel File Rejected
  • Here we simulate adding rejected note to employees personnel file
  • in Properties pane right open Script editor
  • In Expression Editor add:
    • System.out.println("Note for the personnel file of " + kcontext.getVariable("name") + ", award rejected.");

Save rewards process

  • Save process under mini-floppy menu in upper right corner
  • Click Save, submit commit message, see green conformation pop-up

Rewards process details

  • Select the script task Note Personnel File Approved
  • Here we simulate adding approved note to employees personnel file
  • in Properties pane right open Script editor
  • In Expression Editor add:
    • System.out.println("Note for the personnel file of " + kcontext.getVariable("name") + ", award approved.");

Save rewards process

  • Save process under mini-floppy menu in upper right corner
  • Click Save, submit commit message, see green conformation pop-up

Rewards process details

  • Select the Email task Email Rejected
  • Here we will send a rejection letter to the employees
  • in Properties pane right open DataInputSet
    • Add Data Input: From as a String
    • Add Data Input: Subject as a String
    • Add Data Input: Body as a String
    • Add Data Input: To as a String

Rewards process details

  • Select the Email task Email Rejected
  • in Properties pane right open Assignments
  • Add New Data Input Assignment for each item below:
    • From is equal to hr@company.com
    • Subject is equal to Your reward was rejected!
    • Body is equal to We are happy to inform you that your reward submission was rejected, best of luck next time!!
    • To is equal to #{name}@company.com

Save rewards process

  • Save process under mini-floppy menu in upper right corner
  • Click Save, submit commit message, see green conformation pop-up

Rewards process details

  • Select the Email task Email Accepted
  • Here we will send a congratulatory letter to the employees
  • in Properties pane right open DataInputSet
    • Add Data Input: From as a String
    • Add Data Input: Subject as a String
    • Add Data Input: Body as a String
    • Add Data Input: To as a String

Rewards process details

  • Select the Email task Email Accepted
  • in Properties pane right open Assignments
  • Add New Data Input Assignment for each item below:
    • From is equal to hr@company.com
    • Subject is equal to Your reward was approved!
    • Body is equal to We are happy to inform you that your reward submission was approved and will soon be deposited to your bank account!
    • To is equal to #{name}@company.com

Save rewards process

  • Save process under mini-floppy menu in upper right corner
  • Click Save, submit commit message, see green conformation pop-up

Rewards progress

(next up, creating process and task forms...)
Eric D. Schabell
JBoss Technology Evangelist
@ericschabell
http://schabell.org

JBoss BPM Suite Workshop

Lab 16 - Creating process and task forms