Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Key Concepts

Hash Variables

Hash Variable is a special hash-escaped keyword that can be used in (but NOT limited to)...–Form Builder–List Builder–UI Builder–Supported plugin configuration properties–Activity name in Process Builder–External Form URL when mapping an activity to an external form...to return the value of useful runtime variables from the (App) Variables. 

In Joget, a Hash Variable is a specialized, hash-escaped keyword that has a wide range of applications across different components of the platform. It can be used in the Form Builder, List Builder, and UI Builder to dynamically retrieve and display the values of runtime variables. Beyond these builders, Hash Variables are also utilized in configuring properties for supported plugins, naming activities within the Process Builder, and specifying external form URLs when mapping activities to external forms.

Example- #date.D-MMM-yyyy# (date hash variable).

This versatile functionality allows Hash Variables to effectively pull and display relevant runtime information from the application's variables, enhancing the dynamic interaction and responsiveness of the application to real-time data changes.

Here is a list of hash variables offered by Joget:

  • Workflow Assignment Hash Variable
  • Workflow Process Hash Variable
  • Current User Hash Variable
  • Date Hash Variable
  • Environment Variable Hash Variable
  • App Variable Hash Variable
  • Form Data Hash Variable
  • Form Binder Hash Variable
  • App Definition Hash Variable
  • App Message Hash Variable (Internationalization)
  • Performer Hash Variable
  • Request Parameter Hash Variable
  • User Hash Variable
  • Userview Key Hash Variable
  • Workflow Variable Hash Variable
  • Request Hash Variable
  • Platform Hash Variable
  • Users Hash Variable
  • Bean Shell Hash Variable
  • Datalist Hash Variable
  • Expression Hash Variable
  • Report Builder Hash Variable
  • Code Builder Hash Variable

This list categorizes the types of Hash Variables that can be utilized within Joget DX for various purposes, such as accessing specific data, internationalizing applications, managing user information, and more. Each type of Hash Variable serves a specific function in retrieving and displaying data dynamically within the Joget application platform.

As can be understood, a hash variable is not to be confused with a workflow variable. Workflow variables CAN be 'extracted' or used as a hash variable for dynamic purposes as mentioned in the list (Workflow Assignment Hash Variable & Workflow Process Hash Variable).

Update Mechanisms

Form Data Update Tool: This plugin is used to update values directly in the database. 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.

Workflow Variable Update Tool: Available at the marketplace, the Workflow Variable Update Tool updates the value of workflow variables. It's used when there's a need to modify the values of variables that control or influence the workflow process.

Besides this tool, BeanShell scripting can also be used to update workflow variables. BeanShell is a lightweight scripting language that offers a flexible way to write scripts for various purposes, including updating workflow variables. While BeanShell scripting provides a powerful and flexible way to manage workflow variables, the Workflow Variable Update Tool is often preferred for its user-friendliness and ease of use, especially for users who might not be comfortable with scripting.

It only takes a couple of lines of code to set the value into a workflow variable:

Code Block
import org.joget.workflow.model.service.*;

WorkflowManager wm = (WorkflowManager) pluginManager.getBean("workflowManager");
wm.activityVariable(workflowAssignment.getActivityId(),"status", "Approved");

Process Routing Mechanisms 

Form Data and Hash Variables for Routing

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. For example, a workflow hash can 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 #.

A key feature of workflow variables is their ability to create an audit trail. As the process progresses, every change in the value of a workflow variable is recorded. This provides a detailed history of how the process has evolved over time, which is essential for review and monitoring purposes. This tracking ability enhances transparency and accountability in the workflow. By having a clear record of all changes, administrators and users can understand the decision-making process and the flow of activities more comprehensively.

Choosing the Right Tool

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.

Dynamic Data Utilization

Apart from routing, workflow variables are versatile in their application.