Joget DX 8 Stable Released
The stable release for Joget DX 8 is now available, with a focus on UX and Governance.
import org.joget.apps.app.service.AppUtil; import org.joget.workflow.model.WorkflowProcessResult; import org.joget.workflow.model.service.WorkflowManager; WorkflowManager workflowManager = (WorkflowManager) AppUtil.getApplicationContext().getBean("workflowManager"); String recordId = "001"; String processDefId = "crm#2#process1"; //Start a process with existing record WorkflowProcessResult result = workflowManager.processStart(processDefId, null, null, null, recordId, boolean false);
public static String LATEST = "latest";
Keyword used to replace the version number in process definition id to always use the latest version.
void activityAbort(java.lang.String processId, java.lang.String activityDefId)
Abort an activity based on the process instance Id and activity definition ID.
void activityVariable(java.lang.String activityInstanceId, java.lang.String variableId, java.lang.Object variableValue)
Set the workflow variable based on an activity instance ID.
void activityVariables(java.lang.String activityInstanceId, java.util.Map<java.lang.String, java.lang.String> variables)
Set the workflow variables based on an activity instance ID
boolean activityStart(java.lang.String processId, java.lang.String activityDefId, boolean abortRunningActivities)
Start a specific activity for a running process instance.
void assignmentAccept(java.lang.String activityId)
Accept an assignment (for the current user) based on the activity instance ID.
Deprecated Since v3, the concept of accept & withdraw assignment is removed
void assignmentComplete(java.lang.String activityId)
Complete an assignment (for the current user) based on the activity instance ID.
void assignmentComplete(java.lang.String activityId, java.util.Map<java.lang.String, java.lang.String> variableMap)
Complete an assignment (for the current user) while setting workflow variable values
void assignmentForceComplete(java.lang.String processDefId, java.lang.String processId, java.lang.String activityId, java.lang.String username)
Force completes an assignment of a user
void assignmentReassign(java.lang.String processDefId, java.lang.String processId, java.lang.String activityId, java.lang.String username, java.lang.String replaceUser)
Reassigns the assignment from a user to another user
void assignmentWithdraw(java.lang.String activityId)
Withdraw an assignment (for the current user) based on the activity instance ID.
Deprecated Since v3, the concept of accept & withdraw assignment is removed.
void assignmentVariable(java.lang.String activityId, java.lang.String variableName, java.lang.String variableValue)
Set workflow variable value based on activity instance ID. This only works when the current user is assigned to the activity.
void assignmentVariables(java.lang.String activityId, java.util.Map<java.lang.String, java.lang.String> variableMap)
Set workflow variables value based on activity instance ID. This only works when the current user is assigned to the activity.
org.joget.workflow.model.WorkflowActivity getActivityById(java.lang.String activityId)
Returns an activity instance based on the activity instance ID.
java.util.Map getActivityInstanceByProcessIdAndStatus(java.lang.String processId, java.lang.Boolean accepted)
Gets a map of active activities in a process instance.
Deprecated Since v3, the concept of accept & withdraw assignment is removed.
Collection<org.joget.workflow.model.WorkflowActivity> getActivityList(java.lang.String processId, java.lang.Integer start, java.lang.Integer rows, java.lang.String sort, java.lang.Boolean desc)
Returns a list of running or completed activities for a process instance ID.
int getActivitySize(java.lang.String processId)
Returns the number of running or completed activities for a process instance ID.
java.util.Collection<org.joget.workflow.model.WorkflowVariable> getActivityVariableList(java.lang.String activityId)
Returns a list of workflow variables for the specified activity instance ID (for any user)
org.joget.workflow.model.WorkflowAssignment getAssignment(java.lang.String activityId)
Returns an assignment for the current user based on an activity instance ID.
org.joget.commons.util.PagedList<org.joget.workflow.model.WorkflowAssignment> getAssignmentAcceptedList(java.lang.String processDefId, java.lang.String sort, java.lang.Boolean desc, java.lang.Integer start, java.lang.Integer rows)
Returns accepted assignments for the current user.
Deprecated Since v3, the concept of accept & withdraw assignment is removed.
org.joget.workflow.model.WorkflowAssignment getAssignmentByProcess(java.lang.String processId)
Returns the first assignment for the current user based on a process instance ID.
java.util.Collection<org.joget.workflow.model.WorkflowAssignment> getAssignmentList(java.lang.Boolean accepted, java.lang.String processDefId, java.lang.String sort, java.lang.Boolean desc, java.lang.Integer start, java.lang.Integer rows)
Returns a list of assignments for the current user
java.util.Collection<org.joget.workflow.model.WorkflowAssignment> getAssignmentList(java.lang.String packageId, java.lang.String processDefId, java.lang.String processId, java.lang.String sort, java.lang.Boolean desc, java.lang.Integer start, java.lang.Integer rows)
Returns a list of assignments for the current user.
java.util.Collection<org.joget.workflow.model.WorkflowAssignment> getAssignmentList(java.lang.String packageId, java.lang.String processDefId, java.lang.String processId, java.lang.String activityDefId, java.lang.String sort, java.lang.Boolean desc, java.lang.Integer start, java.lang.Integer rows)
Returns a list of assignments for the current user.
java.util.Collection<org.joget.workflow.model.WorkflowAssignment> getAssignmentListFilterByProccessDefIds(java.lang.String[] processDefIds, java.lang.String sort, java.lang.Boolean desc, java.lang.Integer start, java.lang.Integer rows)
Returns a list of assignments for the current user filter by processDefIds
int getAssignmentListFilterByProccessDefIdsSize(java.lang.String[] processDefIds)
Returns the number of assignments for the current user filter by processDefIds.
java.util.Collection<org.joget.workflow.model.WorkflowAssignment> getAssignmentListLite(java.lang.String packageId, java.lang.String processDefId, java.lang.String processId, java.lang.String activityDefId, java.lang.String sort, java.lang.Boolean desc, java.lang.Integer start, java.lang.Integer rows)
Returns a list of assignments with lite info for the current user.
org.joget.commons.util.PagedList<org.joget.workflow.model.WorkflowAssignment> getAssignmentPendingAndAcceptedList(java.lang.String packageId, java.lang.String processDefId, java.lang.String processId, java.lang.String sort, java.lang.Boolean desc, java.lang.Integer start, java.lang.Integer rows)
Returns the all (pending and accepted) assignments for the current user.
org.joget.commons.util.PagedList<org.joget.workflow.model.WorkflowAssignment> getAssignmentPendingList(java.lang.String processDefId, java.lang.String sort, java.lang.Boolean desc, java.lang.Integer start, java.lang.Integer rows)
Returns pending assignments for the current user
int getAssignmentSize(java.lang.Boolean accepted, java.lang.String processDefId)
Returns the number of assignments for the current user.
int getAssignmentSize(java.lang.String packageId, java.lang.String processDefId, java.lang.String processId)
Returns the number of assignments for the current user.
int getAssignmentSize(java.lang.String packageId, java.lang.String processDefId, java.lang.String processId, java.lang.String activityDefId)
Returns the number of assignments for the current user.
java.util.Collection<org.joget.workflow.model.WorkflowVariable> getAssignmentVariableList(java.lang.String activityId)
Returns a list of workflow variables for the specified activity instance ID (only if assigned to the current user)
java.lang.String getCurrentPackageVersion(java.lang.String packageId)
Returns the latest package version for the given package ID
org.joget.workflow.model.WorkflowAssignment getMockAssignment(java.lang.String activityId)
Returns a mock assignment based on an activity instance ID.
org.joget.workflow.model.WorkflowPackage getPackage(java.lang.String packageId, java.lang.String version)
Retrieve a specific workflow package.
byte[] getPackageContent(java.lang.String packageId, java.lang.String version)
Returns the XPDL content for a package version.
java.util.Collection<org.joget.workflow.model.WorkflowPackage> getPackageList()
Returns a list of packages currently in the system.
java.util.Map<java.lang.String, org.joget.workflow.model.WorkflowParticipant> getParticipantMap(java.lang.String processDefId)
Returns the participant definitions for a process definition ID in a map.
org.joget.workflow.model.WorkflowProcess getProcess(java.lang.String processDefId)
Returns a process definition by its definition ID.
java.util.Collection<org.joget.workflow.model.WorkflowActivity> getProcessActivityDefinitionList(java.lang.String processDefId)
Returns the activity definitions for a process definition ID.
java.util.Collection<org.joget.workflow.model.WorkflowActivity> getProcessActivityDefinitionList(java.lang.String processDefId)
Returns the activity definitions for a process definition ID.
java.lang.String getProcessDefIdByInstanceId(java.lang.String instanceId)
Returns a process definition ID based on a process instance ID.
java.util.Collection<org.joget.workflow.model.WorkflowProcess> getProcessList(java.lang.String packageId)
Returns a list of process definitions.
java.util.Collection<org.joget.workflow.model.WorkflowProcess> getProcessList(java.lang.String packageId, java.lang.String version)
Returns a list of process definitions.
java.util.Collection<org.joget.workflow.model.WorkflowTool> getProcessToolDefinitionList(java.lang.String processDefId)
Returns the application definitions for a process definition ID.
java.lang.String getProcessVariable(java.lang.String processInstanceId, java.lang.String variableId)
Returns the variable value based on a process instance ID.
java.util.Collection<org.joget.workflow.model.WorkflowVariable> getProcessVariableList(java.lang.String processId)
Returns a list of workflow variables for the specified process instance ID (for any user)
java.lang.String getUserByProcessIdAndActivityDefId(java.lang.String processDefId, java.lang.String processId, java.lang.String activityDefId)
Returns the name of the user that accepted/completed activity.
Parameters:
processDefId - Unsed for now
java.lang.Boolean isAssignmentExist(java.lang.String activityId)
Check an assignment is exist or not (for current user) based on an activity instance ID.
java.lang.Boolean isPackageIdExist(java.lang.String packageId)
Checks to see whether or not package exists.
void processVariable(java.lang.String processInstanceId, java.lang.String variableId, java.lang.Object variableValue)
Set the workflow variable based on an process instance ID.
void processVariables(java.lang.String processInstanceId, java.util.Map<java.lang.String, java.lang.String> variables)
Set the workflow variables based on an process instance ID.