joget workflow training – basic & advance for v3.1 – module 10 – hash variables

39
All Rights Reserved © Joget Inc Joget Workflow v3 Training Programme: All That You Need To Know http://facebook.com/jogetworkflow http://twitter.com/jogetworkflow Last Revised on Oct 1, 2014 based on Joget 3.1 Joget Inc Internal Use Only

Upload: joget-workflow

Post on 19-Jul-2015

557 views

Category:

Software


2 download

TRANSCRIPT

Page 1: Joget Workflow Training – Basic & Advance for v3.1 – Module 10 – Hash Variables

All Rights Reserved © Joget Inc

Joget Workflow v3

Training Programme:

All That You Need To Know

http://facebook.com/jogetworkflow

http://twitter.com/jogetworkflow

Last Revised on Oct 1, 2014 based on Joget 3.1Joget Inc Internal Use Only

Page 2: Joget Workflow Training – Basic & Advance for v3.1 – Module 10 – Hash Variables

All Rights Reserved © Joget Inc

Joget Workflow Training Programmes

All That You Need to Know: Automating

Your Processes and Building Applications

Developer: Extending and building plugins.

Joget Inc Internal Use Only

Page 3: Joget Workflow Training – Basic & Advance for v3.1 – Module 10 – Hash Variables

All Rights Reserved © Joget Inc

Joget Workflow Training

• All That You Need to Know: Automating Your Processes

and Building Applications

• Who is it for? Any business process owner

• Prerequisites:

– Logical understanding on drawing a flowchart

– No software development knowledge required

Joget Inc Internal Use Only

Page 4: Joget Workflow Training – Basic & Advance for v3.1 – Module 10 – Hash Variables

All Rights Reserved © Joget Inc

Outline – Day 1

• Module 1: Introduction– Introduction to Business Process and Workflow

– Introduction to Joget Workflow

– Overview of Joget Workflow v3 Architecture

• Module 2: Setting up Joget Workflow– Requirements

– Installation

– Overview of User Management

• Module 3: Building your first Process-driven Application– Business Process Design

– Designing Your First Workflow with Workflow Designer

– Running Your First Automated Process

Joget Inc Internal Use Only

Page 5: Joget Workflow Training – Basic & Advance for v3.1 – Module 10 – Hash Variables

All Rights Reserved © Joget Inc

Outline – Day 1

• Module 4: Process Monitoring

– Administration of Process Instances in Joget

• Module 5: Creating your first Forms

– Creating your First Forms using Joget Form Builder

– Understanding the relationship between Forms and Process

Activities

Joget Inc Internal Use Only

Page 6: Joget Workflow Training – Basic & Advance for v3.1 – Module 10 – Hash Variables

All Rights Reserved © Joget Inc

Outline – Day 2

• Module 6: Using the Email Tool

– Implementing Email Tool Plugin on your Process Tool.

• Module 7: Creating Datalist and Userview

– Creating a Listing of submitted Form data.

– Creating a User Interface (UI) for end-user access.

• Module 8: Participant Mapping and Permission

Control

– Defining Process Participant Mapping on your Process

– Enforcing Permission Control on your App

Joget Inc Internal Use Only

Page 7: Joget Workflow Training – Basic & Advance for v3.1 – Module 10 – Hash Variables

All Rights Reserved © Joget Inc

Outline – Day 3

• Module 9: SLA and Deadlines

– Service Level Agreement implementation on Workflow Process.

– Creating Email Reminder on Workflow Process using Deadline

implementation.

• Module 10: Hash Variables

– Dynamically populate Form fields, Email plugin.

– Using Hash Variable

• Module 11: A Revision - Building a Support

Ticketing System

Joget Inc Internal Use Only

Page 8: Joget Workflow Training – Basic & Advance for v3.1 – Module 10 – Hash Variables

All Rights Reserved © Joget Inc

Module 10

Hash Variables

Joget Inc Internal Use Only

Page 9: Joget Workflow Training – Basic & Advance for v3.1 – Module 10 – Hash Variables

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

Page 10: Joget Workflow Training – Basic & Advance for v3.1 – Module 10 – Hash Variables

All Rights Reserved © Joget Inc

Ever Wonder…

• How to display requestor’s full name in a form?

Joget Inc Internal Use Only

Page 11: Joget Workflow Training – Basic & Advance for v3.1 – Module 10 – Hash Variables

All Rights Reserved © Joget Inc

Ever Wonder…

• How to display requestor’s full name in task / activity

name?

Joget Inc Internal Use Only

Page 12: Joget Workflow Training – Basic & Advance for v3.1 – Module 10 – Hash Variables

All Rights Reserved © Joget Inc

Using #performer Hash Variables

#performer.facilities_request.username#

Joget Inc Internal Use Only

Page 13: Joget Workflow Training – Basic & Advance for v3.1 – Module 10 – Hash Variables

All Rights Reserved © Joget Inc

Using #performer Hash Variables in

Form BuilderHash Variables can be used in

Form Title, Section Title, Form

Element

Joget Inc Internal Use Only

Page 14: Joget Workflow Training – Basic & Advance for v3.1 – Module 10 – Hash Variables

All Rights Reserved © Joget Inc

Using #performer Hash Variables in

Workflow Designer

Joget Inc Internal Use Only

Page 15: Joget Workflow Training – Basic & Advance for v3.1 – Module 10 – Hash Variables

All Rights Reserved © Joget Inc

Using #performer Hash Variables in

Plugin Configuration

In Email Plugin, Hash Variables

are supported in From, To

(specific email address), CC,

Subject and Message fields.

Joget Inc Internal Use Only

Page 16: Joget Workflow Training – Basic & Advance for v3.1 – Module 10 – Hash Variables

All Rights Reserved © Joget Inc

Using #form Hash Variables in

Plugin Configuration

#form.facities_request.details#

Joget Inc Internal Use Only

Page 17: Joget Workflow Training – Basic & Advance for v3.1 – Module 10 – Hash Variables

All Rights Reserved © Joget Inc

Using #variable Hash Variable

• To get the value of a workflow variable:

– #variable.variableName#

Example:

#variable.status#

Joget Inc Internal Use Only

Page 18: Joget Workflow Training – Basic & Advance for v3.1 – Module 10 – Hash Variables

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

Page 19: Joget Workflow Training – Basic & Advance for v3.1 – Module 10 – Hash Variables

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

Page 20: Joget Workflow Training – Basic & Advance for v3.1 – Module 10 – Hash Variables

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

Page 21: Joget Workflow Training – Basic & Advance for v3.1 – Module 10 – Hash Variables

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

Page 22: Joget Workflow Training – Basic & Advance for v3.1 – Module 10 – Hash Variables

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

Page 23: Joget Workflow Training – Basic & Advance for v3.1 – Module 10 – Hash Variables

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#

Joget Inc Internal Use Only

Page 24: Joget Workflow Training – Basic & Advance for v3.1 – Module 10 – Hash Variables

All Rights Reserved © Joget Inc

Hash variables supported

• Performer

• Internationalization support on application

• Request Parameters

• Application level environment variable

• Current User

• Assignment

• Form

• Workflow Variable

• Date

• User

Joget Inc Internal Use Only

Page 25: Joget Workflow Training – Basic & Advance for v3.1 – Module 10 – Hash Variables

All Rights Reserved © Joget Inc

Hash variables supported

• 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#

Joget Inc Internal Use Only

Page 26: Joget Workflow Training – Basic & Advance for v3.1 – Module 10 – Hash Variables

All Rights Reserved © Joget Inc

Hash variables supported

• Internationalization support on application

– Support language localization on application level.

• #i18n.keyName#

Joget Inc Internal Use Only

Page 27: Joget Workflow Training – Basic & Advance for v3.1 – Module 10 – Hash Variables

All Rights Reserved © Joget Inc

Hash variables supported

• Request Parameters

– For accessing request parameters.

• #requestParam.parameterName#

Joget Inc Internal Use Only

Page 28: Joget Workflow Training – Basic & Advance for v3.1 – Module 10 – Hash Variables

All Rights Reserved © Joget Inc

Hash variables supported

• Application level environment variable

– Application level environment variable.

• #envVariable.keyName#

Joget Inc Internal Use Only

Page 29: Joget Workflow Training – Basic & Advance for v3.1 – Module 10 – Hash Variables

All Rights Reserved © Joget Inc

Hash variables supported

• Current User

– Retrieve currently logged in user information.

• #currentUser.id#,

• #currentUser.username#,

• #currentUser.firstName#,

• #currentUser.lastName#,

• #currentUser.email#,

• #currentUser.active#,

• #currentUser.timeZone#

Joget Inc Internal Use Only

Page 30: Joget Workflow Training – Basic & Advance for v3.1 – Module 10 – Hash Variables

All Rights Reserved © Joget Inc

Hash variables supported

• 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#

Joget Inc Internal Use Only

Page 31: Joget Workflow Training – Basic & Advance for v3.1 – Module 10 – Hash Variables

All Rights Reserved © Joget Inc

Hash variables supported

• Form

– To get data from form table.

– #form.formDataTableName.fieldId#

– For examples:

• #form.registration.registeredDate#

• #form.registration.issuedDate#

Joget Inc Internal Use Only

Page 32: Joget Workflow Training – Basic & Advance for v3.1 – Module 10 – Hash Variables

All Rights Reserved © Joget Inc

Hash variables supported

• Workflow Variable

– To get the value of a workflow variable.

• #variable.variableName#

Joget Inc Internal Use Only

Page 33: Joget Workflow Training – Basic & Advance for v3.1 – Module 10 – Hash Variables

All Rights Reserved © Joget Inc

Hash variables supported

• 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

Page 34: Joget Workflow Training – Basic & Advance for v3.1 – Module 10 – Hash Variables

All Rights Reserved © Joget Inc

Hash variables supported

• 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#

Joget Inc Internal Use Only

Page 35: Joget Workflow Training – Basic & Advance for v3.1 – Module 10 – Hash Variables

All Rights Reserved © Joget Inc

Exercise

1. In “Submit Leave” form, prepopulate the applicant’s

name using hash variable.

2. In “Send Rejected Email Notification” Email Tool,

compose the message as follow using hash variable.

Dear [applicant name],

Your application has been [status] due to the following reason:-

[rejected reason]

Thank you.

Joget Inc Internal Use Only

Page 36: Joget Workflow Training – Basic & Advance for v3.1 – Module 10 – Hash Variables

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

Page 37: Joget Workflow Training – Basic & Advance for v3.1 – Module 10 – Hash Variables

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

Joget Inc Internal Use Only

Page 38: Joget Workflow Training – Basic & Advance for v3.1 – Module 10 – Hash Variables

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.

Joget Inc Internal Use Only

Page 39: Joget Workflow Training – Basic & Advance for v3.1 – Module 10 – Hash Variables

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