Skip to main content


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

Apply-Parse-Structured method

Updated on August 10, 2022

Use this method to locate and execute a Parse Structured rule ( Rule-Parse-Structured rule type). Parse Structured rules parse structured text string into property values added to the clipboard. The source of the input data depends on which rule type calls this method:

  • In an activity ( Rule-Obj-Activity rule type), the system takes the source data from the property specified in the SourceProperty parameter.
  • In a Parse Structured rule ( Rule-Parse-Structured rule type), you can chain two or more rules together by leaving the SourceProperty parameter blank. Processing by the second (or later) Parse Structured rule continues from the current position within the input data.

Parameters

This method has two parameters:

  • RecordType - Enter a literal value that is the second key part of a Parse Structured rule.
  • SourceProperty - Optional; required for activities. Identify a property reference that contains as its value the input to the Structured Parse rule.

    If the property is on the step page, precede the property name with a period. If this property is on a different page, include the page name in the reference and ensure that this page appears on the Pages & Classes tab of the Activity form or Parse Structured form.

Results

Parse Structured rules have two key parts: an Applies To class and a Record Type.

First, the system assembles a key for the desired Parse Structured rule. It uses the class of the step page as the Applies To class of the key, and the value of the RecordType parameter as the second key part. (If the Step Page field is blank, it uses the class that is the Applies To key part of the activity or Parse Structured rule.)

Next, the system uses rule resolution to locate the Parse Structured rule.

Finally, it applies the Parse Structured rule in the current context:

  • If the SourceProperty parameter is not blank, the value of the property is used as input data.

  • If this method is called from Parse Structured rule and the SourceProperty parameter is blank, parsing of the input file continues using the rule identified through the first parameter and the step page.

Checking the method status

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

Using parent activity's primary page

Usually when an activity calls another activity, the primary page and default step page of the second activity would be the step page of first activity. Rule-Parse-Structured rules can be considered special activities, but with slightly different behavior:

If an activity calls Rule-Parse-Structured type of rules using "Apply-Parse-Structured" method, the primary page of the Rule-Parse-Structured rule would be null and will eventually refer to parent's primary page - that is, the primary page of the activity, and the default step page of Rule-Parse-Structured rule would be that of the step page mentioned in the "Apply-Parse-Structured" step method.

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