An SE created a Task form and is planning to pass data from this form to a new process. Can that be done? What is the best way to do it?
The Problem
The Task form presents a series of checkboxes. Each checkbox represents a document that the user wants to generate. The strategy is to delegate the actual generation (via xPression) to a child process. After the user checks the boxes and clicks the "Generate Documents" button, the child process will start and generate the selected documents. The SE’s idea was to pass the information to the child process as SDT values. Will this work?
This Strategy won’t Work
There are two problems with this approach:
- A process variable is visible by one process only. The values of the process variable are not visible to a child process.
- While you can pass data to an Invoke button, the action that starts a new process cannot take this data as an input parameter.
The Solution
The solution changes the strategy for collecting the data. Proceed as follows:
- Create an action button on the original Task form called “Select Documents to Generate”
- When the user presses this button it will launch a child process (that is, the associated action will be Start a new Process)
- The child process will present the user with a Process Initiation form with the same set of checkboxes and a button called “Generate Docume”
- The user will place check marks on the appropriate documents and then press the Generate Documents button
- The child process will then carry out the work of generating the documents
Comments
- We have delegated the selection of the checkbox data from the parent process to the child process. The information about which checkboxes are selected is now known to the child process - but not to the parent process
- If this information were also needed by the parent process, then it would be necessary to make it persistent by writing to a sysobject that the parent process could also read as necessary.