Skip to main content


         This documentation site is for previous versions. Visit our new documentation site for current releases.      
 

Property-Map-DecisionTree method

Updated on August 16, 2022

Use the Property-Map-DecisionTree method in to evaluate a decision tree ( 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 can reference a decision tree.

Parameters

This method has four parameters:

ParameterDescription
PropertyNameOptional. Identify a target property to contain the results of the evaluation. (You can't use a local variable here.)
DecisionTreeNameEnter the name — second key part — of a decision tree. The system uses the class of the step page (or primary page) as the Applies To key part.
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:

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.

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 key using the second parameter and the class of the step page or primary page. It uses rule resolution to locate the decision tree to be evaluated.

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. 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 Pega Community 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 Community note

See the Pega Community article How to evaluate a decision tree and handle errors.

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us