Completing 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 for mapping our domain model
- configure and assign the user task to a group
- configure specific tasks (Validation, Logging, etc)
- become familiar with the process designer along the way
Process details - add process variables
We will be submitting a
Job
object when starting our process. An extra
process variable is needed:
review
. Let's open the properties editor
for our process:
- hover on top right pencil icon in designer
- click to open
Diagram properties
pane on the right
Process details - open process data
The properties pane for our process opens in right pane, open by clicking on
Process Data
at the bottom to open editor:
Process details - add variable entry
Next click on plus icon '+' to define a new process variable:
Process details - define job variable
Add first process variable, the data model object:
- Name:
job
- Data Type:
Job [com.redhat.demos.devoops.devops_testing]
Process details - define review variable
Add final process variable for determining need for a peer review:
- Name:
review
- Data Type:
Boolean
Save the process
- Be sure to regularly
SAVE
your work, located left top of designer
- You can (and should!) comment your work, so click on that link
- Add a comment and click on
Save
button
- After saving, should see a green bar showing save succeeded
Process details - implementation job node
- Select
Validate Job
node
- Properties for node appears in right pane editor
- Expand the drop-down menu
Implementation/Execution
Process details - setting job variable
In the Java script box, let's validate and setup process variables:
- set the default value for code review:
job.setCodeReveiwCompleted(true);
- write the changes back:
kcontext.setVariable("job", job);
- this pushes local changes back to the mail process 'context' where the submitted job
object is passed along the process
Process details - add job debug information
The next lines are for visibility into the process. Validate job properties
with DEBUG information:
System.out.println("DEBUG: Job dev name: " + job.getDeveloperName() + ".");
System.out.println("DEBUG: Job dev id: " + job.getDeveloperId() + ".");
Process details - more job debug information
Continue validating submitted job object properties:
System.out.println("DEBUG: Job project name: " + job.getProjectName() + ".");
System.out.println("DEBUG: Lines of Code: " + job.getLinesOfCode() + ".");
System.out.println("DEBUG: Review completed: " + job.getCodeReviewCompleted() + ".");
Save the process
- Be sure to regularly
SAVE
your work, located left top of designer
- You can (and should!) comment your work, so click on that link
- Add a comment and click on
Save
button
- After saving, should see a green bar showing save succeeded
Process details - code rules details
The next node is for applying our code rules, so select and view properties. The
two sections need to be completed; Implementation / Execution and
Data Assignments:
Process details - code rules rule flow group
Let's start with opening section
Implementation / Execution and updating:
- for a rule task to apply rules, we need to set the Rule Flow Group to the
rules we want applied here
- rule flow group:
devopsTestingRules
Process details - code rules on exit action
On exit action section
Implementation / Execution update:
- there are sections called On Entry Action and On Exit Action
- these allow for scripting actions in node (optional)
- validate the job attribute this rule task can modify using on exit action
System.out.println("DEBUG ON EXIT CODE RULES: Review
completed set to: " + job.getCodeReviewCompleted() + ".");
Process details - code rules data mapping
Now let's map data in
Data Assignments section:
- open last section at the bottom by clicking on left pencil icon
- here we'll map in the submitted Job object to the rule node and back
out after rules decide on status of peer review
Process details - map job into code rules
Map
Data Inputs and Assignments in pop-up:
- click on
+ADD
- Name:
job_in
- Data Type:
Job [com.redhat.demos.devops.devops_testing]
- Source:
job
Process details - map job out of code rules
Map
Data Outputs and Assignments in pop-up:
- click on bottom
+ADD
- Name:
job_in
- Data Type:
Job [com.redhat.demos.devops.devops_testing]
- Target:
job
Save the process
- Be sure to regularly
SAVE
your work, located left top of designer
- You can (and should!) comment your work, so click on that link
- Add a comment and click on
Save
button
- After saving, should see a green bar showing save succeeded
Process details - gateway (XOR) implementation
After rules decision node, need to determine path to take from the gateway by selecting
the gateway, open properties pane on right and expand Implementation/Execution:
Process details - gateway (XOR) default
Need to set a default route, in our case we default to happy path of next gateway (AND):
- Set default route:
Inclusive
Process details - name passed route
Select top outgoing transition sequence flow and open properties on right:
Process details - passed conditions
Expand
Implementation/Execution
section and use the
Condition
radio button to activate menus for variable checking:
- process variable:
job.codeReviewCompleted
- condition:
is true
:
This path in the process is only taken if the variable is set to true.
Save the process
- Be sure to regularly
SAVE
your work, located left top of designer
- You can (and should!) comment your work, so click on that link
- Add a comment and click on
Save
button
- After saving, should see a green bar showing save succeeded
Process details - gateway (AND) default
Set a default route, in our case we default to next node by selecting the gateway (AND)
and open properties
Implementation / Execution:
- Set default route:
Automated Tests
Save the process
- Be sure to regularly
SAVE
your work, located left top of designer
- You can (and should!) comment your work, so click on that link
- Add a comment and click on
Save
button
- After saving, should see a green bar showing save succeeded
Process details - automated tests node
This step is a placeholder for sending job out for testing of code:
- Select
Automated Tests
node
- Properties for node appears in right pane editor
- Expand the drop-down menu
Implementation/Execution
Process details - automated tests visibility
In the Java script box, let's send a message about sending the job for automated testing.
It's just for visibility into the process:
System.out.println("AUTOMATED TESTS NODE: Job with id " + job.getDeveloperId() + " sent to external system for automated testing.");
Save the process
- Be sure to regularly
SAVE
your work, located left top of designer
- You can (and should!) comment your work, so click on that link
- Add a comment and click on
Save
button
- After saving, should see a green bar showing save succeeded
Process details - log deployment task
This is another placeholder script task, now for sending our job that passed all the automated
test on to an external deployment system:
- Select
Log Deployment
node
- Expand the drop-down menu
Implementation/Execution
Process details - log deployment visibility
In the Java script box, let's send a message about sending the job for deployment.
It's just for visibility into the process:
System.out.println("LOG DEPLOYMENT NODE: Job with id " + job.getDeveloperId() + " sent to external deployment system.");
Process details - end (success) node
The process on this path finished in a labeled end node: Send for Deployment
. The
reason for always labeling end nodes has to do with final metrics produced by the reporting
tooling. With a named end node it's possible to view all process instances that run to
a specific completion point (in this case, sent for deployment).
Save the process
- Be sure to regularly
SAVE
your work, located left top of designer
- You can (and should!) comment your work, so click on that link
- Add a comment and click on
Save
button
- After saving, should see a green bar showing save succeeded
Process details - failure path details
Now it's time to retrace our steps and finish the path of our process where the peer review
is needed and if the peer review fails. It's this portion of the process that needs it's
details flushed out:
Process details - failed review name
Select bottom outgoing transition sequence flow and open properties on right:
Process details - failed review condition
Expand
Implementation/Execution
section and use the
Condition
radio button to activate menus for variable checking:
- process variable:
job.codeReviewCompleted
- condition:
is false
:
This path in the process is only taken if the variable is set to true
Save the process
- Be sure to regularly
SAVE
your work, located left top of designer
- You can (and should!) comment your work, so click on that link
- Add a comment and click on
Save
button
- After saving, should see a green bar showing save succeeded
Process details - peer review name
The user task
Peer Review
first need to be assigned to a group, the
authorized users to claim and complete this task when assigned:
- select
Peer Review
task node
- open
Implementation/Execution
section in right pane
- set Task Name:
peer-review
Process details - peer review group
The user task
Peer Review
needs assigning to a group, that's the
authorized users to claim and complete this task when assigned:
- select
Peer Review
task node
- open
Implementation/Execution
section in right pane
- under
Groups
click on +Add
link creating menu entry
Process details - peer review manager
Now the group we want to add does not exist in the provided menu, so we'll add it:
- open drop down group menu to select a group
- click on
+Add
link
- type new entry:
manager
and click on check to add
Process details - peer review data I/O
Next is passing in our job data object for user to evaluate:
- click on pencil icon next to
Assignments
- this generates a pop-up:
Peer Review Data I/O
Process details - peer review job in
Let's map in our job object into this user task:
- click button:
Data Inputs and Assignments +Add
- fill entry in:
- Name:
job_in
- Data Type:
Job [com.redhat.demos.devops.devops-testing]
- Source:
job
Process details - peer review approval out
Now we'll map the results of the peer reveiw back out:
- click button:
Data Outputs and Assignments +Add
- fill entry in:
- Name:
approval
- Data Type:
Boolean
- Source:
review
- click to
SAVE
Process details - peer review on exit
Now we'll take some actions in the section
On Exit
to update our job
object's value for the code review results and post a debug message:
job.setCodeReviewCompleted(review);
kcontext.setVariable("job", job);
System.out.println("PEER REIVEW TASK: Set code review results to: " + kcontext.getVariable("review") + ".");
Save the process
- Be sure to regularly
SAVE
your work, located left top of designer
- You can (and should!) comment your work, so click on that link
- Add a comment and click on
Save
button
- After saving, should see a green bar showing save succeeded
Process details - gateway (XOR) default
After peer review task, need to determine path to take from the gateway by selecting
the gateway, open properties pane on right and expand
Implementation/Execution:
- Set default route:
Inclusive
Process details - name passed route
Select right outgoing transition sequence flow and open properties on right:
- Assign name:
passed review
Process details - passed conditions
Expand
Implementation/Execution
section and use the
Condition
radio button to activate menus for variable checking:
- process variable:
review
- condition:
is true
:
This path in the process is only taken if the variable is set to true.
Save the process
- Be sure to regularly
SAVE
your work, located left top of designer
- You can (and should!) comment your work, so click on that link
- Add a comment and click on
Save
button
- After saving, should see a green bar showing save succeeded
Process details - failed peer review name
Select bottom outgoing transition sequence flow and open properties on right:
- Assign name:
failed review
Process details - failed review condition
- Expand
Implementation/Execution
section
- Use the
Condition
radio button to activate menus for variable checking:
- process variable:
review
- condition:
is false
:
- This path in the process is only taken if the variable is set to true
Save the process
- Be sure to regularly
SAVE
your work, located left top of designer
- You can (and should!) comment your work, so click on that link
- Add a comment and click on
Save
button
- After saving, should see a green bar showing save succeeded
Process details - log failed review task
This is a logging script task used to note that the review failed, maybe to notify
the submitter of the job:
- Select
Log Failed Review
node
- Expand the drop-down menu
Implementation/Execution
Process details - log failed review visibility
In the Java script box, let's send a message about the failed review, providing visibility
into the process:
System.out.println("LOG FAILED REVIEW NODE: Job with id " + job.getDeveloperId() + " failed to pass the peer review, sending back.");
Process details - End (failure) node
The process on this path finished in a labeled end node: Send back to Developer
.
Again, with a named end node it's possible to view all process instances that run to
a specific completion point.
Save the process
- Be sure to regularly
SAVE
your work, located left top of designer
- You can (and should!) comment your work, so click on that link
- Add a comment and click on
Save
button
- After saving, should see a green bar showing save succeeded
Process details - alerts panel cleared
Note that all should be well in the Alerts
pane at the bottom (no errors):
Lab completed - results
Click on devops-testing project (use bread crumb menu at the top) and view
the domain model assets, this ends lab 6:
Other Red Hat Process Automation Manager Workshops
Red Hat Process Automation Manager Articles
Red Hat Process Automation Manager Demos: