ProcessMaker API Documentation
ProcessMaker Examples

What is a Watcher?

Understand how to use Watchers in your ProcessMaker Screens.

Overview

Use Watchers mode to add Watchers to that ProcessMaker Screen. During a Request or while previewing the ProcessMaker Screen, a Watcher monitors when the value of a control in that Screen changes or receives a value, acts upon a ProcessMaker Data Connector or runs a ProcessMaker Script using that control's value, and then outputs its result to another Screen control.

A Watcher does the following, in this order during an in-progress Request or while previewing a ProcessMaker Screen:

  1. The Watcher monitors when the value of a control in that ProcessMaker Screen changes or receives a value. This control is designated by its Variable Value setting, which becomes a Request variable when this ProcessMaker Screen is used in a Request.

  2. The Watcher performs an action against a designated ProcessMaker Data Connector or ProcessMaker Script as configured in that Watcher:

    • ProcessMaker Data Connector: The Watcher acts upon a resource to access that ProcessMaker Data Connector. The resources in this ProcessMaker Data Connector may reference API endpoints, ProcessMaker Collection records, or other data source resources.

    • ProcessMaker Script: The Watcher runs the Script using the input data and Script configuration.

  3. After the Watcher performs its action, it outputs its result to a designated ProcessMaker Screen control. This control is designated by its Variable Value setting (the Request variable). This Request variable may be in that ProcessMaker Screen or another that is used during that Request. If outputting its result to a Request variable not in that ProcessMaker Screen, the Watcher's result becomes part of the Request's data during an in-progress Request; if this Request variable matches that of a control during that Request, that Watcher's output value overwrites the target control's existing value. Note that previewing a Watcher when it outputs its result to a Request variable not on that ProcessMaker Screen is not possible since a preview only applies to that Screen.

Related Topics