You can use the
Run Rule
feature to test an activity
individually before testing it in the context of the application that you are developing.
Optionally, you can convert the run to a Pega unit test case.
You can use the
Run Rule
feature if one of the following criteria is
met:
-
The
Require Authentication
to run check box is selected on the
Security
tab of the
Activity
form.
-
Your access role allows you to update rules that have the
Applies To
class of this activity.
-
Open an activity by clicking and selecting the activity that you want to open.
- Optional:
If the rule has errors,
debug the rule with
the Tracer tool by
click
ing
Trace
.
-
Click .
-
From the Thread list in the Run context
pane, select the thread in which you want to run the rule.
-
By using the Page list, specify if you want to set up initial
values on the clipboard.
You can choose from:
- Copy existing page
- Copy
values
from
an existing clipboard page in the selected thread to
the
RunRecordPrimaryPage
main test page.
You
can use the
Page to copy
list
to
select the page
which
values you want to copy.
- Empty test page
- You can select
this option
if
you do not want to prepopulate RunRecordPrimaryPage with values
from an existing page.
-
Select the Apply data transform check box and
select a
data transform to apply to the values
to
the specified page.
Note: The system always runs the rule instance on the
RunRecordPrimaryPage, regardless of the page that you select from
this list. If you convert this rule run to a test case, and the
RunRecordPrimaryPage requires initial values, set
up
the clipboard
to populate
the page with initial values. See
Setting up your test environment.
-
In the main test page, enter values for parameters, if any, to
pass to the rule.
-
Click Run.
A dialog box
that
displays the results of the rule
run
appears.
You must
close
the dialog box to continue.
-
To convert the test to a Pega unittest case to
validate data in a continuous delivery environment, do the following tasks:
-
Click Convert to Test.
A new tab
appears
in the main Designer Studio window.
-
Configure the Pega unittest case.
- Optional:
In the Clipboard
tool, examine the pages that are generated by the unit test by clicking
Show
Clipboard.
- Optional:
If the rule has errors, click Trace
to debug the rule with the Tracer tool.