Lab 16 - Creating process and task forms

Lab Goal

To create process and task forms needed by the rewards process for submitting and processing by HR department

Rewards form design

  • We have completed the configuration of our process we need to design our user forms
  • There are two forms & a sub-form we need:
    • form to submit initial process
    • user task form for Approve Reward task
    • sub-form to define Award object to embed in the other forms

Rewards form design

  • We start by opening our Rewards process in the designer
  • We need to pull down the menu-icon shown and click Generate all Forms

Rewards form design

  • The following forms should be created for you:
    • rewards.rewards-approval-taskform
    • ApproveReward-taskform
  • Note:
    • if Approve Reward task form not generated, most likely missing Task Name properties
    • if Task Name property is empty, it will not generate a task form automatically
    • revisit: User task properties setup in lab 15

Rewards form design

  • We will start by refining the generated process start form
  • Click on the rewards.rewards-approval-taskform to open

Rewards form design

  • The form opens with the tab Add fields by type
  • By default all variables listed for the process are added
  • The Award is not yet defined, we will create a sub-form
  • We need to submit only an employee object, so let's clean this form up

Rewards form design

  • Cleaning up the generated rewards.rewards-approval-taskform
    • hover on the outcome item and click on trash icon to remove
    • hover on the name (name) item, the green one, and click on trash icon to remove

Rewards form design

  • Cleaning up the generated rewards.rewards-approval-taskform
    • hover on award item and click the Last (arrow) icon to move to bottom of the form
    • hover on name item and click on the First (arrow) icon to move to top of the form

Rewards form design

  • Cleaning up the generated rewards.rewards-approval-taskform
    • to make the form nicer for our user, we add an HTML title
    • click on the arrow icon at the top entry HTML label
    • move the HTML to the top of the form using the First (arrow) icon

Rewards form design

  • Cleaning up the generated rewards.rewards-approval-taskform
    • click on the pencil icon for HTML to open the Properties panel

Rewards form design

  • Cleaning up the generated rewards.rewards-approval-taskform
    • change text from HTML to: Submit Employee Reward:

Rewards form design

  • Cleaning up the generated rewards.rewards-approval-taskform
    • set text size to Heading 2 and SAVE to update form

Rewards form design

  • Cleaning up the generated rewards.rewards-approval-taskform
    • now the award item in the form has error message
    • the message is stating that there is no form generated for the award item
    • we will have to create this form, called a sub-from

Rewards form design

  • Creating the Award sub-form
    • New Item -> Form

Rewards form design

  • Creating the Award sub-form
    • fill in name: Award and click on OK

Rewards form design

  • Creating the Award sub-form
    • the blank sub-form will open, now we need to add data origins
    • this will link form data to our model

Rewards form design

  • Creating the Award sub-form
    • Id: award
    • Output Id: award
    • Render color: Violet
    • From Data Model: com.redhat.jboss.hr.rewards.Award

Rewards form design

  • Creating the Award sub-form
    • click on Add Data Holder to include the award data holder

Rewards form design

  • Creating the Award sub-form
    • click on Add fields by origin tab at top of form
    • click on award plus icon to expand data item
    • click on right arrow by award to add all data items to form
    • save form to complete creation sub-form

Rewards form design

  • Adding the Award sub-form to process start form
    • go back to the rewards.rewards-approval-taskform to add sub-form
    • click on Add fields by origin to view form fields
    • click on award (employee) field pencil icon to open properties editor

Rewards form design

  • Adding the Award sub-form to process start form
    • in properties editor, click on Default form field and select Award.form
    • this links the award (employee) to the Award sub-form
    • click on SAVE button to complete properties editing

Rewards form design

  • Creating the Approve Reward user task form
    • click on Form Definitions -> ApproveReward-taskform to open the user task form
    • by default it opens to Add fields by type
    • note the fields need to be adjusted and award (employee) field assigned a sub-form

Rewards form design

  • Creating the Approve Reward user task form
    • click on name (employee) field, arrow icon to make this the top field
    • click on awards (employee) field, arrow icon to make this the bottom field
    • then click on approval (outcome) field, arrow icon to make this the bottom field

Rewards form design

  • Creating the Approve Reward user task form
    • click on award (employee) field pencil icon
    • in properties editor mark as Read only with check box
    • note that the Default form is set to our Award.form sub-form, save to complete

Rewards form design

  • Creating the Approve Reward user task form
    • need to set the name and dept fields to read only to prevent users from changing data
    • we only want them to approve (checkbox) or deny by leaving checkbox empty
    • click on pencil icon to open property editor for name (employee)
    • check the Read only checkbox and SAVE
    • repeat for dept (employee)
    • save user task form and add commit message

Rewards form design

  • Finished designing task forms
    • Tools -> Project Editor -> Build & Deploy

Rewards progress

(next up, running the rewards process...)
Eric D. Schabell
JBoss Technology Evangelist
@ericschabell
http://schabell.org

JBoss BPM Suite Workshop

Lab 17 - Running the rewards process