public interface TaskIO
Process state
when the task is started, and "outputs", which are atomically applied to the Process
state when a task is completed.
Tasks can use Task.inputField
to
specify the field from the Process state that
should be used as inputs, and Task.outputField
to specify the field in the
Process state that the task should write output.
More complex tasks can take multiple fields from the process state via
Task.inputFieldList
and write
to multiple fields of the process state via
Task.outputFieldList
. In this
case, the task is said to have an "input Record"
and/or "output Record", which is a copy of the process state Record
with only the fields listed in the inputFieldList
copied.
When both inputField
and inputFieldList
are specified, the
inputField is considered the "primary" input field and will be used automatically by
various Task subclasses.
An additional option for output is provided in Task.outputExpression
to write
task output directly into another DataBoundComponent
instead of or in addition
to the process state. See details below.
inputData
represents the result of the inputField
processing
and inputRecord
represents the result of the inputFieldList
.
If the Process.state
represented in
JSON is:
{ orderId:5, orderItems: [ {name:"Pencils", quantity:3, itemId:2344} ], orderUser: { name:"Henry Winkle", address:"...", ... } }Consider these input definitions and resulting
inputData
and
inputRecord
:
inputField
is implicitly added to the inputRecord
as a field with the same name.
Task.outputExpression
can
be specified to write task output directly into
another DataBoundComponent
instead of or in addition to the
process state.
An output expression is a String prefixed with "$" followed by the DataBoundComponent ID and optionally followed by a dot-separated field name. When no optional field name is specified the task output is written to the target component using setValues() or setData(). With the optional field name, the task output is written to the target with setFieldValue() or setEditValue(). For a ListGrid the row is either the current edit row or the one selected row.
As an example, consider a DynamicForm with ID of "orderHeader". By specifying an
outputExpression
as "$orderHeader" for a fetch ServiceTask the response
record will be assigned directly to the DynamicForm.
ScriptTask.getInputData()
,
ScriptTask.setOutputData(java.lang.Object)
,
ScriptTask.getInputRecord()
,
ScriptTask.setOutputRecord(com.smartgwt.client.data.Record)
,
Task.getInputField()
,
Task.getInputFieldList()
,
Task.getOutputField()
,
Task.getOutputFieldList()
,
Task.getOutputExpression()
,
ServiceTask.getCriteria()
,
ServiceTask.getOutputField()
,
ServiceTask.getOutputFieldList()