Table of Contents | ||||
---|---|---|---|---|
|
...
ตัวแปรแฮช คืออะไร ?
Panel | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
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 :
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
A Hash Variable can be used inside another Hash Variable to form a Nested Hash Variable.
ตัวแปรแฮชช่วยให้ผู้ใช้มีความยืดหยุ่นและอิสระมากขึ้นในการเข้าถึงข้อมูลที่เป็นประโยชน์หรือค่าที่เกี่ยวข้องเวลาการทำงานของระบบ ตัวแปรแฮชเป็นคีย์หลักพิเศษที่สามารถใช้ได้ใน :
เพื่อกลับค่าของตัวแปรรันไทม์ที่มีประโยชน์บางอย่างจากส่วนประกอบ Joget |
Tip |
---|
เพื่อความสะดวกในการเข้าถึงรายการของตัวแปรแฮช ทั้งหมดที่มีอยู่ให้ใช้ทางลัด Ctrl-Shift-3 ในส่วนประกอบข้างต้น |
Tip |
---|
ดาวน์โหลดแอพช่วยสอน Hash Variables จาก Joget Workflow Marketplace เพื่อเรียนรู้เพิ่มเติมเกี่ยวกับตัวแปรแฮช |
ตัวแปรแฮช ที่ซ้อนกัน (Nested Hash Variable)
ตัวแปรแฮช สามารถใช้ภายใน ตัวแปรแฮช อื่นเพื่อสร้าง ตัวแปรแฮช ที่ซ้อนกัน
ไวยากรณ์สำหรับตัวแปรแฮช ภายในถูกคลุมด้วยคู่ของวงเล็บ { ปีกกา }The syntax for the inner Hash Variable is wrapped by a pair of {curly bracket}.
Code Block | ||||
---|---|---|---|---|
| ||||
#prefix.{prefix.variableKey}# |
Code Block | ||
---|---|---|
| ||
#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 - ใช้เพื่อเลี่ยงตัวอักขระพิเศษของ JSON
- javascript - ใช้เพื่อเลี่ยงตัวอักขระพิเศษของ Javascript
- html - ใช้เพื่อเลี่ยงตัวอักขระพิเศษของ HTML
- xml - ใช้เพื่อเลี่ยงตัวอักขระพิเศษของ XML
- java - ใช้เพื่อเลี่ยงตัวอักขระพิเศษของ Java
- sql - ใช้เพื่อเลี่ยงตัวอักขระพิเศษของ SQL
- url - ใช้เพื่อเลี่ยงตัวอักขระพิเศษของ URL
- nl2br - ใช้เพื่อแปลงอักขระบรรทัดใหม่เป็นแท็ก HTML < br >
- regex - Used to escape regular expression special characters
- json - Used to escape JSON special characters
- javascript - Used to escape Javascript special characters
- html - Used to escape HTML special characters
- xml - Used to escape XML special characters
- java - Used to escape Java special characters
- sql - Used to escape SQL special characters
- url - Used to escape URL special characters
- nl2br - Used to convert new line character to <br> HTML tag
- separator(SEPARATOR_CHARS) - Used to change the default separator ใช้เพื่อเปลี่ยนตัวคั่นเริ่มต้น ";" to the SEPARATOR เป็น SEPARATOR_CHARS. eg. ?separatorตัวคั่น(, ) resulted ส่งผลให้ "abc, def" instead of แทนที่เป็น "abc;def".
Code Block | ||
---|---|---|
| ||
#envVariable.script?java# #envVariable.script?nl2br;json# #form.table.users?separator(, )# |
Panel | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
nl2br and separator are new features in nl2br และตัวคั่นเป็นคุณลักษณะใหม่ใน Joget Workflow v6. |
รายการของตัวแปรแฮช (List of Hash Variables)
Table of Contents minLevel 2 absoluteUrl true
ตัวแปรแฮช ของการกำหนดลำดับงาน (Workflow Assignment Hash Variable)
Panel | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
New attributes added in Joget เป็นแอตทริบิวต์ใหม่ที่เพิ่มใน Joget Workflow v6.
|
Nameชื่อ | Descriptionคำอธิบาย | ||
---|---|---|---|
Prefix | assignment | ||
Description | To get workflow activity information of the current assignment.หากต้องการรับข้อมูลกิจกรรมลำดับงานของการมอบหมายปัจจุบัน | ||
Attributes |
| ||
Scope of Use |
|
| |
Sample Attributes | แสดงชื่อของผู้ใช้ | Sample Attributes | To display the assignee's name: #user.{assignment.assigneeId}.firstName# #user.{assignment.assigneeId}.lastName# |
ตัวแปรแฮช การลำดับงานของกระบวนการ (Workflow Process Hash Variable)
Panel | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
This is a new feature in นี่คือฟีเจอร์ใหม่ใน Joget Workflow v6. |
Nameชื่อ | Descriptionคำอธิบาย | ||
---|---|---|---|
Prefix | process | ||
Description | To retrieve information of a workflow process instance.เพื่อเรียกข้อมูลของอินสแตนซ์กระบวนการลำดับงาน | ||
Attributes |
| ||
Scope of Use |
|
| |
Sample Attributes | เพื่อแสดงชื่อผู้ใช้ของอินสแตนซ์กิจกรรมของอินสแตนซ์ของกระบวนการ | Sample Attributes | To display the performer username of an activity instance of a process instance : #process.activityInst.assign.performerUser[{assingment.processId}]# |
ตัวแปรแฮช ของผู้ใช้ปัจจุบัน (Current User Hash Variable)
Nameชื่อ | Descriptionคำอธิบาย | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Prefix | currentUser | ||||||||||||||
Description | To retrieve currently logged in user information. ในการเรียกข้อมูลผู้ใช้ที่บันทึกไว้ในปัจจุบัน | ||||||||||||||
Attributes |
In ใน Joget Enterprise edition, these additional attributes are available แอตทริบิวต์เพิ่มเติมเหล่านี้จะสามารถใช้งาน::- User Meta
องค์กร (Organization)Organization
แผนก (Department)
ระดับ (Grade)
HOD
กลุ่ม (Group)
พนักงาน (Employment)
แผนก HOD (Department HOD)
| ||||||||||||||
Scope of Use |
|
ตัวแปรแฮช ของวันที่ (Date Hash Variable
...
)
Nameชื่อ | Descriptionคำอธิบาย | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Prefix | date | |||||||||||||||||||||
Description | To get date time according to a specified format.หากต้องการรับเวลาวันที่ตามรูปแบบที่ระบุ
| |||||||||||||||||||||
Attributes | Attributes |
| ||||||||||||||||||||
Scope of Use |
| |||||||||||||||||||||
Sample Attributes | #date.h:mm a# // shows current time of 12 แสดงเวลาปัจจุบัน 12:08 PM #date.EEE,d MMM yyyy h:mm:ss a# // shows current date time of แสดงวันที่ปัจจุบัน 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 เพิ่ม 7 วันจากวันที่ปัจจุบัน - 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 ลบ 1 วันของวันที่ปัจจุบัน - 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. |
ตัวแปรแฮช ของตัวแปรแวดล้อม (Environment Variable Hash Variable
...
)
Name | Description |
---|---|
Prefix | envVariable |
Description | To retrieve Environment Variable value. Learn more about Environment Variables .เพื่อดึงค่าของ ตัวแปรแวดล้อม เรียนรู้เพิ่มเติมเกี่ยวกับ ตัวแปรแวดล้อม (Environment Variable) |
Attributes |
|
Scope of Use |
|
Sample Attributes | #envVariable.smtpServer# #envVariable.smtpPort# |
ตัวแปรแฮช ของข้อมูลฟอร์ม (Form Data Hash
...
Variabl)
Name | Description | ||
---|---|---|---|
Prefix | form | ||
Description | To get field value from form table.การเรียกค่าเขตข้อมูลจากตารางแบบฟอร์ม | ||
Attributes |
| ||
Scope of Use |
|
| |
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. |
ตัวแปรแฮช ของแบบฟอร์ม Binder (Form Binder Hash Variable)
Panel | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
This is a new feature in นี่คือฟีเจอร์ใหม่ใน Joget Workflow v6. |
Nameชื่อ | Descriptionคำอธิบาย |
---|---|
Prefix | binder |
Description | จะได้รับ ค่าฟิลด์หรือป้ายชื่อเขตข้อมูลจากตัวยึดของฟอร์มผ่านทางรหัสข้อกำหนดฟอร์ม คำนำหน้า 'binder' จะดึงค่าฟิลด์ในขณะที่คำนำหน้า To get field value or field value label from the binder of a form via its form definition id . The 'binder' prefix retrieves the field value, while the 'binder.options' prefix retrieves the lookup field (eg. select box, checkbox & radio button) option label. The field value or field value label can also be obtained from other apps by including the APP_ID, else it uses the current app context. จะดึงข้อมูลการค้นหา (เช่น กล่องเลือกช่องทำเครื่องหมาย & ปุ่มเรดิโอ) นอกจากนี้ยังสามารถรับค่าของเขตข้อมูลหรือชื่อของเขตข้อมูลจากแอปอื่นๆได้โดยรวมถึง APP_ID ซึ่งจะใช้บริบทของแอปปัจจุบัน โดยการให้อาร์กิวเมนต์ PRIMARY_KEY ค่าฟิลด์หรือชื่อเขตข้อมูลจากระเบียนอื่นสามารถเรียกข้อมูลอื่นจากรหัสเรกคอร์ดปัจจุบันจะถูกเรียกแทนBy providing the PRIMARY_KEY argument, field value or field value label from a different record can be retrieved, else data from the current record id is retrieved instead. |
Attributes |
|
Scope of Use |
|
Sample Attributes | #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]# |
ตัวแปรแฮชของข้อกำหนดของแอป (App Definition Hash Variable)
Panel | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
This is a new feature in Joget นี่คือฟีเจอร์ใหม่ใน Joget Workflow v6. |
Nameชื่อ | Descriptionคำอธิบาย |
---|---|
Prefix | appDef |
Description | To retrieve App Definition information การเรียกข้อมูลข้อกำหนดของแอป |
Attributes |
|
Scope of Use |
|
Sample AttributesAttributes | หากต้องการแสดงชื่อข้อกำหนดของแอปTo display the app definition name: #appDef.name# |
ตัวแปรแฮชข้อความของแอป (App Message Hash Variable) (Internationalization)
ชื่อ | คำอธิบาย |
---|---|
Prefix | i18n |
Description | เพื่อสนับสนุนการแปลภาษาในระดับแอพลิเคชัน |
Attributes |
|
Scope of Use |
|
Sample Attributes | #i18n.logout# |
Example | โปรดดูที่ Add Message. |
ตัวแปรแฮชของผู้กระทำ (Performer Hash Variable )
ชื่อ | คำอธิบาย | ||||
---|---|---|---|---|---|
Prefix | performer | ||||
Description | เพื่อรับข้อมูลผู้ใช้ของผู้กระทำของกิจกรรม | ||||
Attributes |
| ||||
Scope of Use |
| ||||
Sample Attributes |
|
ตัวแปรแฮชของการร้องขอพารามิเตอร์ (Request Parameter Hash Variable)
ชื่อ | คำอธิบาย |
---|---|
Prefix | requestParam |
Description | ในการเข้าถึงค่าของการร้องขอพารามิเตอร์ |
Attributes |
|
Scope of Use |
|
Sample Attributes |
|
ตัวแปรแฮชของผู้ใช้ (User Hash Variable)
ชื่อ | คำอธิบาย |
---|---|
Prefix | user |
Description | เพื่อรับข้อมูลผู้ใช้โดยอิงจาก username. |
Attributes |
ใน Joget Enterprise edition แอตทริบิวต์เพิ่มเติมเหล่านี้จะพร้อมใช้งาน:- User Meta
Organization
Department
Grade
HOD
Group
Employment
Department HOD
|
Scope of Use |
|
Sample Attributes |
|
ตัวแปรแฮชของ Userview Key (Userview Key Hash Variable)
ชื่อ | คำอธิบาย |
---|---|
Prefix | userviewKey |
Description | ตัวแปรแฮชของ Userview Key ถูกใช้เพื่อวัตถุประสงค์ในการเข้าถึง Userview key's value ปัจจุบันเท่านั้น กรณีการใช้งานทั่วไปสำหรับตัวแปร hash นี้คือ:-
|
Attributes |
|
Scope of Use |
ตัวแปรแฮชของตัวแปรเวิร์กโฟลว์ (Workflow Variable Hash Variable)
ชื่อ | คำอธิบาย |
---|---|
Prefix | variable |
Description | เพื่อรับค่าของตัวแปรเวิร์กโฟลว์ใน Process Flow |
Attributes |
|
Scope of Use |
|
Sample Attributes | #variable.approvalStatus# |
Request Hash Variable
Nameชื่อ | Descriptionคำอธิบาย | |||||
---|---|---|---|---|---|---|
Prefix | request | |||||
Description | To get the value from the current HttpServletRequest object of the page view.เพื่อรับค่าจากวัตถุ HttpServletRequest ปัจจุบันของมุมมองเพจ | |||||
Attributes |
| |||||
Scope of Use |
| Scope of Use |
| |||
Sample Attributes | To retrieve the เมื่อต้องการดึงค่าแอตทริบิวต์ส่วนหัว "Referer" header attribute value in the screenshot above, one may use the following hash variable.อ้างถึง" ในภาพหน้าจอด้านบนหนึ่งอาจใช้ตัวแปร hash ต่อไปนี้
|
ตัวแปรแฮชของแพลตฟอร์ม (Platform Hash Variable)
Panel | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
This is a new feature in นี่คือฟีเจอร์ใหม่ใน Joget Workflow v6. |
Nameชื่อ | Descriptionคำอธิบาย |
---|---|
Prefix | platform |
Description | To retrieve platform specific information. เพื่อเรียกข้อมูลเฉพาะแพลตฟอร์ม |
Attributes |
In ใน Joget Enterprise edition , these additional attributes are available แอตทริบิวต์เพิ่มเติมเหล่านี้จะพร้อมใช้งาน:-
|
Scope of Use |
|
ตัวแปรแฮชของผู้ใช้ (Users Hash Variable)
Panel | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
This is a new feature in นี่คือฟีเจอร์ใหม่ใน Joget Workflow v6. |
Nameชื่อ | Descriptionคำอธิบาย | ||
---|---|---|---|
Prefix | users | ||
DescriptionTo | retrieve information of all the users in the selected group, grade, department and organization. Multiple results will be separated by semicolon. เพื่อดึงข้อมูลของผู้ใช้ทั้งหมดในกลุ่ม, เกรด, แผนกและองค์กรที่เลือก ผลลัพธ์หลายจะถูกคั่นด้วยเครื่องหมายอัฒภาค | ||
Attributes |
| ||
Scope of Use |
|
| |
Sample Attributes | หากต้องการส่งคืนผู้ใช้ทั้งหมดในรหัสกลุ่มของผู้ใช้ปัจจุบัน | Sample Attributes | To return all the users in the current user's groups id:
|
ตัวแปรแฮชของ Bean Shell (Bean Shell Hash Variable)
Panel | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
This is a new feature in นี่คือฟีเจอร์ใหม่ใน Joget Workflow v6. |
Nameชื่อ | Descriptionคำอธิบาย | |||||
---|---|---|---|---|---|---|
Prefix | beanshell | |||||
DescriptionUsing | environment variable to execute bean shell script. Passing parameter using URL query string syntax.การใช้ตัวแปรสภาพแวดล้อมเพื่อรันสคริปต์ Bean Shell ส่งผ่านพารามิเตอร์โดยใช้ไวยากรณ์สตริงค้นหา URL | |||||
Attributes |
| |||||
Scopeof Use |
| |||||
Sample Attributes | To execute a script stored in "welcome" environment variable with parameter การเรียกใช้สคริปต์ที่เก็บไว้ใน "ยินดีต้อนรับ"ตัวแปรสภาพแวดล้อมที่มีพารามิเตอร์ "username" and และ "dept":
|
...