Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Joget Workflow v4 Training - Module 9 - Hash Variable

1,688 views

Published on

This is the complete listing of available modules.
1 - Introduction to Joget Workflow
2 - Setting up Joget Workflow
3 - Designing your first Process on Joget Workflow
4 - Localizing your Joget Workflow
5 - Designing your first Form on Joget Workflow
6 - Using your first Process Tool – Email
7 - Designing your first Datalist on Joget Workflow
8 - Designing your first Userview on Joget Workflow
9 - Hash Variable
10 - Permission Control
11 - SLA and Deadlines
12 - Version Control
13 - Improving your Form design and Presentation
14 - Introduction to Reporting
15 - Introduction to Plugin Architecture
16 - Preparing Development Environment
17 - Building a Plugin
18 - Integrating with External System
19 - Doing more with your Process Design
20 - Basic System Administration
21 - Userview Key
22 - Best Practices on Application Building -

You may checkout the training screencast of this training at http://www.joget.org/joget-workflow-v4-training/

Published in: Software
  • Be the first to comment

Joget Workflow v4 Training - Module 9 - Hash Variable

  1. 1. All Rights Reserved © Joget Inc Joget Workflow v4 Hash Variable http://facebook.com/jogetworkflow http://twitter.com/jogetworkflow Last Revised on March 2015Joget Inc Internal Use Only
  2. 2. All Rights Reserved © Joget Inc Prerequisites • General understanding on how to design an App using the Joget platform (i.e. Process, Form, Datalist, Userview). Joget Inc Internal Use Only
  3. 3. All Rights Reserved © Joget Inc Content 1. Introduction to Hash Variable 2. List of Hash Variable and its usages 3. Nested Hash Variable Joget Inc Internal Use Only
  4. 4. All Rights Reserved © Joget Inc Chapter 1 Introduction to Hash Variable Joget Inc Internal Use Only
  5. 5. All Rights Reserved © Joget Inc What is Hash Variable? • Hash Variable != Workflow Variable • 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 value of some useful runtime variables from Workflow Engine Joget Inc Internal Use Only
  6. 6. All Rights Reserved © Joget Inc Hash Variable • Each Hash Variable element has its own prefix. Eg.: – #date.D-MMM-yyyy# – #form.leave_applications.name# – #variable.status# – #i18n.smtpServer# • A new Hash Variable (with it’s own unique prefix) can be built through Joget’s plugin architecture. Joget Inc Internal Use Only
  7. 7. All Rights Reserved © Joget Inc Plugin Types Joget Workflow Form Builder Datalist Builder Workflow Engine Userview Builder - APP - Form Builder • Form Element • Form Permission • Form Load Binder • Form Options Binder • Form Store Binder • Form Validator Workflow Engine • Deadline • Process Participant • Process Tool Datalist Builder • Datalist Action • Datalist Binder • Datalist Column Formatter • Datalist Filter Type Userview Builder • Userview Menu • Userview Permission • Userview Theme App Level • Audit Trail • Hash Variable System Level • Directory Manager Joget Inc Internal Use Only
  8. 8. All Rights Reserved © Joget Inc Chapter Review • Brief understanding on the purpose that Hash Variable serves. Joget Inc Internal Use Only
  9. 9. All Rights Reserved © Joget Inc Chapter 2 List of Hash Variables and its usages Joget Inc Internal Use Only
  10. 10. All Rights Reserved © Joget Inc Ever Wonder… • How to display requestor’s full name in a form? Joget Inc Internal Use Only
  11. 11. All Rights Reserved © Joget Inc Ever Wonder… • How to display requestor’s full name in task / activity name? Joget Inc Internal Use Only
  12. 12. All Rights Reserved © Joget Inc List of Hash variables • Performer • Internationalization • Request Parameter • Environment Variable • Current User • User • Assignment • Form • Workflow Variable • Date Joget Inc Internal Use Only
  13. 13. All Rights Reserved © Joget Inc Performer Hash Variable • 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# • Reference: http://dev.joget.org/community/display/KBv4/Performer+Hash+Variable Joget Inc Internal Use Only
  14. 14. All Rights Reserved © Joget Inc Using #performer Hash Variable #performer.facilities_request.username# Joget Inc Internal Use Only
  15. 15. All Rights Reserved © Joget Inc Using #performer Hash Variable in Form Builder Joget Inc Internal Use Only Hash Variable can be used in Form Title, Section Title, Form Element
  16. 16. All Rights Reserved © Joget Inc Using #performer Hash Variable in Workflow Designer Joget Inc Internal Use Only #performer.leave_approval_act1.username#
  17. 17. All Rights Reserved © Joget Inc Using #performer Hash Variable in Plugin Configuration Joget Inc Internal Use Only In Email Plugin, Hash Variables are supported in From, To (specific email address), CC, Subject and Message fields.
  18. 18. All Rights Reserved © Joget Inc Internationalization Hash Variable • Internationalization support on application – Support language localization on application level. • #i18n.keyName# • Reference: http://dev.joget.org/community/display/KBv4/Internationalization+Hash +Variable Joget Inc Internal Use Only
  19. 19. All Rights Reserved © Joget Inc Using #i18n in Userview Builder • The #i18n Hash Variable retrieves values from the Message set of the App. • E.g. Message with key app.hello in 2 locales (en_US, zh_CN) Joget Inc Internal Use Only
  20. 20. All Rights Reserved © Joget Inc Using #i18n in Userview Builder • With the key defined, the hash variable can be used in the Userview Builder to dynamically show corresponding value depending on the user’s locale. Joget Inc Internal Use Only
  21. 21. All Rights Reserved © Joget Inc Request Parameter Hash Variable • Request Parameter – For accessing request parameters. • #requestParam.parameterName# • Reference: http://dev.joget.org/community/display/KBv4/Request+Parameters+Hash +Variable Joget Inc Internal Use Only
  22. 22. All Rights Reserved © Joget Inc Using #requestParam in Form Builder • Useful to prepopulate form field Joget Inc Internal Use Only
  23. 23. All Rights Reserved © Joget Inc Environment Variable Hash Variable • Environment Variable – Application level environment variable is typically used to store common or re-usable values such as Email server settings. • #envVariable.keyName# • Reference: http://dev.joget.org/community/display/KBv4/Environment+Variable+Has h+Variable Joget Inc Internal Use Only
  24. 24. All Rights Reserved © Joget Inc Using #envVariable in Email Tool • Use Environment Variable on Email Tool to ease maintenance. Joget Inc Internal Use Only
  25. 25. All Rights Reserved © Joget Inc Current User Hash Variable • Current User – Retrieve currently logged in user information. • #currentUser.id#, • #currentUser.username#, • #currentUser.firstName#, • #currentUser.lastName#, • #currentUser.email#, • #currentUser.active#, • #currentUser.timeZone# • Reference: http://dev.joget.org/community/display/KBv4/Current+User+Hash+Variable Joget Inc Internal Use Only
  26. 26. All Rights Reserved © Joget Inc Using #currentUser on Form Builder • Prepopulate applicant’s name in Form Joget Inc Internal Use Only
  27. 27. All Rights Reserved © Joget Inc User Hash Variable • User – 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# • Reference: http://dev.joget.org/community/display/KBv4/User+Hash+Variable Joget Inc Internal Use Only
  28. 28. All Rights Reserved © Joget Inc Using #user Hash Variables • To get user information based on the username: – #user.username.id# – #user.username.username# – #user.username.firstName# – #user.username.lastName# – #user.username.email# – #user.username.active# – #user.username.timeZone# Example: #user.admin.email# #user.cat.firstName# Joget Inc Internal Use Only
  29. 29. All Rights Reserved © Joget Inc Assignment Hash Variable • Assignment – To get workflow activity information of the current assignment. • #assignment.processId#, • #assignment.processDefId#, • #assignment.processName#, • #assignment.processVersion#, • #assignment.processRequesterId#, • #assignment.description#, • #assignment.activityId#, • #assignment.activityName#, • #assignment.activityDefId#, • #assignment.assigneeId# • Reference: http://dev.joget.org/community/display/KBv4/Assignment+Hash+Variable Joget Inc Internal Use Only
  30. 30. All Rights Reserved © Joget Inc Using #assignment on Form Builder • Retrieve current assignment information. Joget Inc Internal Use Only
  31. 31. All Rights Reserved © Joget Inc Form Hash Variable • Form – To get data from form table. – #form.formDataTableName.fieldId# – For examples: • #form.registration.registeredDate# • #form.registration.issuedDate# • #form.registration.issuedDate[0001]# – To retrieve the field value by specifying a specific record primary key value. • #form.registration.registeredDate[{variable.recordId}]# //using nested Hash Variable with curly bracket. – To achieve the same result like the previous point but by making reference to another Hash Variable for its record primary key value. Joget Inc Internal Use Only
  32. 32. All Rights Reserved © Joget Inc Using #form in Email Tool / Plugin Configuration Joget Inc Internal Use Only
  33. 33. All Rights Reserved © Joget Inc Workflow Variable Hash Variable • Workflow Variable – To get the value of a workflow variable. • #variable.variableName# Joget Inc Internal Use Only
  34. 34. All Rights Reserved © Joget Inc Using #variable Hash Variable • To get the value of a workflow variable: – #variable.variableName# Joget Inc Internal Use Only Example: #variable.status#
  35. 35. All Rights Reserved © Joget Inc Date Hash Variable • Date – To get date time according to a specified format. – For examples: • #date.h:mm a# // 12:08 PM #date.EEE, d MMM yyyy h:mm:ss a# // Wed, 4 Jul 2009 12:08:56 PM Joget Inc Internal Use Only
  36. 36. All Rights Reserved © Joget Inc Using #date Hash Variables • To get date time according to a specified format: – #date.javaSimpleDateFormat# (refer to http://download.oracle.com/javase/6/docs/api/java/text/Simpl eDateFormat.html for SimpleDateFormat) – #date.[DAY/MONTH/YEAR][+/- ]IntegerValue.javaSimpleDateFormat# Joget Inc Internal Use Only
  37. 37. All Rights Reserved © Joget Inc Using #date Hash Variables • Example: #date.EEE, d MMM yyyy h:mm:ss a# • Sample Output: Mon, 28 Dec 2009 11:27:26 AM Java SimpleDateFormat Joget Inc Internal Use Only
  38. 38. All Rights Reserved © Joget Inc Using #date Hash Variables • Example: #date.DAY+7.EEE, d MMM yyyy h:mm:ss a# • Sample Output: Mon, 4 Jan 2010 11:27:26 AM Java SimpleDateFormat+7 days Joget Inc Internal Use Only
  39. 39. All Rights Reserved © Joget Inc Using #date Hash Variables • Example: #date.MONTH-2.EEE, d MMM yyyy h:mm:ss a# • Sample Output: Wed, 28 Oct 2009 11:27:26 AM Java SimpleDateFormat-2 months Joget Inc Internal Use Only
  40. 40. All Rights Reserved © Joget Inc Using #date Hash Variables • Example: #date.YEAR+1.EEE, d MMM yyyy h:mm:ss a# • Sample Output: Tue, 28 Dec 2010 11:27:26 AM Java SimpleDateFormat+1 year Joget Inc Internal Use Only
  41. 41. All Rights Reserved © Joget Inc Chapter 3 Nested Hash Variable Joget Inc Internal Use Only
  42. 42. All Rights Reserved © Joget Inc Nested Hash Variable • Hash Variable can be used inside another Hash Variable to form a Nested Hash Variable. • The syntax for the inner and subsequent Hash Variables is wrapped by a pair of curly bracket '{' and '}' instead of the usual paif of #. • Example: #prefix.{prefix.variableKey}# • There is no limit to the depth of the nested variable. Joget Inc Internal Use Only
  43. 43. All Rights Reserved © Joget Inc Example of Nested Hash Variable • #date.{envVariable.dateFormat}# • #user.{variable.username}.firstName# • #form.tableChild.field1[{form.tableParent.childId}]# Joget Inc Internal Use Only
  44. 44. All Rights Reserved © Joget Inc Chapter Review • Appreciate the flexibility and convenience brought by the Hash Variable. • Able to apply the Hash Variable feature into application development. Joget Inc Internal Use Only
  45. 45. All Rights Reserved © Joget Inc Exercise 1. In “Submit Leave” form, pre-populate the applicant’s name using hash variable. Joget Inc Internal Use Only
  46. 46. All Rights Reserved © Joget Inc Exercise 2. In “Send Rejected Email Notification” Email Tool, compose the message as follow using hash variable. Go through the process flow to send out the test email. Dear [applicant name], Your application has been [status] due to the following reason:- [rejected reason] Thank you. Joget Inc Internal Use Only
  47. 47. All Rights Reserved © Joget Inc Exercise 3. In Inbox, instead of just showing “Approve Leave”, include the applicant’s name to the example as follow:- Joget Inc Internal Use Only
  48. 48. All Rights Reserved © Joget Inc Exercise 4. Create a new listing that will only show applications submitted by the logged in user.  Create a new Datalist Add filter criteria in “Extra Filter Condition”. – Eg. ( e.customProperties.name = 'Cat' ) – Replace ‘Cat’ with the appropriate Hash Variable  Add the created list into the existing Userview Reference: http://dev.joget.org/community/display/KBv4/Form+Data+Binder Joget Inc Internal Use Only
  49. 49. All Rights Reserved © Joget Inc Exercise 5. Make use of Environment Variable to store commonly used settings (e.g. Email configuration used in Email Tool plugin.) Reference: http://dev.joget.org/community/display/KBv4/Environment+Variables Joget Inc Internal Use Only
  50. 50. All Rights Reserved © Joget Inc Module Review 1. Introduction to Hash Variable 2. List of Hash Variable and its usages 3. Nested Hash Variable Joget Inc Internal Use Only
  51. 51. All Rights Reserved © Joget Inc Stay Connected with Joget Workflow • www.joget.org • community.joget.org • twitter.com/jogetworkflow • facebook.com/jogetworkflow • youtube.com/jogetworkflow • slideshare.net/joget Joget Inc Internal Use Only

×