public interface IWFProcessDefinition
extends java.lang.Cloneable
Represents workflow process definition.
Lifecycle of process definition -
When a process definition is created, the state of the definition is initially on
WFProcessDefinitionState.draft. Users are not able to start the workflow until the
process definition is published by IWorkflowService.publishProcessDefinition(Id).
The published process definition is immutable and every published process definition is versioned.
When a process definition is updated by IWorkflowService.updateProcessDefinition(IWFProcessDefinition),
it creates new draft version behind the scene ( or update the draft version if a draft already exists ).
When you publish a process definition, the draft content of the definition becomes published one, and previous published one is
marked WFProcessDefinitionState.expired. You can still fetch specific expired version
content by IWorkflowService.getProcessDefinitionByVersionId(Id) and inflight
workflow/process instance remains on the original version of process definition.
The process is instantiated by an object creation ( when the type is {@link WFProcessDefinitionType#create ), or by user operation/API call against existing object, and the behavior of the process is defined here.
| Modifier and Type | Method and Description |
|---|---|
void |
addActivity(IWFActivity activity)
Adds an activity
|
IWFProcessDefinition |
clone()
Returns a cloned instance.
|
java.util.List<IWFActivity> |
getActivities()
Returns the list of activities.
|
IWFActivity |
getActivity(Id id)
Returns the activity by the activity ID.
|
IWFActivity |
getActivity(java.lang.String name)
Returns the activity by the activity name.
|
java.lang.Object |
getAttribute(java.lang.String name)
Returns the process attribute by a name string.
|
java.util.Map<java.lang.String,java.lang.Object> |
getAttributes()
Returns the map of process attributes.
|
IWFConditionEval |
getCondition()
Returns the workflow condition.
|
java.lang.String |
getCreatedBy()
Returns the user name who created the process definition
|
java.util.Date |
getCreatedDate()
Returns the creation date
|
Id |
getId()
Returns unique identifier of the process definition
|
int |
getLatestVersionNumber()
Returns version number of the latest process definition.
|
WFProcessDefinitionState |
getLatestVersionState()
Returns the state of the latest process definition.
|
java.lang.String |
getModifiedBy()
Returns the user name who last modified the process definition
|
java.util.Date |
getModifiedDate()
Returns the last modified date
|
java.lang.String |
getName()
Returns name of the process definition
|
java.lang.String |
getNameLabel()
Returns the localized name label of the process definition
for the user session
|
java.util.List<ILabel> |
getNameLabels()
Returns the process definition name labels for all locales
|
java.lang.String |
getObjectType()
Returns the object type name.
|
ISchedJobDetail |
getSchedJobDetail() |
IWFActivity |
getStartActivity()
Returns the starting activity.
|
WFProcessDefinitionState |
getState()
Returns the state of the process definition.
|
WFProcessDefinitionType |
getType()
Returns the type of the process definition.
|
Id |
getVersionId()
Returns version id of the process definition.
|
int |
getVersionNumber()
Returns version number of the process definition.
|
boolean |
isAutomated()
Returns if the workflow is automated.
|
boolean |
isEnabled()
Returns if the process definition is enabled or not.
|
boolean |
isExecuteAsSystem()
Returns whether the workflow should be run as a system user
|
boolean |
isObjectInstanceReadOnly()
Returns if the process definition is read only.
|
void |
removeActivity(java.lang.String name)
Removes an activity by name
|
void |
setActivities(java.util.List<IWFActivity> activities)
Sets the list of activities.
|
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Sets the process attribute by a name string.
|
void |
setAttributes(java.util.Map<java.lang.String,java.lang.Object> attributes)
Sets the map of process attributes.
|
void |
setAutomated(boolean isAutomated)
Sets this as an automated workflow which can only contain automated stages.
|
void |
setCondition(IWFConditionEval condition)
Sets the workflow condition.
|
void |
setEnabled(boolean isEnabled)
Enables or disables the process definition.
|
void |
setExecuteAsSystem(boolean executeAsSystem)
Sets whether the workflow should be run as a system user
|
void |
setNameLabels(java.util.List<ILabel> nameLabels)
Sets the list of process definition name labels
|
void |
setSchedJobDetail(ISchedJobDetail schedJobDetail) |
void |
setType(WFProcessDefinitionType type)
Sets the type of the process definition.
|
Id getId()
Id getVersionId()
int getVersionNumber()
int getLatestVersionNumber()
java.lang.String getName()
java.lang.String getNameLabel()
java.util.List<ILabel> getNameLabels()
ILabel the process definition name labelvoid setNameLabels(java.util.List<ILabel> nameLabels)
nameLabels - the list of ILabelISchedJobDetail getSchedJobDetail()
void setSchedJobDetail(ISchedJobDetail schedJobDetail)
WFProcessDefinitionType getType()
WFProcessDefinitionTypevoid setType(WFProcessDefinitionType type)
type - WFProcessDefinitionState getState()
WFProcessDefinitionStateWFProcessDefinitionState getLatestVersionState()
WFProcessDefinitionState
Useful to understand if there's currently a Draft version.java.lang.String getObjectType()
java.util.Map<java.lang.String,java.lang.Object> getAttributes()
void setAttributes(java.util.Map<java.lang.String,java.lang.Object> attributes)
attributes - java.lang.Object getAttribute(java.lang.String name)
name - void setAttribute(java.lang.String name,
java.lang.Object value)
name - value - IWFConditionEval getCondition()
WFProcessDefinitionType.create.void setCondition(IWFConditionEval condition)
boolean isAutomated()
void setAutomated(boolean isAutomated)
isAutomated - boolean isEnabled()
void setEnabled(boolean isEnabled)
isEnabled - java.util.Date getModifiedDate()
java.lang.String getModifiedBy()
java.util.Date getCreatedDate()
java.lang.String getCreatedBy()
boolean isExecuteAsSystem()
void setExecuteAsSystem(boolean executeAsSystem)
executeAsSystem - java.util.List<IWFActivity> getActivities()
IWFActivityvoid setActivities(java.util.List<IWFActivity> activities)
activities - IWFActivity getActivity(java.lang.String name)
IWFActivity getActivity(Id id)
id - IWFActivity getStartActivity()
void addActivity(IWFActivity activity)
activity - void removeActivity(java.lang.String name)
name - boolean isObjectInstanceReadOnly()
IWFProcessDefinition clone()
isObjectInstanceReadOnly() of the cloned instance is always false.
Licensed Materials - Property of IBM
OpenPages with Watson (PID: 5725-D51)
© Copyright IBM Corporation 2013, 2020. All Rights Reserved.
US Government Users Restricted Rights -
Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.