Joget DX 8 Stable Released
The stable release for Joget DX 8 is now available, with a focus on UX and Governance.
Hash Variables gives users greater flexibility and freedom in accessing useful information or relevant runtime values from the system.
A hash variable is a special hash-escaped keyword that can be used in
to return the value of some useful runtime variables from Joget components.
Available Hash Variables:-
Children Display |
---|
Since version 3.0.3, a Hash Variable can be used inside another Hash Variable to form a Nested Hash Variable. The syntax for the inner Hash Variable is wrapped by a pair of curly bracket '{' and '}'.
Syntax:
Code Block |
---|
Wiki Markup |
{toc} h2. Hash Variables h3. Assignment To get *workflow activity information* of the current assignment: * \#assignment.processId# * \#assignment.processDefId# * \#assignment.processName# * \#assignment.processName# * \#assignment.processVersion# * \#assignment.processRequesterId# * \#assignment.description# * \#assignment.activityId# * \#assignment.activityName# * \#assignment.activityDefId# * \#assignment.assigneeId# h3. Performer To get *user information of the performer* of an activity: * \#performer._activityDefId_.id# * \#performer._activityDefId_.username# * \#performer._activityDefId_.firstName# * \#performer._activityDefId_.lastName# * \#performer._activityDefId_.email# * \#performer._activityDefId_.active# * \#performer._activityDefId_.timeZone# To get activityDefId (activity definition ID), mouseover the activity name in the Activity Mapping tab (Workflow Management Console); there will be an overlay showing the ID. h3. Form To get *data from form table:* * \#form._formDataTableName_.fieldId# * \#form._formDataTableName_._fieldId\[record id\]_\# (Only available in 3.1) For example: {code} #form.registration.registeredDate# #form.registration.registeredDate[0001]# #form.registration.registeredDate[{variable.recordId}]# //using nested Hash Variable with curly bracket. {code} h3. Workflow Variable To get the *value of a workflow variable:* * \#variable._variableName_\# For example: {code} #variable.approvalStatus# {code} h3. Date To *get date time* according to a specified format: * \#date._javaSimpleDateFormat_\# (refer to [http://download.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html] for more formatting patterns) For example: {code} #date.h:mm a# // 12:08 PM #date.EEE, d MMM yyyy h:mm:ss a# // Wed, 4 Jul 2009 12:08:56 PM {code} h3. User (v2.0.0 and above) To get *user information* based on *username:* * \#user._username_.id# * \#user._username_.username# * \#user._username_.firstName# * \#user._username_.lastName# * \#user._username_.email# * \#user._username_.active# * \#user._username_.timeZone# For example: {code}#user.admin.email#{code} Apart from all of the existing [Hash Variables supported in Joget version 2|KBv2:Hash Variables] as described above, these are the new hash variables supported in v3. h2. Other Hash Variables {children:sort=title} h2. Nested Hash Variable Since version 3.0.3, a Hash Variable can be used inside another Hash Variable to form a Nested Hash Variable. The syntax for the inner Hash Variable is wrapped by a pair of curly bracket '{' and '}'. Syntax: {code}#prefix.{prefix.variableKey}#{code} |
Example:
Code Block |
---|
} #date.{envVariable.dateFormat}# #user.{variable.username}.firstName# #form.tableChild.field1[{form.tableParent.childId}]# {code} |