You are here: Reference > Activity methods > Branch to another activity

  Branching to another activity

Methods and instructions by function

Use the Branch instruction to cause the current activity to find another specified activity and branch to it without a return. When the system executes a Branch step, control transfers to another activity found through rule resolution. Execution of the original activity pauses.

When the branched activity ends, processing of the current activity ends also; no steps after the Branch step are executed.

You can pass parameters to the target activity, or you can share the current activity parameter page with the target activity.

Optionally, you can identify pages that the called activity will use indirectly, through the prompt mode on the Pages & Classes tab of the calling activity. See Sharing pages between original and branch activities.

Do not include any steps after a Branch instruction, unless the branch occurs only part of the time (because of a transition) or the later steps can be reached through a label and Jump.

Parameters

The Branch instruction requires the name of the target activity branched to, and parameters for that activity.

Parameter

Description

activity

In the Method field, type the word Branch, a space, and the activity name to branch to. SmartPrompt is available.

If the second activity is not in the same class as this activity, and not in the same class as the page identified in the Step Page field, identify the Applies To key part of the second activity also, using the format:

Branch Data-Admin-Operator-ID.Analyze

Pass current parameter page?

Select if you want the current activity's parameter page to be passed to (shared with) the branch activity, which can alter its contents in any way.

Clear this check box to use the array that appears below the check box to pass parameters to the branch activity, on its own parameter page.

If you select this box, make sure that input parameter values needed by the branch activity are present on the parameter page before the Branch instruction.

Value

Complete values for parameters of the branch activity, if you did not check the Pass current parameter page? box. Enter literal or property reference values for each parameter that you want to have a value.

The system creates a parameter page for the branch activity that is unrelated to the calling activity's parameter page.

Results

At runtime, the system uses rule resolution to locate the activity identified in the branch. It transfers control to the activity and passes the parameters supplied. The step page of this step becomes the primary page of the target activity. Processing of the original activity pauses.

When the branched-to activity ends, processing of the original activity also ends. If the original activity was started by another activity using a CALL instruction, processing resumes with that activity.

Sharing pages between original and branch activities

The preferred means for passing a single page from one activity to another is to identify the page in the Step Page field of the calling activity. The second activity receives this page as its primary page.

If you need to pass more than one page, use the indirect page mechanism:

Indirect pages provide a generic way to pass pages not only between activities, but also to other rule types such as HTML rules.

An older alternative way to pass pages between activities — using the parameter Data Type of Page — is no longer recommended.

Checking the method status

This method updates the pxMethodStatus property only if it fails. See How to test method results using a transition.

Definitions indirect page

UpMethods and instructions by function