Back Forward Property-Map-DecisionTree method

Methods and instructions by function

0301 ZELEK 8/12/03Use the Property-Map-DecisionTree method in to evaluate a decision tree rule (Rule-Declare-DecisionTree rule type) and store the result as the value of a property.

In the Diagram tab of a flow rule, the Decision shape (Decision shape) can reference a decision tree rule.

Parameters

This method has four parameters:

Parameter

Description

PropertyName

Optional. C-2478 Identify a target property to contain the results of the evaluation. B-17184 B-17387 type check (You can't use a local variable here.) MAYED 11/3/06

DecisionTreeName

Enter the name — second key part — of a decision tree rule. The system uses the class of the step page (or primary page) as the Applies To key part. B-21136 BUG-2178

Input

Optional. Enter a literal value or property reference that is the source value for the decision tree evaluation.

When provided, this value is used for comparisons in the top-level structure of the true, for evaluations with no left-hand value, such as: MARIK 12/7/05 Doctors

if > "Hello"

When you leave this blank, the system uses the value of the Property field on the Input tab of the Decision Tree form for the rule.

AllowMissingProperties

Select to cause decision tree processing to continue even if a referenced property is not present on the clipboard. For a Single Value property, the system uses the null string as the value of the missing property. SR-4588 SR-4312 ?

Clear to cause Decision Tree processing to halt if processing references a property that is not present on the clipboard. This causes the system to store an output parameter DecisionTreeStatus with value "NotFound" on the parameter page of the activity.

Results

The system forms a decision tree rule key using the second parameter and the class of the step page or primary page. It uses rule resolution to locate the decision tree rule to be evaluated. True???

It then takes as input to the decision tree evaluation either the value of the third parameter, or the value of the Property field on the Input tab of the decision tree rule. It evaluates the decision tree in the context of this input value and the current clipboard.

It stores the results in the property you identify in the first parameter. Typically, the flow referencing this decision tree chooses which connector to follow from the decision shape based on this property value.

Trapping not found conditions

If the AllowMissingProperties parameter is not selected and a needed property is not present on the clipboard, the Property-Map-DecisionTree method places an output parameter DecisionTreeInvalidProperty on the parameter page of the current activity. This output parameter identifies the name and class of the missing property.

This facility can be useful in those situations where a user can be prompted for the missing property. The PDN article cited below provides an example.

Checking the method status

This method updates the pxMethodStatus property. See How to test method results using a transition.

Pega Developer Network note

See Pega Developer Network article PDNPRKB-8707 How to evaluate a decision tree rule and handle errors.

Definitions decision shape, decision tree
Related topics About Decision Tree rules

UpMethods and instructions by function