Description

  • org.joget.workflow.util.WorkflowUtil
  • Under wflow-wfengine module
  • Utility methods used by workflow engine

Code Sample

import javax.servlet.http.HttpServletRequest;
import org.joget.workflow.util.WorkflowUtil;

//get the HTTP request
HttpServletRequest request = WorkflowUtil.getHttpServletRequest();

Methods

addAuditTrail
public static void addAuditTrail(java.lang.String clazz, java.lang.String method, java.lang.String message)

Convenient method used to add a simple audit trail

addAuditTrail
public static void addAuditTrail(java.lang.String clazz, java.lang.String method, java.lang.String message, java.lang.Class[] paramTypes, java.lang.Object[] args, java.lang.Object returnObject)

Convenient method used to add an audit trail

containsHashVariable
public static boolean containsHashVariable(java.lang.String content)

Check if the content contains hash (#) character

processVariable
public static java.lang.String processVariable(java.lang.String content, java.lang.String formDataTable, org.joget.workflow.model.WorkflowAssignment wfAssignment) 

Parse and replace the Hash Variable in content

processVariable
public static java.lang.String processVariable(java.lang.String content, java.lang.String formDataTable, org.joget.workflow.model.WorkflowAssignment wfAssignment, java.lang.String escapeFormat)

Parse and replace the Hash Variable in content. Option to escape with a format

processVariable
public static java.lang.String processVariable(java.lang.String content, java.lang.String formDataTable, org.joget.workflow.model.WorkflowAssignment wfAssignment, java.lang.String escapeFormat, java.util.Map<java.lang.String, java.lang.String> replaceMap)

Parse and replace the Hash Variable in content. Option to escape with a format and replace keywords.

getApplicationContext
public static org.springframework.context.ApplicationContext getApplicationContext()

Utility method to retrieve the ApplicationContext of the system

getAssignmentUsers
public static java.util.List<java.lang.String> getAssignmentUsers(java.lang.String packageId, java.lang.String procDefId, java.lang.String procId, java.lang.String version, java.lang.String actId, java.lang.String requesterUsername, java.lang.String participantId)

Retrieve users for assignment based on participant mapping

getCurrentUserFullName
public static java.lang.String getCurrentUserFullName()

Convenient method used to get the full name of current logged in user

getCurrentUsername
public static java.lang.String getCurrentUsername()

Convenient method used to get current logged in user

getHttpServletRequest
public static javax.servlet.http.HttpServletRequest getHttpServletRequest()

Returns the HTTP Servlet Request associated with the current thread.

Return The HTTP request if it is available. If the request is not available, e.g. when triggered from a deadline, null is returned.

getHttpServletResponse
public static javax.servlet.http.HttpServletResponse getHttpServletResponse()

Returns the HTTP Servlet Response associated with the current thread.

Return The HTTP Response if it is available. If the response is not available, e.g. when triggered from a deadline, null is returned.

getProcessDefIdWithoutVersion
public static java.lang.String getProcessDefIdWithoutVersion(java.lang.String processDefId)

Retrieves the process definition ID without the version and package.

getProcessDefPackageId
public static java.lang.String getProcessDefPackageId(java.lang.String processDefId)

Retrieves the package ID from the process definition ID.

getProcessDefVersion
public static java.lang.String getProcessDefVersion(java.lang.String processDefId)

Retrieves the version from the process definition.

getServiceLevelIndicator
public static java.lang.String getServiceLevelIndicator(double value)

Method used to get the HTML indicator of service level based on value and system setting

getSystemSetupValue
public static java.lang.String getSystemSetupValue(java.lang.String propertyName)

Convenient method used to get a value of system setting

getUserAttribute
public static java.lang.String getUserAttribute(java.lang.String username, java.lang.String attribute)

Convenient method used to get an attribute value from user

isCurrentUserAnonymous
public static boolean isCurrentUserAnonymous()

Convenient method used to check the current logged in user is an anonymous user

isCurrentUserInRole
public static boolean isCurrentUserInRole(java.lang.String role)

Convenient method used to check the current logged in user has a role

  • No labels