|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.smartgwt.client.core.BaseClass
com.smartgwt.client.util.workflow.ProcessElement
com.smartgwt.client.util.workflow.Task
com.smartgwt.client.util.workflow.ServiceTask
public class ServiceTask
A ServiceTask is an element of a Process which calls a DataSource operation,
optionally using part of the process state as inputs or
storing outputs in the process state.
By default a ServiceTask takes the data indicated by inputField and uses it as data. This means the input data becomes Critera for a "fetch" operation, new record values for an
"add" operation, etc.
Alternatively, you can set criteria for a "fetch" operation, 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.
As a special case, if the
inputField is an atomic value (just a String or Number rather than a Record) and operationType is "fetch",
it will be assumed to be value for the primary key field of the target DataSource if criteria is not explicitly specified
| Field Summary |
|---|
| Fields inherited from class com.smartgwt.client.core.BaseClass |
|---|
config, id, scClassName |
| Constructor Summary | |
|---|---|
ServiceTask()
|
|
ServiceTask(JavaScriptObject jsObj)
|
|
ServiceTask(String ID)
|
|
| Method Summary | |
|---|---|
JavaScriptObject |
create()
|
Criteria |
getCriteria()
Criteria (including AdvancedCriteria) to use for a "fetch" operation. |
DataSource |
getDataSource()
DataSource ID or DataSource instance to be used. |
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. |
DSOperationType |
getOperationType()
Type of operation to invoke |
static ServiceTask |
getOrCreateRef(JavaScriptObject jsObj)
|
Record |
getValues()
Values to be submitted for "update", "add" and "remove" operations. |
void |
setCriteria(Criteria criteria)
Criteria (including AdvancedCriteria) to use for a "fetch" operation. |
void |
setDataSource(DataSource dataSource)
DataSource ID or DataSource instance to be used. |
void |
setDataSource(String dataSource)
DataSource ID or DataSource instance to be used. |
void |
setFixedCriteria(Criteria fixedCriteria)
Criteria to be submitted as part of the DSRequest, regardless of inputs to the task. |
void |
setFixedValues(Record fixedValues)
Values to be submitted as part of the DSRequest, regardless of inputs to the task. |
void |
setOperationType(DSOperationType operationType)
Type of operation to invoke |
void |
setValues(Record values)
Values to be submitted for "update", "add" and "remove" operations. |
| Methods inherited from class com.smartgwt.client.util.workflow.Task |
|---|
getInputField, getInputFields, getOutputField, getOutputFields, setInputField, setInputFields, setOutputField, setOutputFields |
| Methods inherited from class com.smartgwt.client.util.workflow.ProcessElement |
|---|
convertToJavaScriptArray, getID, getJsObj, getNextElement, getOrCreateJsObj, getProcessElements, isCreated, setAttribute, setID, setNextElement |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ServiceTask()
public ServiceTask(JavaScriptObject jsObj)
public ServiceTask(String ID)
| Method Detail |
|---|
public static ServiceTask getOrCreateRef(JavaScriptObject jsObj)
public JavaScriptObject create()
create in class Task
public void setCriteria(Criteria criteria)
throws 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 com.smartgwt.client.docs.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 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". Update or delete operations should place the primary key to update in values.
criteria - criteria Default value is null
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 com.smartgwt.client.docs.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 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". Update or delete operations should place the primary key to update in values.
TaskIO overview and related methods
public void setFixedCriteria(Criteria fixedCriteria)
throws IllegalStateException
inputField or with criteria if specified, via DataSource.combineCriteria.
fixedCriteria - fixedCriteria Default value is null
IllegalStateException - this property cannot be changed after the underlying component has been createdpublic Criteria getFixedCriteria()
inputField or with criteria if specified, via DataSource.combineCriteria.
public void setFixedValues(Record fixedValues)
throws IllegalStateException
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 - fixedValues Default value is null
IllegalStateException - this property cannot be changed after the underlying component has been createdpublic Record getFixedValues()
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 void setOperationType(DSOperationType operationType)
throws IllegalStateException
operationType - operationType Default value is "fetch"
IllegalStateException - this property cannot be changed after the underlying component has been createdpublic DSOperationType getOperationType()
public void setValues(Record values)
throws IllegalStateException
Similar to Criteria, data values prefixed with "$" will be treated as a com.smartgwt.client.docs.TaskInputExpression. Use fixedValues for any values that start with "$" but should be treated as a literal.
values - values Default value is null
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 com.smartgwt.client.docs.TaskInputExpression. Use fixedValues for any values that start with "$" but should be treated as a literal.
public DataSource getDataSource()
public void setDataSource(String dataSource)
dataSource - dataSource Default value is nullpublic void setDataSource(DataSource dataSource)
dataSource - dataSource Default value is null
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||