public class ProcessElement extends BaseClass
Process
,
such as a Task
or DecisionTask
.config, configOnly, factoryCreated, factoryProperties, id, scClassName
Constructor and Description |
---|
ProcessElement() |
ProcessElement(com.google.gwt.core.client.JavaScriptObject jsObj) |
ProcessElement(java.lang.String ID) |
ProcessElement(java.lang.String ID,
java.lang.String nextElement) |
Modifier and Type | Method and Description |
---|---|
void |
completeElement(Process process)
StringMethod called when a processElement completes.
|
static com.google.gwt.core.client.JavaScriptObject |
convertToJavaScriptArray(ProcessElement[] array) |
com.google.gwt.core.client.JavaScriptObject |
create() |
java.lang.Boolean |
executeElement(Process process)
Method called by
Process to have the processElement perform its work. |
java.lang.String |
getBindOutput()
When set, the output of the task will be automatically bound to the specified value in the
process state . |
java.lang.String |
getClassDescription()
Optional description of the general nature of the kinds of tasks this this process element performs.
|
java.lang.String |
getDescription()
Optional description for this specific instance of process element.
|
java.lang.String |
getDynamicValue(java.lang.String value,
Process process)
Resolves a dynamic value as
taskInputExpressions or returns the
value as-is. |
java.lang.String |
getEditorType()
Editor type used to edit instances of this type of process element.
|
java.lang.String |
getElementDescription()
Returns a text description of the element derived from the configuration.
|
java.lang.Boolean |
getForceSingle()
Should
multiple record
processing be suppressed for this task instance? This property can be set at any time is checked before executing the
task and after each execution during processing of multiple last task output records. |
java.lang.String |
getID()
Optional ID for this process element, allowing it to be referred to from
Decisions , or as the Process.startElement . |
com.google.gwt.core.client.JavaScriptObject |
getJsObj() |
java.lang.Boolean |
getMockMode()
Enable mock mode on the task? If
Process.mockMode is
enabled, setting this property to false disables mockMode on this task only. |
java.lang.String |
getNextElement()
|
com.google.gwt.core.client.JavaScriptObject |
getOrCreateJsObj() |
static ProcessElement |
getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj) |
java.lang.Boolean |
getPassThruOutput()
Does this processElement pass through output from the last executed task (i.e.
|
ProcessElement[] |
getProcessElements(java.lang.String attribute) |
java.lang.Boolean |
getSupportsMultipleInputRecords()
Does this processElement support being called multiple times for multiple records in the
last task output ? |
java.lang.String |
getTextFormulaValue(UserSummary textFormula,
Process process)
Resolves a
UserSummary value against the current rule context . |
java.lang.String |
getTypeTitle()
Optional short, descriptive title for this process element.
|
boolean |
isCreated() |
java.lang.Boolean |
objectReferencesLastTaskOutput(java.util.Map object,
Process process)
Does the object have fields that reference the last task output (i.e.
|
protected void |
onInit() |
void |
reset()
StringMethod called during
Process.reset() giving the task a
chance to reset any internal state so it can be executed later. |
ProcessElement |
setAttribute(java.lang.String attribute,
ProcessElement[] value,
boolean allowPostCreate) |
ProcessElement |
setBindOutput(java.lang.String bindOutput)
When set, the output of the task will be automatically bound to the specified value in the
process state . |
ProcessElement |
setClassDescription(java.lang.String classDescription)
Optional description of the general nature of the kinds of tasks this this process element performs.
|
ProcessElement |
setDescription(java.lang.String description)
Optional description for this specific instance of process element.
|
ProcessElement |
setEditorType(java.lang.String editorType)
Editor type used to edit instances of this type of process element.
|
ProcessElement |
setForceSingle(java.lang.Boolean forceSingle)
Should
multiple record
processing be suppressed for this task instance? This property can be set at any time is checked before executing the
task and after each execution during processing of multiple last task output records. |
ProcessElement |
setID(java.lang.String ID)
Optional ID for this process element, allowing it to be referred to from
Decisions , or as the Process.startElement . |
void |
setJavaScriptObject(com.google.gwt.core.client.JavaScriptObject jsObj) |
ProcessElement |
setMockMode(java.lang.Boolean mockMode)
Enable mock mode on the task? If
Process.mockMode is
enabled, setting this property to false disables mockMode on this task only. |
ProcessElement |
setNextElement(java.lang.String nextElement)
|
ProcessElement |
setPassThruOutput(java.lang.Boolean passThruOutput)
Does this processElement pass through output from the last executed task (i.e.
|
ProcessElement |
setSupportsMultipleInputRecords(java.lang.Boolean supportsMultipleInputRecords)
Does this processElement support being called multiple times for multiple records in the
last task output ? |
ProcessElement |
setTypeTitle(java.lang.String typeTitle)
Optional short, descriptive title for this process element.
|
java.lang.Boolean |
updateGlobalIDInCriteria(AdvancedCriteria criteria,
java.lang.String oldId,
java.lang.String newId)
|
java.lang.Boolean |
updateGlobalIDInValueProperty(java.lang.String propertyName,
java.lang.String oldId,
java.lang.String newId)
Updates a
TaskInputExpression property value containing ruleScope references. |
java.lang.Boolean |
updateGlobalIDInValues(java.util.Map values,
java.lang.String oldId,
java.lang.String newId)
Updates a set of
TaskInputExpression values containing ruleScope references. |
java.lang.Boolean |
updateGlobalIDReferences(java.lang.String oldId,
java.lang.String newId)
Updates references to a global ID within the properties of this process element (i.e.
|
java.lang.Boolean |
updateLastElementBindingReferences(java.lang.String oldId,
java.lang.String newId)
Update references to a binding $last within properties of this processElement.
|
java.lang.Boolean |
updateLastElementInCriteria(AdvancedCriteria criteria,
java.lang.String taskType)
|
java.lang.Boolean |
updateLastElementInValueProperty(java.lang.String propertyName,
java.lang.String taskType)
Updates a
TaskInputExpression property value containing $last references. |
java.lang.Boolean |
updateLastElementInValues(java.util.Map values,
java.lang.String taskType)
Updates a set of
TaskInputExpression values containing $last references. |
addDynamicProperty, addDynamicProperty, addDynamicProperty, addDynamicProperty, applyFactoryProperties, asSGWTComponent, clearDynamicProperty, createJsObj, destroy, doAddHandler, doInit, error, error, errorIfNotCreated, fireEvent, getAttribute, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsElement, getAttributeAsFloat, getAttributeAsInt, getAttributeAsJavaScriptObject, getAttributeAsMap, getAttributeAsString, getAttributeAsStringArray, getClassName, getConfig, getHandlerCount, getRef, getRuleScope, getScClassName, getTestInstance, hasAutoAssignedID, hasDynamicProperty, internalSetID, internalSetID, isConfigOnly, isFactoryCreated, onBind, registerID, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setConfig, setConfigOnly, setFactoryCreated, setProperty, setProperty, setProperty, setProperty, setRuleScope, setScClassName
public ProcessElement()
public ProcessElement(com.google.gwt.core.client.JavaScriptObject jsObj)
public ProcessElement(java.lang.String ID)
public ProcessElement(java.lang.String ID, java.lang.String nextElement)
public static ProcessElement getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)
public void setJavaScriptObject(com.google.gwt.core.client.JavaScriptObject jsObj)
setJavaScriptObject
in class BaseClass
public com.google.gwt.core.client.JavaScriptObject create()
public com.google.gwt.core.client.JavaScriptObject getJsObj()
public com.google.gwt.core.client.JavaScriptObject getOrCreateJsObj()
getOrCreateJsObj
in class BaseClass
public ProcessElement setBindOutput(java.lang.String bindOutput) throws java.lang.IllegalStateException
process state
. See taskInputExpressions
for details on the transient state outputs.
bindOutput
- New bindOutput value. Default value is nullProcessElement
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the underlying component has been createdpublic java.lang.String getBindOutput()
process state
. See taskInputExpressions
for details on the transient state outputs.
public ProcessElement setClassDescription(java.lang.String classDescription) throws java.lang.IllegalStateException
description
which describes what the
specific instance of the process element has been configured to do. For example, the classDescription
for a task to disable a field might be "disables a field" whereas the description
for a concrete instance
might be "disables the 'shipTo' field in the 'ordering' form".
Used by editor to display additional details along
with typeTitle
.
classDescription
- New classDescription value. Default value is nullProcessElement
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the underlying component has been createdpublic java.lang.String getClassDescription()
description
which describes what the
specific instance of the process element has been configured to do. For example, the classDescription
for a task to disable a field might be "disables a field" whereas the description
for a concrete instance
might be "disables the 'shipTo' field in the 'ordering' form".
Used by editor to display additional details along
with typeTitle
.
public ProcessElement setDescription(java.lang.String description) throws java.lang.IllegalStateException
description
- New description value. Default value is nullProcessElement
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the underlying component has been createdpublic java.lang.String getDescription()
public ProcessElement setEditorType(java.lang.String editorType) throws java.lang.IllegalStateException
editorType
- New editorType value. Default value is nullProcessElement
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the underlying component has been createdpublic java.lang.String getEditorType()
this.editorType
but a custom override could determine an editor type based on the
property values. Default value is nullpublic ProcessElement setForceSingle(java.lang.Boolean forceSingle)
multiple record
processing
be suppressed for this task instance? This property can be set at any time is checked before executing the
task and after each execution during processing of multiple last task output records. Note that since this property
applies to an instance of a task that could be used multiple times in a process (by branching) care should be taken to
restore the property value after execution completes. See completeElement()
or reset()
.
forceSingle
- New forceSingle value. Default value is nullProcessElement
instance, for chaining setter callspublic java.lang.Boolean getForceSingle()
multiple record
processing
be suppressed for this task instance? This property can be set at any time is checked before executing the
task and after each execution during processing of multiple last task output records. Note that since this property
applies to an instance of a task that could be used multiple times in a process (by branching) care should be taken to
restore the property value after execution completes. See completeElement()
or reset()
.
public ProcessElement setID(java.lang.String ID) throws java.lang.IllegalStateException
Decisions
, or as the Process.startElement
. See ProcessSequence
and Process
to understand
when this is required or can be omitted. Unlike Canvas.ID
a
processElement
's is a not a globally unique variable, it need only by unique within it's process.
When
assigned an ID, a processElement
can be retrieve via Process.getElement()
.
setID
in class BaseClass
ID
- New ID value. Default value is nullProcessElement
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the underlying component has been createdpublic java.lang.String getID()
Decisions
, or as the Process.startElement
. See ProcessSequence
and Process
to understand
when this is required or can be omitted. Unlike Canvas.ID
a
processElement
's is a not a globally unique variable, it need only by unique within it's process.
When
assigned an ID, a processElement
can be retrieve via Process.getElement()
.
public ProcessElement setMockMode(java.lang.Boolean mockMode)
Process.mockMode
is
enabled, setting this property to false
disables mockMode on this task only. Otherwise, mock mode can be
enabled on this task by setting it to true
. Note that it is up to each task determine what effect mock mode has.
mockMode
- New mockMode value. Default value is nullProcessElement
instance, for chaining setter callspublic java.lang.Boolean getMockMode()
Process.mockMode
is
enabled, setting this property to false
disables mockMode on this task only. Otherwise, mock mode can be
enabled on this task by setting it to true
. Note that it is up to each task determine what effect mock mode has.
public ProcessElement setNextElement(java.lang.String nextElement) throws java.lang.IllegalStateException
sequence
or element
to execute after this one completes.
nextElement
does not need to be specified on most elements if you use sequences
.
Note that if there is both a
sequence
and a normal element
with the same name in the current Process
, the
sequence
will be used.
nextElement
- New nextElement value. Default value is nullProcessElement
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the underlying component has been createdpublic java.lang.String getNextElement()
sequence
or element
to execute after this one completes.
nextElement
does not need to be specified on most elements if you use sequences
.
Note that if there is both a
sequence
and a normal element
with the same name in the current Process
, the
sequence
will be used.
public ProcessElement setPassThruOutput(java.lang.Boolean passThruOutput) throws java.lang.IllegalStateException
See taskInputExpressions
for details on the transient state outputs.
Note
that this property does not affect the task at all but is an indicator to the user and to the workflow editor of the
behavior of the task as coded (See Process.passThruTaskOutput()
).
passThruOutput
- New passThruOutput value. Default value is trueProcessElement
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the underlying component has been createdpublic java.lang.Boolean getPassThruOutput()
See taskInputExpressions
for details on the transient state outputs.
Note
that this property does not affect the task at all but is an indicator to the user and to the workflow editor of the
behavior of the task as coded (See Process.passThruTaskOutput()
).
public ProcessElement setSupportsMultipleInputRecords(java.lang.Boolean supportsMultipleInputRecords) throws java.lang.IllegalStateException
last task output
? By default a processElement is executed
exactly once, however, for a task that can
process records from the last task output it can be useful to handle each incoming record individually. Setting this
property indicates to the process
that if the last task output is an
array, it should be executed once per value in the array. Normal processing of taskInputExpressions
or use of Process.getLastTaskOutput()
will have exactly one record
except uses of the output for criteria values where the full output is used at once.
Processing of the task can
determine that multiple incoming records should not result in multiple calls and set forceSingle
. For example, a task that uses last task
output for a criteria or for values should set forceSingle=true
when a criteria is used because multiple
calls do not make sense.
supportsMultipleInputRecords
- New supportsMultipleInputRecords value. Default value is nullProcessElement
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the underlying component has been createdpublic java.lang.Boolean getSupportsMultipleInputRecords()
last task output
? By default a processElement is executed
exactly once, however, for a task that can
process records from the last task output it can be useful to handle each incoming record individually. Setting this
property indicates to the process
that if the last task output is an
array, it should be executed once per value in the array. Normal processing of taskInputExpressions
or use of Process.getLastTaskOutput()
will have exactly one record
except uses of the output for criteria values where the full output is used at once.
Processing of the task can
determine that multiple incoming records should not result in multiple calls and set forceSingle
. For example, a task that uses last task
output for a criteria or for values should set forceSingle=true
when a criteria is used because multiple
calls do not make sense.
public ProcessElement setTypeTitle(java.lang.String typeTitle) throws java.lang.IllegalStateException
typeTitle
- New typeTitle value. Default value is nullProcessElement
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the underlying component has been createdpublic java.lang.String getTypeTitle()
public void completeElement(Process process)
forceSingle
so it can be executed
again later. See also reset()
.process
- the containing processpublic java.lang.Boolean executeElement(Process process)
Process
to have the processElement perform its work. There is
no default implementation by ProcessElement, however, all of the system-provided subclasses do implement this method. An
implementation or override of this method is one possible customization point. Some classes like ScriptTask
perform other means to add customization. For ScriptTask, custom code is
expected to handle the ScriptTask.execute()
method instead.
Any implementation of this method must return true
if all the work this element needed to perform was
completed. Return false
if additional work is being performed asynchronously and the process should be
paused until element restarts it. Once asynchronous work is complete the task must call Process.start()
to restart the workflow with the next task.
process
- the process that is handling the workflowpublic java.lang.String getDynamicValue(java.lang.String value, Process process)
taskInputExpressions
or returns the
value as-is.value
- the value to resolveprocess
- the current processpublic java.lang.String getElementDescription()
If no override is provided by the concrete
ProcessElement implementation the description
is
returned.
public java.lang.String getTextFormulaValue(UserSummary textFormula, Process process)
UserSummary
value against the current rule context
.textFormula
- the UserSummary value to resolveprocess
- the current processpublic java.lang.Boolean objectReferencesLastTaskOutput(java.util.Map object, Process process)
object
- object to be checkedprocess
- the enclosing processpublic void reset()
Process.reset()
giving the task a
chance to reset any internal state so it can be executed later. See also completeElement()
.public java.lang.Boolean updateGlobalIDInCriteria(AdvancedCriteria criteria, java.lang.String oldId, java.lang.String newId)
AdvancedCriteria
Criterion
TaskInputExpression
values containing ruleScope references. This method is a helper to
implement task-specific updateGlobalIDReferences()
.
criteria
- the criteria to be updated in placeoldId
- the ID being renamed.
See Identifier
newId
- the new ID to be assigned.
See Identifier
public java.lang.Boolean updateGlobalIDInValueProperty(java.lang.String propertyName, java.lang.String oldId, java.lang.String newId)
TaskInputExpression
property value containing ruleScope references. This
method is a helper to implement task-specific updateGlobalIDReferences()
.
propertyName
- the property name to be updated in this taskoldId
- the ID being renamed.
See Identifier
newId
- the new ID to be assigned.
See Identifier
public java.lang.Boolean updateGlobalIDInValues(java.util.Map values, java.lang.String oldId, java.lang.String newId)
TaskInputExpression
values containing ruleScope references. This
method is a helper to implement task-specific updateGlobalIDReferences()
.
values
- the object to be updatedoldId
- the ID being renamed.
See Identifier
newId
- the new ID to be assigned.
See Identifier
public java.lang.Boolean updateGlobalIDReferences(java.lang.String oldId, java.lang.String newId)
Reify
to keep workflow event handlers in
sync with ID changes within the screen. Each processElement or Task that has properties that save global IDs (like a
component ID or criteria referencing ruleContext
) must be able
to update its references on demand by overriding this method or defer to its superclass.
There are a number of helper methods to make this easier listed below.
oldId
- the ID being renamed.
See Identifier
newId
- the new ID to be assigned.
See Identifier
updateGlobalIDInValueProperty(java.lang.String, java.lang.String, java.lang.String)
,
updateGlobalIDInValues(java.util.Map, java.lang.String, java.lang.String)
,
updateGlobalIDInCriteria(com.smartgwt.client.data.AdvancedCriteria, java.lang.String, java.lang.String)
public java.lang.Boolean updateLastElementBindingReferences(java.lang.String oldId, java.lang.String newId)
com.smartgwt.client.tools.WorkflowEditor
to adjust last task references as
new tasks are inserted. Each processElement or Task that has properties supporting taskInputExpressions
using the $last syntax must be able to update its
references on demand by overriding this method or defer to its superclass.
There are a number of helper methods to make this easier listed below.
oldId
- the ID being renamed.
See Identifier
newId
- the new ID to be assigned.
See Identifier
updateLastElementInValueProperty(java.lang.String, java.lang.String)
,
updateLastElementInValues(java.util.Map, java.lang.String)
,
updateLastElementInCriteria(com.smartgwt.client.data.AdvancedCriteria, java.lang.String)
public java.lang.Boolean updateLastElementInCriteria(AdvancedCriteria criteria, java.lang.String taskType)
AdvancedCriteria
Criterion
TaskInputExpression
values containing $last references. Any implicit reference to the last
task is updated to reference a last task of a specified taskType
. For example, a value of "$last.sequenceNo" would be replaced with "$last[fetch].sequenceNo" if the taskType is "fetch". Existing "$last[...]" references are left as-is.
This method is a helper to implement task-specific updateLastElementBindingReferences()
.
criteria
- the criteria to be updated in placetaskType
- the taskType to be used in new referencepublic java.lang.Boolean updateLastElementInValueProperty(java.lang.String propertyName, java.lang.String taskType)
TaskInputExpression
property value containing $last references. Any implicit
reference to the last task is updated to reference a last task of a specified taskType
. For example, a value of "$last.sequenceNo" would be replaced with "$last[fetch].sequenceNo" if the taskType is "fetch". Existing "$last[...]" references are left as-is.
This method is a helper to implement task-specific updateLastElementBindingReferences()
.
propertyName
- the property name to be updated in this tasktaskType
- the taskType to be used in new referencepublic java.lang.Boolean updateLastElementInValues(java.util.Map values, java.lang.String taskType)
TaskInputExpression
values containing $last references. Any implicit
reference to the last task is updated to reference a last task of a specified taskType
. For example, a value of "$last.sequenceNo" would be replaced with "$last[fetch].sequenceNo" if the taskType is "fetch". Existing "$last[...]" references are left as-is.
This method is a helper to implement task-specific updateLastElementBindingReferences()
.
values
- the object to be updatedtaskType
- the taskType to be used in new referencepublic ProcessElement setAttribute(java.lang.String attribute, ProcessElement[] value, boolean allowPostCreate)
public ProcessElement[] getProcessElements(java.lang.String attribute)
public static com.google.gwt.core.client.JavaScriptObject convertToJavaScriptArray(ProcessElement[] array)