public class ServiceTask extends Task
Process which calls a DataSource operation,
optionally using part of the process state as inputs or
storing outputs in the process state. A special "export" operationType is supported to perform a server export
based on criteria. By default a ServiceTask takes the data indicated by inputField and/or inputFieldList as detailed in TaskIO and uses the inputRecord as DSRequest.data. This means the input data becomes Criteria for "fetch" and "export" operations, new record values for an "add" operation, etc.
For simplicity, if no inputFieldList is provided and inputField specifies an object,
inputData is used as dsRequest.data.
Alternatively, you can set criteria for a "fetch" and "export" operations, or values for other operationTypes. In both cases, you have the
ability to use simple expressions like $input.fieldName to take portions of the input data and use it as part of
the criteria or values.
OutputData and outputFieldList work as filters. You should determine which properties should be fetched into the process state. If you want to load all data without defining every property manually you can pass a name started with '$' and fetched record or records will be placed as a record or an array of records by the name without this specific symbol.
For example if you specify 'id' and 'name' in outputFieldList, only these properties will be fetched in the process state. If you pass '$orderHeader' in outputField a whole record will be stored in process state under the 'orderHeader' key.
config, configOnly, factoryCreated, factoryProperties, id, scClassName| Constructor and Description |
|---|
ServiceTask() |
ServiceTask(com.google.gwt.core.client.JavaScriptObject jsObj) |
| Modifier and Type | Method and Description |
|---|---|
com.google.gwt.core.client.JavaScriptObject |
create() |
Criteria |
getCriteria()
Criteria (including AdvancedCriteria) to use for "fetch" and "export" operations.
|
DataSource |
getDataSource()
DataSource ID or DataSource instance to be used.
|
ExportFormat |
getExportFormat()
The format in which the data should be exported.
|
java.lang.String |
getFailureElement()
ID of the next sequence or element to proceed to if a failure condition arises from DataSource operation.
|
Criteria |
getFixedCriteria()
Criteria to be submitted as part of the DSRequest, regardless of inputs to the task.
|
Record |
getFixedValues()
Values to be submitted as part of the DSRequest, regardless of inputs to the task.
|
java.lang.String |
getOperationId()
The
operationId to invoke. |
DSOperationType |
getOperationType()
Type of operation to invoke.
|
static ServiceTask |
getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj) |
java.lang.String |
getOutputField()
Field in the
process state where this task writes outputs. |
java.lang.String[] |
getOutputFieldList()
List of multiple fields in the
process state where this task
will write outputs. |
java.lang.Boolean |
getPassThruOutput()
Does this processElement pass through output from the last executed task (i.e.
|
Record |
getValues()
Values to be submitted for "update", "add" and "remove" operations.
|
ServiceTask |
setCriteria(Criteria criteria)
Criteria (including AdvancedCriteria) to use for "fetch" and "export" operations.
|
void |
setDataSource(DataSource dataSource)
DataSource ID or DataSource instance to be used.
|
void |
setDataSource(java.lang.String dataSource)
DataSource ID or DataSource instance to be used.
|
ServiceTask |
setExportFormat(ExportFormat exportFormat)
The format in which the data should be exported.
|
ServiceTask |
setFailureElement(java.lang.String failureElement)
ID of the next sequence or element to proceed to if a failure condition arises from DataSource operation.
|
ServiceTask |
setFixedCriteria(Criteria fixedCriteria)
Criteria to be submitted as part of the DSRequest, regardless of inputs to the task.
|
ServiceTask |
setFixedValues(Record fixedValues)
Values to be submitted as part of the DSRequest, regardless of inputs to the task.
|
ServiceTask |
setOperationId(java.lang.String operationId)
The
operationId to invoke. |
ServiceTask |
setOperationType(DSOperationType operationType)
Type of operation to invoke.
|
ServiceTask |
setOutputField(java.lang.String outputField)
Field in the
process state where this task writes outputs. |
ServiceTask |
setOutputFieldList(java.lang.String... outputFieldList)
List of multiple fields in the
process state where this task
will write outputs. |
ServiceTask |
setPassThruOutput(java.lang.Boolean passThruOutput)
Does this processElement pass through output from the last executed task (i.e.
|
ServiceTask |
setValues(Record values)
Values to be submitted for "update", "add" and "remove" operations.
|
getInputField, getInputFieldList, getOutputExpression, setInputField, setInputFieldList, setOutputExpressionconvertToJavaScriptArray, getClassDescription, getDescription, getEditorType, getElementDescription, getID, getJsObj, getNextElement, getOrCreateJsObj, getProcessElements, getTitle, isCreated, onInit, setAttribute, setClassDescription, setDescription, setEditorType, setID, setJavaScriptObject, setNextElement, setTitleaddDynamicProperty, 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, setScClassNamepublic ServiceTask()
public ServiceTask(com.google.gwt.core.client.JavaScriptObject jsObj)
public static ServiceTask getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)
public ServiceTask setCriteria(Criteria criteria) throws java.lang.IllegalStateException
Data values in this criteria
prefixed with "$" will be treated as dynamic expressions which can access the inputs to this task as $input - see TaskInputExpression. Specifically, this means that for simple criteria, any property value
that is a String and is prefixed with "$" will be assumed to be an expression, and for AdvancedCriteria, the same
treatment will be applied to Criterion.value.
If any data value
should not be treated as dynamic (for example, a "$" should be taken as literal), you can place it in fixedCriteria instead.
Ignored for any operationType
other than "fetch" and "export". Update or delete operations should place the primary key to update in values.
This property supports DynamicCriteria - use Criterion.valuePath to refer to values in the Process.ruleScope.
criteria - New criteria value. Default value is nullServiceTask instance, for chaining setter callsjava.lang.IllegalStateException - this property cannot be changed after the underlying component has been createdTaskIO overview and related methodspublic Criteria getCriteria()
Data values in this criteria
prefixed with "$" will be treated as dynamic expressions which can access the inputs to this task as $input - see TaskInputExpression. Specifically, this means that for simple criteria, any property value
that is a String and is prefixed with "$" will be assumed to be an expression, and for AdvancedCriteria, the same
treatment will be applied to Criterion.value.
If any data value
should not be treated as dynamic (for example, a "$" should be taken as literal), you can place it in fixedCriteria instead.
Ignored for any operationType
other than "fetch" and "export". Update or delete operations should place the primary key to update in values.
This property supports DynamicCriteria - use Criterion.valuePath to refer to values in the Process.ruleScope.
TaskIO overview and related methodspublic ServiceTask setExportFormat(ExportFormat exportFormat) throws java.lang.IllegalStateException
ExportFormat for more
information.exportFormat - New exportFormat value. Default value is "csv"ServiceTask instance, for chaining setter callsjava.lang.IllegalStateException - this property cannot be changed after the underlying component has been createdpublic ExportFormat getExportFormat()
ExportFormat for more
information.public ServiceTask setFailureElement(java.lang.String failureElement) throws java.lang.IllegalStateException
failureElement - New failureElement value. Default value is nullServiceTask instance, for chaining setter callsjava.lang.IllegalStateException - this property cannot be changed after the underlying component has been createdpublic java.lang.String getFailureElement()
public ServiceTask setFixedCriteria(Criteria fixedCriteria) throws java.lang.IllegalStateException
Task.inputField or with criteria if specified, via DataSource.combineCriteria().fixedCriteria - New fixedCriteria value. Default value is nullServiceTask instance, for chaining setter callsjava.lang.IllegalStateException - this property cannot be changed after the underlying component has been createdpublic Criteria getFixedCriteria()
Task.inputField or with criteria if specified, via DataSource.combineCriteria().public ServiceTask setFixedValues(Record fixedValues) throws java.lang.IllegalStateException
Task.inputField or with values if specified, via simple copying of fields, with
fixedValues overwriting values provided by the inputField, but explicitly specified values overriding fixedValues.fixedValues - New fixedValues value. Default value is nullServiceTask instance, for chaining setter callsjava.lang.IllegalStateException - this property cannot be changed after the underlying component has been createdpublic Record getFixedValues()
Task.inputField or with values if specified, via simple copying of fields, with
fixedValues overwriting values provided by the inputField, but explicitly specified values overriding fixedValues.public ServiceTask setOperationId(java.lang.String operationId) throws java.lang.IllegalStateException
operationId to invoke.operationId - New operationId value. Default value is nullServiceTask instance, for chaining setter callsjava.lang.IllegalStateException - this property cannot be changed after the underlying component has been createdpublic java.lang.String getOperationId()
operationId to invoke.public ServiceTask setOperationType(DSOperationType operationType) throws java.lang.IllegalStateException
operationType - New operationType value. Default value is "fetch"ServiceTask instance, for chaining setter callsjava.lang.IllegalStateException - this property cannot be changed after the underlying component has been createdpublic DSOperationType getOperationType()
public ServiceTask setOutputField(java.lang.String outputField) throws java.lang.IllegalStateException
process state where this task writes outputs.
See TaskIO. See outputFieldList for a shorthand method to save the
full operation response data.
setOutputField in class TaskoutputField - New outputField value. Default value is nullServiceTask instance, for chaining setter callsjava.lang.IllegalStateException - this property cannot be changed after the underlying component has been createdTaskIO overview and related methodspublic java.lang.String getOutputField()
process state where this task writes outputs.
See TaskIO. See outputFieldList for a shorthand method to save the
full operation response data.
getOutputField in class TaskTaskIO overview and related methodspublic ServiceTask setOutputFieldList(java.lang.String... outputFieldList) throws java.lang.IllegalStateException
process state where this task
will write outputs. See TaskIO. If outputField is also specified, it will be implicitly added
to the outputFieldList if it is not already present.
In addition to pulling individual fields from the
task operation result and placing them into the process state the full response data can also be written into the
process state without specifying individual fields. Prefix a destination field path with a "$" (ex. $orderHeader) causes
the entire dsResponse.data to be saved.
setOutputFieldList in class TaskoutputFieldList - New outputFieldList value. Default value is nullServiceTask instance, for chaining setter callsjava.lang.IllegalStateException - this property cannot be changed after the underlying component has been createdTaskIO overview and related methodspublic java.lang.String[] getOutputFieldList()
process state where this task
will write outputs. See TaskIO. If outputField is also specified, it will be implicitly added
to the outputFieldList if it is not already present.
In addition to pulling individual fields from the
task operation result and placing them into the process state the full response data can also be written into the
process state without specifying individual fields. Prefix a destination field path with a "$" (ex. $orderHeader) causes
the entire dsResponse.data to be saved.
getOutputFieldList in class TaskTaskIO overview and related methodspublic ServiceTask setPassThruOutput(java.lang.Boolean passThruOutput) throws java.lang.IllegalStateException
taskInputExpressions for details on the transient state.setPassThruOutput in class ProcessElementpassThruOutput - New passThruOutput value. Default value is falseServiceTask instance, for chaining setter callsjava.lang.IllegalStateException - this property cannot be changed after the underlying component has been createdpublic java.lang.Boolean getPassThruOutput()
taskInputExpressions for details on the transient state.getPassThruOutput in class ProcessElementpublic ServiceTask setValues(Record values) throws java.lang.IllegalStateException
Similar to Criteria, data values prefixed with "$" will be treated as a TaskInputExpression. Use fixedValues for any values that start with "$" but should be treated as a literal.
values - New values value. Default value is nullServiceTask instance, for chaining setter callsjava.lang.IllegalStateException - this property cannot be changed after the underlying component has been createdpublic Record getValues()
Similar to Criteria, data values prefixed with "$" will be treated as a TaskInputExpression. Use fixedValues for any values that start with "$" but should be treated as a literal.
public DataSource getDataSource()
public void setDataSource(java.lang.String dataSource)
dataSource - dataSource Default value is nullpublic void setDataSource(DataSource dataSource)
dataSource - dataSource Default value is null