Joget DX 8 Stable Released
The stable release for Joget DX 8 is now available, with a focus on UX and Governance.
...
For example, consider a Leave Application process . When an employee fills out a leave application form, they provide details such as the date of application, the duration of the leave, and the reason for the leave. This type of data is specific to that particular form. These details are critical where form data like application date, leave duration, and reason are specific to each application. They are used for record-keeping and for informing the decision-makers (like supervisors ) about the leave request . However, they typically serve only within the scope of that form and are used for informational purposes rather than driving the process flow. This form-specific data is usually stored associated with that particular leave application instance. It can be accessed and reviewed by relevant parties, such as HR personnel or supervisors, to understand the specifics of the leave requestbut do not control the workflow.
Workflow variables, on the other hand, are elements that carry significant weight in determining the flow of the process. In the Leave Application process, a good example of a workflow variable could be "supervisorApproval". This variable might store a value like "approved" or "rejected". The value of this variable is used to decide the next steps in the workflow. For example, if "supervisorApproval" is "approved", the process might move to the HR department for final processing. If it's "rejected", the process might end or return to the employee for further action. The key here is that the workflow variable directly influences the overall process flow. It's not just a piece of information, but a driver for decisions and actions within the workflow. This variable becomes crucial when a supervisor's decision (accept or reject) alters the course of the workflow, triggering different activities or decisions.
Here is a screenshot from a sample app showing a process builder and workflow variable initialization.
...
Scope: The data entered or displayed in form fields is specific to that form instance.It's mainly used for capturing and displaying information relevant to a single step or part of the process. For additional advanced usage, the form data can be extracted used within the App using the Form Data Hash Variable which increases the scope to a global level (allowing usage in other parts of the App).
Storage: Data from form fields is typically stored in the application's database and is associated with the specific instance of the form. It's accessible whenever the form is loaded or referenced (using Form Hash variablesVariables).
...
Influence on Process Flow: Workflow variables are often used to control process routing, conditions, and decision points within a workflow. Their values can determine which path a process takes, or which activities are triggered next.
Info | ||
---|---|---|
| ||
In Joget, a form field and a workflow variable, even if named similarly (e.g., both called "status"), are distinct entities. A form field is specific to a form and is used to capture user input, while a workflow variable is a broader process-level variable that can influence and guide the workflow's progression and routes taken. So in this case, the 'status' variable is also stored in different database tables. |
Storage: Stored on a database table separate from the form data. These variables are stored in the "shkactivitydata" database table and are not to be tampered with for reasons mentioned below in the section Storage mechanisms for form data variables and workflow variables
...
Form Data Update Tool: This plugin is used to update values directly in the database. To use this go to Process Builder> Tools> Mapping> Select Update Form Data> Choose Form Field to Update.
The changes made using this tool affect the data stored in form fields. It is an efficient way to ensure that the data entered or modified in form fields is accurately reflected in the database without user interaction and directly using the process workflow. Oftentimes, this will come inbuilt with your Joget version.
Figure 2: Form Data Update Tool in Process Builder
Workflow Variable Update Tool: Available at the marketplace, the Workflow Variable Update Tool updates the value of workflow variables. To use this go to Process Builder> Tools> Mapping> Select Workflow Variable Update Tool> Choose Workflow Variable to Update.
It's used when there's a need to modify the values of variables that control or influence the workflow process. If your goal is to match the form data variable with the workflow variable, it is necessary to use both the plugins mentioned above otherwise it will not synchronize properly if both of these tools are not used together.
Figure 3: Workflow Variable Update Tool in Process Builder
Besides the Workflow Variable Update plugin, BeanShell scripting can also be used to update workflow variables. While BeanShell scripting provides a flexible way to manage workflow variables, the Workflow Variable Update Tool is often preferred for its user-friendliness, especially for users who might not be comfortable with scripting.
...
While workflow variables are essential for process routing, other elements like form data and hash variables can also be used for similar purposes. For example, using a form hash variable in a transition condition ((# form.f1.TextField # === "true")) is a viable alternative. Both form hash and workflow hash will work. Apart from routing, a workflow hash can also be used within the application for dynamic data referencing, such as in custom scripts or email bodies, where they can be called upon using syntax like # variable.status #.
Figure 3: Making a routing decision using a Workflow Variable in Process Builder
Figure 4: Making a routing decision using a Form Hash Variable in Process Builder
A key feature of workflow variables is their ability to create an audit trail. As the process progresses, In the monitor section, the variable list efficiently tracks a record's progress through the workflow.
Figure 5: Viewing a Completed Activity Instance
In this view, one can see the state and statistical data of a particular completed activity instance.
The decision to use workflow variables, form data, or hash variables depends on the specific needs of the process. For simpler decision-making where an audit trail is not critical, form data or hash variables might suffice. However, for complex processes where tracking the history of decisions is important, workflow variables become indispensable.
...