Branches are different portions of the same pipeline that run at different times. Most pipelines are composed of more than one branch.
When a pipeline is initiated by a Head Pipe (or other Request Processor) the Head Pipe immediately splits into three branches:
- Action branch — Runs the tasks that respond to the request.
- View branch — Updates what the user sees (if anything).
- Error branch — Triggered only if a task cannot be completed
Typically, the View branch runs after the Action branch. The Error branch runs only if a task cannot be completed and an error is thrown.
The different branches are part of the same pipeline but they use different data buckets. If you want to share data between branches, you must choose which data objects to preserve and retrieve them for use by the appropriate branch. For more information on preserving and retrieving data Objects between pipeline branches, see ibm.PreserveMapPipe
The following diagram shows an example of a branched pipeline:
All three pipeline branches are used:
The Action branch
does the following:
- RepoLoadPipe loads a form from a repository as an array of bytes.
- LoadFormPipe changes the loaded form byte array to a Form object.
- The second RepoLoadPipe loads an XML file and saves it in data bucket.
- EncloseInstancePipe adds the loaded XML file to one of the form instance with name.
- PreserveMapPipe preserves the form so it can be used in the View branch.
The View branch
is a smaller secondary branch that does the following:
- RestoreMapPipe retrieves the form that was created in the Action branch.
- ReturnDataPipe returns the form to the user.
The Error branch
is another small secondary branch that does the following:
- HeadPipe initiates the Error Branch If the Action branch or View branch is unable to complete its tasks, the Error branch throws an error.
- ReturnErrorPipe displays an error message.
Parent topic: About Pipelines