Versions Compared

Key

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

Table of Contents
outlinetrue
absoluteUrltrue

...

什么是哈希变量?

Panel
borderColorgreen
borderWidth1
titleBGColor#ddffcc
borderStylesolid
titleDefinition
Hash Variables gives users greater flexibility and freedom in accessing useful information or relevant run-time values from the system.

A hash variable is a special hash-escaped keyword that can be used in :

  • Form Builder
  • Datalist Builder
  • Userview Builder
  • Supported plugin configuration properties
  • Activity name in Workflow Designer
  • External Form URL when mapping an activity to an external form

to return the value of some useful runtime variables from Joget components.

Tip
To conveniently access the list of all hash variables available, use shortcut combination Ctrl-Shift-3 in any of the components above.
Tip

Download the tutorial app on Hash Variables from Joget Workflow Marketplace to learn more about Hash Variable.

Nested Hash Variable

Since version 3.0.3, a Hash Variable can be used inside another Hash Variable to form a Nested Hash Variable.

定义
哈希变量  为用户提供更大的灵活性和自由从系统访问有用的信息或相关的运行时间值。

哈希变量是一个特殊的哈希转义关键字,可用于:

  • 表单生成器
  • 数据主义生成器
  • Userview生成器
  • 支持的插件配置属性
  • 工作流设计器中的活动名称
  • 将活动映射到外部表单时的外部表单URL

从Joget组件返回一些有用的运行时变量的值。

Tip
为了方便地访问所有可用散列变量的列表,可以在上面的任何组件中使用快捷键组合Ctrl-Shift-3 
Tip

  从  Joget Workflow Marketplace 下载Hash变量的教程应用程序,  以了解更多关于Hash变量的信息。   

嵌套哈希变量

从版本3.0.3开始,哈希变量可以在另一个哈希变量中使用,形成一个嵌套哈希变量

内部哈希变量的语法由一对大括号包围。The syntax for the inner Hash Variable is wrapped by a pair of curly bracket.

Code Block
languagejava
titleSyntax / Format
#prefix.{prefix.variableKey}#
Here's some examples:这里有一些例子:
Code Block
titleExample
#date.{envVariable.dateFormat}#
#user.{variable.username}.firstName#
#form.tableChild.field1[{form.tableParent.childId}]#

 

Escaping the Resultant Hash Variable

The parsed/returned Hash Variable may cause incompatibility with the current context/environment such as syntax error in a script. Therefore, one may pass in additional parameters into the hash variable declared to escape certain characters.

Before ending a hash variable with a hash "#", add a question mark character "?" followed by the required format. You may include multiple by defining semicolon ";" separated values.

  • regex
  • json
  • javascript
  • html
  • xml
  • java
  • sql
  • url

转义哈希变量结果

解析/返回的哈希变量可能会导致与当前上下文/环境(如脚本中的语法错误)不兼容。因此,可以将附加参数传递给声明的哈希变量来转义某些字符。

在使用散列“#”结束散列变量之前,添加一个问号字符“?”并紧接着其所需的格式。你可以通过定义分号“;”来包含多个分隔值  。

  1. regx - 用于转义正则表达式特殊字符
  2. json - 用于转义JSON特殊字符
  3. javascript - 用于转义Javascript特殊字符
  4. html - 用于转义HTML特殊字符
  5. xml - 用于转义XML特殊字符
  6. java - 用于转义Java特殊字符
  7. sql - 用于转义SQL特殊字符
  8. url - 用于转义URL特殊字符
  9. nl2br - 用于将新行字符转换为<br> HTML标记
  10. separator(SEPARATOR_CHARS) - 用于更改默认分隔符 “;” 到 SEPARATOR_CHARS。例如 ?separator(, )  ,会使    "abc;def" 变成 "abc,def"。
Code Blockcode
titleExample
#envVariable.script?java#

...


#envVariable.script?nl2br;json#
#form.table.users?separator(, )#

哈希变量列表

Table of Contents
minLevel2
absoluteUrltrue

Workflow Assignment Hash Variable

 

流程任务哈希变量

名称描述
字首
NameDescription
Prefixassignment
Description

To get workflow activity information of the current assignment.

描述

获取当前分配的工作流任务信息。

属性Attributes
  • #assignment.processId#
  • #assignment.processDefId#
  • #assignment.processDefIdWithoutVersion# (v6)
  • #assignment.processName#
  • #assignment.processVersion#
  • #assignment.processRequesterId#
  • #assignment.description#appId# (v6)
  • #assignment.activityId#
  • #assignment.activityName#
  • #assignment.activityDefId#
  • #assignment.assigneeId#
Scope of Use
  • Elements within and part of a Process.
    1. Activity Name.
    2. Form mapped as part of process activity mapping.
    3. Email Tool configuration as part of process tool mapping.

Current User Hash Variable

NameDescription
PrefixcurrentUser
DescriptionTo retrieve currently logged in user information.  
Attributes
  • #currentUser.id#
  • #currentUser.username#
  • #currentUser.firstName#
  • #currentUser.lastName#
  • #currentUser.email#
  • #currentUser.active#
  • #currentUser.timeZone#

In Joget Enterprise edition, these additional attributes are available:-

User Meta

  • #currentUser.meta.KEY#

Organization

  • #currentUser.organization.id#
  • #currentUser.organization.name#
  • #currentUser.organization.description#

Department

  • #currentUser.department.id#
  • #currentUser.department.name#
  • #currentUser.department.description#
  • #currentUser.department.treeStructure#

Grade

  • #currentUser.grade.id#
  • #currentUser.grade.name#
  • #currentUser.grade.description#
  • #currentUser.grade.organizationId#

HOD

  • #currentUser.hod.username#
  • #currentUser.hod.firstName#
  • #currentUser.hod.lastName#
  • #currentUser.hod.email#
  • #currentUser.hod.active#
  • #currentUser.hod.timeZone#

Group

  • #currentUser.groups.id#
  • #currentUser.groups.name#

Employment

  • #currentUser.employee.code#
  • #currentUser.employee.jobTitle#
  • #currentUser.employee.isHod#

Department HOD

  • #currentUser.department.hod.username#
  • #currentUser.department.hod.firstName#
  • #currentUser.department.hod.lastName#
  • #currentUser.department.hod.email#
  • #currentUser.department.hod.active#
  • #currentUser.department.hod.timeZone#
Scope of Use
  • All components within the App.

Date Hash Variable  

NameDescription
Prefixdate
Description

To get date time according to a specified format.

Info
titleLocalization

In Joget Workflow v5, the returned value would follow current logged in user's timezone. If user's information is not available, then it will use server's timezone.

Attributes
  • #date. dateFormat #
  • #date.dateUnit[+-]integerValue.dateFormat #
Info
titleOptions

dateFormat

  • In Java date format; e.g., yyyy-MM-dd for 2011-06-01

dateUnit

  • YEAR
  • MONTH
  • DAY

integerValue

  • Numeric integer value. E.g. 10
Scope of Use
  • All components within the App.
Sample Attributes#date.h:mm a# // 12:08 PM
#date.EEE,d MMM yyyy h:mm:ss a# // Wed, 4 Jul 2014 12:08:56 PM
#date.DAY+7.EEE,d MMM yyyy h:mm:ss a# // Add 7 days on top of current date time - Wed, 11 Jul 2014 12:08:56 PM
#date.DAY-1.EEE,d MMM yyyy h:mm:ss a# // Minus 1 days on top of current date time - Wed, 3 Jul 2014 12:08:56 PM

Environment Variable Hash Variable  

NameDescription
PrefixenvVariable
Description

To retrieve Environment Variable value. Learn more about Environment Variables .

Attributes
  • #envVariable. keyName #
Scope of Use
  • Anywhere within the Joget app itself. (i.e. Process, Process Tool, Form, List, Userview)
Sample Attributes#envVariable.smtpServer#
#envVariable.smtpPort#

Form Data Hash Variable  

NameDescription
Prefixform
Description

To get field value from form table.

Attributes
  • #form. tableName . fieldId #
  • #form. tableName . fieldId [recordId]# (Available in 3.1 and above)
Scope of Use
  • In a Process Tool part of a Process.
  • In a Form.
  • In a process design.
Sample Attributes#form.registration.registeredDate# //will use the current record ID
#form.registration.registeredDate[ 0001 ]# //0001 is the record ID to seek for
#form.registration.registeredDate[{variable.recordId}]# //using nested Hash Variable with curly bracket.

App Message Hash Variable (Internationalization)  

NameDescription
Prefixi18n
Description

To support language localization on application level.

Attributes
  • #i18n. keyName #
Scope of Use
  • All components within the App.
Sample Attributes

#i18n.logout#

Image Removed

ExamplePlease see Add Message.

Performer Hash Variable  

NameDescription
Prefixperformer
Description

To get user information of the performer of an activity.

Attributes
  • #performer. activityDefId .id#
  • #performer. activityDefId .username#
  • #performer. activityDefId .firstName#
  • #performer. activityDefId .lastName#
  • #performer. activityDefId .email#
  • #performer. activityDefId .active#
  • #performer. activityDefId .timeZone#
Scope of Use
  • Elements within and part of a Process.
    1. Activity Name.
    2. Form mapped as part of process activity mapping.
    3. Email Tool configuration as part of process tool mapping.
Info

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.

Warning

The activity chosen must had already been performed.

Sample Attributes
  • #performer.runProcess.firstName#
  • #performer.submitLeave.firstName#

Request Parameter Hash Variable  

NameDescription
PrefixrequestParam
Description

To access request parameter' values.

Attributes
  • #requestParam.parameterName[separator]#
  • Separator (, or ;) can be indicated if requestParam is used in datalist filter with multiple values, to define the separator character in data output. Comma "," is used as default if no separator is indicated in cases of multiple values.
Scope of Use
  • All components within the App.
Sample Attributes
  • #requestParam.key# can be used specifically to obtain Userview Key value.
  • #requestParam.name[;]# to indicate 'name' variable will store multiple values separated by semicolon. For example, this SQL statement "select * from expenses where title in (#requestParam.title[,]#)" will be translated to "select * from expenses where title in (a,b,c)" to cater for multiple values in "where-in" statement.
  • In a Userview page, one may access the following attributes.
    • #requestParam.key#
    • #requestParam.userviewId#
    • #requestParam.menuId#
    • #requestParam.appId#

User Hash Variable  

NameDescription
Prefixuser
Description

To get user information based on username.

Attributes
  • #user. username .id#
  • #user. username .username#
  • #user. username .firstName#
  • #user. username .lastName#
  • #user. username .email#
  • #user. username .active#
  • #user. username .timeZone#

In Joget Enterprise edition, these additional attributes are available:-

User Meta

  • #user. username .meta.KEY#

Organization

  • #user. username .organization.id#
  • #user. username .organization.name#
  • #user. username .organization.description#

Department

  • #user. username .department.id#
  • #user. username .department.name#
  • #user. username .department.description#
  • #user. username .department.treeStructure#

Grade

  • #user. username .grade.id#
  • #user. username .grade.name#
  • #user. username .grade.description#
  • #user. username .grade.organizationId#

HOD

  • #user. username .hod.username#
  • #user. username .hod.firstName#
  • #user. username .hod.lastName#
  • #user. username .hod.email#
  • #user. username .hod.active#
  • #user. username .hod.timeZone#

Group

Employment

  • #user. username .employee.code#
  • #user. username .employee.jobTitle#
  • #user. username .employee.isHod#

Department HOD

  • #user. username .department.hod.username#
  • #user. username .department.hod.firstName#
  • #user. username .department.hod.lastName#
  • #user. username .department.hod.email#
  • #user. username .department.hod.active#
  • #user. username .department.hod.timeZone#
Scope of Use
  • All components within the App.
Sample Attributes
  • #user.admin.email#
  • #user.cat.firstName#
  • #user.{requestParam.username}.email# to retrieve the email address of the user passed via url parameter

Userview Key Hash Variable  

NameDescription
PrefixuserviewKey
Description

Userview Key Hash Variable is used solely for the purpose of accessing the current Userview key's value.

Typical use case for this hash variable are:-

  • Filtering a Datalist based on Userview Key.
  • Preloading certain form data field (e.g. subform) in a Form or Form part of a process flow based on Userview Key.
Attributes
  • #userviewKey#
Scope of Use

Workflow Variable Hash Variable

NameDescription
Prefixvariable
Description

To get the value of a workflow variable in a Process Flow.

Attributes
  • #variable. variableName #
Scope of Use
  • Elements within and part of a Process.
    1. Activity Name.
    2. Form mapped as part of process activity mapping.
    3. Email Tool configuration as part of process tool mapping.
Sample Attributes#variable.approvalStatus#

Request Hash Variable

NameDescription
Prefixrequest
Description

To get the value from the current HttpServletRequest object of the page view.

Attributes
  • #request.characterEncoding#
  • #request.contextPath#
  • #request.header.NAME#
    NAME is the custom header name.
  • #request.locale#
  • #request.method#
  • #request.pathInfo#
  • #request.protocol#
  • #request.queryString#
  • #request.remoteAddr#
  • #request.requestURI#
  • #request.requestURL#
  • #request.requestedSessionId#
  • #request.scheme#
  • #request.serverName#
  • #request.serverPort#
  • #request.servletPath#
Scope of Use
  • All components within the App where there is valid HttpServletRequest object. Such object will not be available in background activity such as in Process Tool triggered as a result of Deadlines.
Sample Attributes

Image Removed

To retrieve the "Referer" header attribute value in the screenshot above, one may use the following hash variable.

Code Block
titleHash Variable
#request.header.Referer#

Platform Hash Variable

 

Panel
borderColorred
borderWidth1
titleBGColor#ffcccc
borderStylesolid
titleNew Feature

This is a new feature in Joget Workflow v6.

...

  • #platform.name#

  • #platform.version#

  • #platform.jdbcDriver#

  • #platform.setting.dataFileBasePath#

  • #platform.setting.deadlineCheckerInterval#

  • #platform.setting.defaultUserview#

  • #platform.setting.fileSizeLimit#

  • #platform.setting.landingPage#

  • #platform.setting.systemDateFormat#

  • #platform.setting.systemLocale#

  • #platform.setting.systemTimeZone# 

In Joget Enterprise edition, these additional attributes are available:-

  • #platform.license.name#

  • #platform.license.holder#

  • #platform.license.users#

  • #platform.license.appLimit#

  • #platform.license.expiry#

  • #platform.license.activated#

  • #platform.systemKey#

使用范围
  • 过程中的元素和部分。
    1. 活动名称。
    2. 表单映射为流程活动映射的一部分。
    3. 电子邮件工具配置作为过程工具映射的一部分
样例

显示被指派人的姓名

#user.{assignment.assigneeId}.firstName# #user.{assignment.assigneeId}.lastName#

流程信息哈希变量

Panel
borderColorpurple
borderWidth1
titleBGColor#ddccff
borderStylesolid
titleNew Feature

这是 Joget Workflow v6 新功能

名称描述
字首process
描述

获取流程实例的信息

属性
  • #process.appId#

  • #process.processId#

  • #process.processDefId#

  • #process.processDefIdWithoutVersion#

  • #process.processName#

  • #process.processVersion#

  • #process.processRequesterId#

  • #process.state#

  • #process.startedTime#

  • #process.limit#

  • #process.due#

  • #process.delay#

  • #process.delayInSeconds#

  • #process.finishTime#

  • #process.timeConsumingFromDateStarted#

  • #process.timeConsumingFromDateStartedInSeconds#

  • #process.activityInst.ACTIVITY_DEF_ID.instanceId#

  • #process.activityInst.ACTIVITY_DEF_ID.name#

  • #process.activityInst.ACTIVITY_DEF_ID.status#

  • #process.activityInst.ACTIVITY_DEF_ID.state#

  • #process.activityInst.ACTIVITY_DEF_ID.type#

  • #process.activityInst.ACTIVITY_DEF_ID.startedTime#

  • #process.activityInst.ACTIVITY_DEF_ID.limit#

  • #process.activityInst.ACTIVITY_DEF_ID.limitInSeconds#

  • #process.activityInst.ACTIVITY_DEF_ID.due#

  • #process.activityInst.ACTIVITY_DEF_ID.delay#

  • #process.activityInst.ACTIVITY_DEF_ID.delayInSeconds#

  • #process.activityInst.ACTIVITY_DEF_ID.finishTime#

  • #process.activityInst.ACTIVITY_DEF_ID.timeConsumingFromDateStarted#

  • #process.activityInst.ACTIVITY_DEF_ID.timeConsumingFromDateStartedInSeconds#

  • #process.activityInst.ACTIVITY_DEF_ID.performer#

  • #process.activityInst.ACTIVITY_DEF_ID.performerUser#

  • #process.activityInst.ACTIVITY_DEF_ID.assignmentUsers#

     

  • #process.appId[PROCESS_INSTANCE_ID]#

  • #process.processDefId[PROCESS_INSTANCE_ID]#

  • #process.processDefIdWithoutVersion[PROCESS_INSTANCE_ID]#

  • #process.processName[PROCESS_INSTANCE_ID]#

  • #process.processVersion[PROCESS_INSTANCE_ID]#

  • #process.processRequesterId[PROCESS_INSTANCE_ID]#

  • #process.startedTime[PROCESS_INSTANCE_ID]#

  • #process.limit[PROCESS_INSTANCE_ID]#

  • #process.due[PROCESS_INSTANCE_ID]#

  • #process.delay[PROCESS_INSTANCE_ID]#

  • #process.delayInSeconds[PROCESS_INSTANCE_ID]#

  • #process.finishTime[PROCESS_INSTANCE_ID]#

  • #process.timeConsumingFromDateStarted[PROCESS_INSTANCE_ID]#

  • #process.timeConsumingFromDateStartedInSeconds[PROCESS_INSTANCE_ID]#

  • #process.activityInst.ACTIVITY_DEF_ID.instanceId[PROCESS_INSTANCE_ID]#

  • #process.activityInst.ACTIVITY_DEF_ID.name[PROCESS_INSTANCE_ID]#

  • #process.activityInst.ACTIVITY_DEF_ID.status[PROCESS_INSTANCE_ID]#

  • #process.activityInst.ACTIVITY_DEF_ID.state[PROCESS_INSTANCE_ID]#

  • #process.activityInst.ACTIVITY_DEF_ID.type[PROCESS_INSTANCE_ID]#

  • #process.activityInst.ACTIVITY_DEF_ID.startedTime[PROCESS_INSTANCE_ID]#

  • #process.activityInst.ACTIVITY_DEF_ID.limit[PROCESS_INSTANCE_ID]#

  • #process.activityInst.ACTIVITY_DEF_ID.limitInSeconds[PROCESS_INSTANCE_ID]#

  • #process.activityInst.ACTIVITY_DEF_ID.due[PROCESS_INSTANCE_ID]#

  • #process.activityInst.ACTIVITY_DEF_ID.delay[PROCESS_INSTANCE_ID]#

  • #process.activityInst.ACTIVITY_DEF_ID.delayInSeconds[PROCESS_INSTANCE_ID]#

  • #process.activityInst.ACTIVITY_DEF_ID.finishTime[PROCESS_INSTANCE_ID]#

  • #process.activityInst.ACTIVITY_DEF_ID.timeConsumingFromDateStarted[PROCESS_INSTANCE_ID]#

  • #process.activityInst.ACTIVITY_DEF_ID.timeConsumingFromDateStartedInSeconds[PROCESS_INSTANCE_ID]#

  • #process.activityInst.ACTIVITY_DEF_ID.performer[PROCESS_INSTANCE_ID]#

  • #process.activityInst.ACTIVITY_DEF_ID.performerUser[PROCESS_INSTANCE_ID]#

  • #process.activityInst.ACTIVITY_DEF_ID.assignmentUsers[PROCESS_INSTANCE_ID]#

适用范围
  • 流程中的元素.
    1. 活动名称.
    2. 匹配到活动的表单.
    3. 匹配到1个流程的邮件工具.
样例

显示一个流程实例的当前执行用户:

#process.activityInst.assign.performerUser[{assingment.processId}]#

当前用户哈希变量

名称描述
字首currentUser
描述获取当前登录的用户信息 
属性
  • #currentUser.id#
  • #currentUser.username#
  • #currentUser.firstName#
  • #currentUser.lastName#
  • #currentUser.email#
  • #currentUser.active#
  • #currentUser.timeZone#

在Joget企业版中,这些附加属性是可用的: -

用户元

  • #currentUser.meta.KEY#
    To read additional user meta data stored in dir_user_meta table.
    Example: #currentUser.meta.duration#.
    Image Added

    Panel
    borderColorpurple
    borderWidth1
    titleBGColor#ddccff
    borderStylesolid
    titleNew Feature

    This is a new feature in Joget Workflow v6.

组织

  • #currentUser.organization.id#
  • #currentUser.organization.name#
  • #currentUser.organization.description#

  • #currentUser.department.id#
  • #currentUser.department.name#
  • #currentUser.department.description#
  • #currentUser.department.treeStructure#

年级

  • #currentUser.grade.id#
  • #currentUser.grade.name#
  • #currentUser.grade.description#
  • #currentUser.grade.organizationId#

HOD

  • #currentUser.hod.username#
  • #currentUser.hod.firstName#
  • #currentUser.hod.lastName#
  • #currentUser.hod.email#
  • #currentUser.hod.active#
  • #currentUser.hod.timeZone#

  • #currentUser.groups.id#
  • #currentUser.groups.name#

雇用

  • #currentUser.employee.code#
  • #currentUser.employee.jobTitle#
  • #currentUser.employee.isHod#

HOD部门

  • #currentUser.department.hod.username#
  • #currentUser.department.hod.firstName#
  • #currentUser.department.hod.lastName#
  • #currentUser.department.hod.email#
  • #currentUser.department.hod.active#
  • #currentUser.department.hod.timeZone#
使用范围
  • 应用程序中的所有组件

日期哈希变量  

名称描述
字首date
描述

根据指定的格式获取 日期时间

Info
titleLocalization

在Joget Workflow v5中,返回的值将跟随当前登录用户的时区。如果用户的信息不可用,那么它将使用服务器的时区。

属性
  • #date.dateFormat#  
  • #date.dateUnit [+ - ] integerValue.dateFormat #

    Info
    titleOptions

    日期格式

    • Java日期格式:例如, yyyy-MM-dd 代表 2011-06-01

    dateUnit

    • YEAR
    • MONTH
    • DAY  

    integerValue

    • 数字整数值。例如10
  • #date.DATE_FORMAT_TO[INPUT_DATE_VALUE | INPUT_VALUE_FORMAT]#

    Info

    INPUT_DATE_VALUE 接受任何日期值,甚至嵌套的哈希变量,例如:表单数据哈希变量。请参见下面属性的示例。

    INPUT_VALUE_FORMAT INPUT_DATE_VALUE 原始格式.

    DATE_FORMAT_TO 定义要更改的格式.

    Panel
    borderColorpurple
    borderWidth1
    titleBGColor#ddccff
    borderStylesolid
    titleNew Feature

    这是 Joget Workflow v6 新功能

 

使用范围
  • 应用程序中的所有组件。
示例属性
#date.h:mm a#  // 12:08 PM
#date.EEE,d MMM yyyy h:mm:ss a#  // Wed, 4 Jul 2014 12:08:56 PM
#date.DAY+7.EEE,d MMM yyyy h:mm:ss a#  // Add 7 days on top of current date time - Wed, 11 Jul 2014 12:08:56 PM
#date.DAY-1.EEE,d MMM yyyy h:mm:ss a#  // Minus 1 days on top of current date time - Wed, 3 Jul 2014 12:08:56 PM
#date.dd-MM-yyyy[{form.j_expense_claim.title}|yyyy-MM-dd]# // Retrieves date from j_expense_claim table, form field title, changes its origin format of yyyy-MM-dd to dd-MM-yyyy.

环境变量哈希变量  

名称描述
字首envVariable
描述

检索环境变量值。了解有关环境变量的更多信息。    

属性
  • #envVariable.keyName#  
使用范围
  • 在Joget应用程序本身的任何地方。(即流程,流程工具,表单,列表,用户视图)
示例属性#envVariable.smtpServer#
#envVariable.smtpPort#

表单数据哈希变量  

名称描述
字首form
描述

表单(数据表)中 获取 字段值  

属性
  • #from.tableName.fieldId#    
  • #from.tableName.fieldId [ recordId ]#(3.1以上版本)      
使用范围
  • 在Process中的Process Tool部分。
  • 在表单中。
  • 在流程设计中。
示例属性#form.registration.registeredDate# //will use the current record ID
#form.registration.registeredDate[ 0001 ]# //registration 表中ID为0001的registeredDate值
#form.registration.registeredDate[{variable.recordId}]# //采用嵌套哈希变量获取表单值.

表单绑定哈希变量

Panel
borderColorpurple
borderWidth1
titleBGColor#ddccff
borderStylesolid
titleNew Feature

这是 Joget Workflow v6 新功能

名称描述
首字binder
描述

通过 表单定义ID 获取 字段值 或 字段值标签 To get field value or field value label from the binder of a form via its form definition id .

前缀为 'binder' 代表获取字段值, 而 'binder.options' 代表获取选项标签 (eg. select box, checkbox & radio button).

也可以通过加入 APP_ID 跨应用获取 字段值 或字段标签, 否则默认获取当前应用的值.

通过 PRIMARY_KEY , 可以获取指定记录的 字段值 字段标签 .

属性
  • #binder.APP_ID.FORM_DEF_ID.FIELD_ID#
  • #binder.APP_ID.FORM_DEF_ID.FIELD_ID[PRIMARY_KEY]#
  • #binder.FORM_DEF_ID.FIELD_ID#
  • #binder.FORM_DEF_ID.FIELD_ID[PRIMARY_KEY]#
  • #binder.options.APP_ID.FORM_DEF_ID.FIELD_ID#
  • #binder.options.APP_ID.FORM_DEF_ID.FIELD_ID[PRIMARY_KEY]#
  • #binder.options.FORM_DEF_ID.FIELD_ID#
  • #binder.options.FORM_DEF_ID.FIELD_ID[PRIMARY_KEY]#
适用范围
  • 在流程工具中.
  • 在表单中.
  • 在流程设计中.
样例

#binder.addCard.title#

#binder.cardViewer.addCard.title#

#binder.cardViewer.addCard.title[b30bce20-c0a82095-14976e70-fded1735]#

#binder.options.addCard.title#

#binder.options.cardViewer.addCard.title#

#binder.options.cardViewer.addCard.title[b30bce20-c0a82095-14976e70-fded1735]#

应用定义哈希变量

Panel
borderColorpurple
borderWidth1
titleBGColor#ddccff
borderStylesolid
titleNew Feature

这是 Joget Workflow v6 新功能

名称描述
首字appDef
说明

To retrieve App Definition information

属性
  • #appDef.appId#

  • #appDef.dateCreated#

  • #appDef.dateModified#

  • #appDef.version#

  • #appDef.license#

  • #appDef.name#

  • #appDef.published#

适用范围
  • 所有应用组件.
样例

显示应用名称:

#appDef.name#

应用消息哈希变量(国际化)  

名称描述
字首i18n
描述

在应用程序级别支持语言本地化。

属性
  • #i18n. keyName #
使用范围
  • 应用程序中的所有组件。
示例属性

#i18n.logout#

Image Added

请参阅 添加消息

执行者哈希变量  

名称描述
字首performer
描述

获取活动执行者用户信息

属性
  • #performer. activityDefId .id#
  • #performer. activityDefId .username#
  • #performer. activityDefId .firstName#
  • #performer. activityDefId .lastName#
  • #performer. activityDefId .email#
  • #performer. activityDefId .active#
  • #performer. activityDefId .timeZone#
使用范围
  • 过程中的元素和部分。
    1. 活动名称。
    2. 表单映射为流程活动映射的一部分。
    3. 电子邮件工具配置作为过程工具映射的一部分
Info

要获取activityDefId(活动定义ID),请在“活动映射”选项卡(工作流程管理控制台)中将活动名称鼠标悬停; 会有覆盖显示ID。

Warning

所选择的活动必须已经执行。

示例属性
  • #performer.runProcess.firstName#
  • #performer.submitLeave.firstName#

请求参数哈希变量  

名称描述
字首requestParam
描述

访问请求参数的值。

属性
  • #requestParam.parameterName [分隔符]#
  • 如果在具有多个值的数据列表过滤器中使用requestParam,则可以指示分隔符(, 或 ;),以便在数据输出中定义分隔符。如果在多个值的情况下不指定分隔符则使用逗号“,”作为默认值。
使用范围
  • 应用程序中的所有组件。
示例属性
  • #requestParam.key#可以专门用于获取 UserView Key值
  • #requestParam.name[;]#表示“name”变量将存储以分号分隔的多个值。例如,这个SQL语句“select * from expenses where title in(#requestParam.title[,]#)”将被转换为“select * from(where a,b,c)中的标题”以满足多个值在“where-in”声明中。
  • 在用户视图页面中,可以访问以下属性。
    • #requestParam.key#
    • #requestParam.userviewId#
    • #requestParam.menuId#
    • #requestParam.appId#

用户哈希变量  

名称描述
字首user
描述

要根据用户名获取用户信息  

属性
  • #user. username .id#
  • #user. username .username#
  • #user. username .firstName#
  • #user. username .lastName#
  • #user. username .email#
  • #user. username .active#
  • #user. username .timeZone#

在Joget企业版中,这些附加属性是可用的: -

用户元

  • #user. username .meta.KEY#  (v6)

组织

  • #user. username .organization.id#
  • #user. username .organization.name#
  • #user. username .organization.description#

  • #user. username  .department.id#  
  • #user. username  .department.name#  
  • #user. username  .department.description#  
  • #user. username  .department.treeStructure#  

岗级

  • #user. username  .grade.id#  
  • #user. username  .grade.name#  
  • #user. username  .grade.description#  
  • #user. username  .grade.organizationId#  

HOD(部门负责人)

  • #user. username  .hod.username#  
  • #user. username  .hod.firstName#  
  • #user. username  .hod.lastName#  
  • #user. username  .hod.email#  
  • #user. username  .hod.active#  
  • #user. username  .hod.timeZone#  

雇用

  • #user. username  .employee.code#  
  • #user. username  .employee.jobTitle#  
  • #user. username  .employee.isHod#  

部门HOD

  • #user. username  .department.hod.username#  
  • #user. username  .department.hod.firstName#  
  • #user. username  .department.hod.lastName#  
  • #user. username  .department.hod.email#  
  • #user. username  .department.hod.active#  
  • #user. username  .department.hod.timeZone#  
使用范围
  • 应用程序中的所有组件。
示例属性
  • #user.admin.email#
  • #user.cat.firstName#
  • #user.{requestParam.username} .email#检索通过url参数传递的用户的电子邮件地址

Userview Key哈希变量  

名称描述
字首userviewKey
描述

用户视图密钥散列变量仅用于访问当前用户 Userview Key

这个哈希变量的典型用例是:

  • 数据列表 基于用户视图的关键字段。
  • 在基于UserView Key 的过程流程表单表单分区预加载某些表单数据字段(例如子表单)。
属性
  • #userviewKey#
使用范围

工作流变量哈希变量

名称描述
字首variable
描述

在Process Flow中获取工作流程变量

属性
  • #variable.variableName#  
使用范围
  • 过程中的元素和部分。
    1. 活动名称。
    2. 表单映射为流程活动映射的一部分。
    3. 电子邮件工具配置作为过程工具映射的一部分
示例属性#variable.approvalStatus#

请求哈希变量

名称描述
字首request
描述

从页面视图的当前  HttpServletRequest对象获取值   

属性
  • #request.characterEncoding#
  • #request.contextPath#
  • #request.header.NAME# , NAME  是客户化 header 名称.
  • #request.locale#
  • #request.method#
  • #request.pathInfo#
  • #request.protocol#
  • #request.queryString#
  • #request.remoteAddr#
  • #request.requestURI#
  • #request.requestURL#
  • #request.requestedSessionId#
  • #request.scheme#
  • #request.serverName#
  • #request.serverPort#
  • #request.servletPath#

 

使用范围
  • App中的所有组件都有有效的HttpServletRequest对象。这样的对象不能在后台活动中使用,例如由于截止时间而触发的过程工具  
示例属性

Image Added

要检索上面屏幕截图中的“Referer”标题属性值,可以使用下面的散列变量。

Code Block
titleHash Variable
#request.header.Referer#

平台哈希变量

Panel
borderColorred
borderWidth1
titleBGColor#ffcccc
borderStylesolid
titleNew Feature

这是Joget Workflow v6中的一个新功能。

名称描述
字首platform
描述获取当前平台的信息。  
属性
  • #platform.name#

  • #platform.version#

  • #platform.jdbcDriver#

  • #platform.setting.dataFileBasePath#

  • #platform.setting.deadlineCheckerInterval#

  • #platform.setting.defaultUserview#

  • #platform.setting.fileSizeLimit#

  • #platform.setting.landingPage#

  • #platform.setting.systemDateFormat#

  • #platform.setting.systemLocale#

  • #platform.setting.systemTimeZone# 

在Joget企业版中,以下属性可用:

  • #platform.license.name#

  • #platform.license.holder#

  • #platform.license.users#

  • #platform.license.appLimit#

  • #platform.license.expiry#

  • #platform.license.activated#

  • #platform.systemKey#

使用范围
  • 应用程序中的所有组件。

多用户哈希变量

Panel
borderColorpurple
borderWidth1
titleBGColor#ddccff
borderStylesolid
titleNew Feature

这是Joget Workflow v6新功能

名称描述
首字users
描述获取指定用户组,岗级,部门,组织的用户,以 “;” 分隔. 
属性
  • #users.group.GROUP_ID.username#

  • #users.group.GROUP_ID.firstName#

  • #users.group.GROUP_ID.lastName#

  • #users.group.GROUP_ID.fullName#

  • #users.group.GROUP_ID.email#

  • #users.grade.GRADE_ID.username#

  • #users.grade.GRADE_ID.firstName#

  • #users.grade.GRADE_ID.lastName#

  • #users.grade.GRADE_ID.fullName#

  • #users.grade.GRADE_ID.email#

  • #users.department.DEPARTMENT_ID.username#

  • #users.department.DEPARTMENT_ID.firstName#

  • #users.department.DEPARTMENT_ID.lastName#

  • #users.department.DEPARTMENT_ID.fullName#

  • #users.department.DEPARTMENT_ID.email#

  • #users.organization.ORGANIZATION_ID.username#

  • #users.organization.ORGANIZATION_ID.firstName#

  • #users.organization.ORGANIZATION_ID.lastName#

  • #users.organization.ORGANIZATION_ID.fullName#

  • #users.organization.ORGANIZATION_ID.email#

适用范围
  • 所有应用组件.
样例

获取当前用户所在用户组的所有用户:

Bean Shell哈希变量

...

Panel
borderColorpurple
borderWidth1
titleBGColor#ddccff
borderStylesolid
titleNew Feature

This is a new feature in Joget Workflow v6.

这是Joget Workflow v6中的一个新功能。

All components within the App.
名称描述
字首BeanShell
描述使用环境变量来执行bean shell脚本。使用URL查询字符串语法传递参数。
属性
NameDescription
Prefixbeanshell
DescriptionUsing environment variable to execute bean shell script. Passing parameter using URL query string syntax.
Attributes
  • #beanshell.ENVIRONMENT_VARIABLE#

  • #beanshell.ENVIRONMENT_VARIABLE#VARIABLE [PARAMETERS_URL_QUERY_STRING]#

 
适用范围ScopeofUse
  • 应用程序中的所有组件
示例

使用参数 “username” 和 “dept” 执行存储在“welcome”环境变量中的脚本:

Sample Attributes

To execute a script stored in "welcome" environment variable with parameter "username" and "dept":

Code Block
languagejava
if (username != null && username.length == 1 && !username[0].isEmpty()) {
       return "Welcome " + username[0] + " (" + dept[0] + "),";
} else {
       return "";
}
 
  • #beanshell.welcome[username={currentUser.username}&dept={currentUser.department.name}]#