public class YDataHandler
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
INPUT |
static int |
INPUT_OUTPUT |
static int |
LOCAL |
static int |
OUTPUT |
Constructor and Description |
---|
YDataHandler()
Creates a new data handler
|
YDataHandler(YSpecification specification)
Creates a new data handler for a specified YAWL specification
|
Modifier and Type | Method and Description |
---|---|
void |
addVariable(java.lang.String decompositionID,
java.lang.String name,
java.lang.String dataType,
java.lang.String namespace,
int scope,
java.lang.String value,
YAttributeMap attributes)
Creates a new variable and adds it to a net or task decomposition.
|
boolean |
changeVariableScope(java.lang.String decompositionID,
java.lang.String variableName,
int oldScope,
int newScope)
Changes the scope of a variable.
|
void |
close()
Disassociates this object from a specification
|
java.util.List<BindingReference> |
getBindingReferences(java.lang.String netVarName)
Gets the specification wide set of binding references for all input and output
bindings to/from the net variable with the name provided
|
java.util.List<BindingReference> |
getBindingReferences(YNet net,
java.lang.String netVarName)
Gets the set of binding references for all input and output
bindings to/from the net variable with the name provided for a net
|
java.util.List<java.lang.String> |
getBuiltInTypeNames() |
org.jdom2.Namespace |
getDataSchemaNamespace() |
java.util.List<java.lang.String> |
getDataTypeNames() |
java.util.List<java.lang.String> |
getInternalTypeNames() |
java.lang.String[] |
getMultiInstanceItemNameAndType(java.lang.String dataType)
Gets the data type and name of the inner element of a list type used as the
formal parameter of an MI task
|
static java.lang.String |
getScopeName(int scope)
A static method to convert a scope identifier into its corresponding name
|
static java.util.List<java.lang.String> |
getScopeNames()
A static method to get all scope names
|
YSpecification |
getSpecification()
Gets the current specification
|
java.util.List<java.lang.String> |
getUserDefinedTypeNames() |
java.lang.String |
getXQuerySuffix(java.lang.String dataType)
Gets the appropriate-for-type suffix for an XQuery
|
void |
removeOutputReferencesToDecomposition(java.lang.String decompositionID)
Removes a decomposition from the current specification.
|
void |
removeVariable(java.lang.String decompositionID,
java.lang.String variableName,
int scope)
Removes a variable from the set of variables of a net or task decomposition.
|
YDecomposition |
renameDecomposition(java.lang.String currentID,
java.lang.String newID)
Updates the id of a net or task decomposition
|
void |
renameVariable(java.lang.String decompositionID,
java.lang.String oldName,
java.lang.String newName,
int scope)
Renames a variable contained by a net or task decomposition.
|
boolean |
setDefaultValue(java.lang.String decompositionID,
java.lang.String variableName,
java.lang.String value)
Sets the default value for an output-only variable (i.e.
|
boolean |
setInitialValue(java.lang.String netID,
java.lang.String variableName,
java.lang.String value)
Sets the initial value for a local (net-level) variable
|
void |
setMIQuery(java.lang.String netID,
java.lang.String taskID,
java.lang.String variableName,
java.lang.String miQuery,
int scope)
Sets a multi-instance query for a task - splitter query if scope is INPUT or
joiner query if scope is OUTPUT
|
void |
setSchema(java.lang.String schema)
Sets the data schema for subsequent validation activities
|
void |
setSpecification(YSpecification specification)
Sets the current specification
|
boolean |
setVariableAttributes(java.lang.String decompositionID,
java.lang.String variableName,
YAttributeMap attributes,
int scope)
Sets or updates the extended attributes of a task-level variable.
|
boolean |
setVariableDataType(java.lang.String decompositionID,
java.lang.String variableName,
java.lang.String dataType,
int scope)
Changes the data type of a variable.
|
boolean |
setVariableDataTypeAndValue(java.lang.String decompositionID,
java.lang.String variableName,
java.lang.String dataType,
java.lang.String value,
int scope)
Changes the data type and value of a variable at the same time.
|
boolean |
setVariableIndex(java.lang.String decompositionID,
java.lang.String variableName,
int scope,
int index)
Sets the sorting index of an input or output variable for either a net or a task
decomposition
|
boolean |
setVariableLogPredicate(java.lang.String decompositionID,
java.lang.String variableName,
YLogPredicate predicate,
int scope)
Sets or updates the log predicate of a task-level variable.
|
void |
setVariableMapping(java.lang.String netID,
java.lang.String taskID,
java.lang.String variableName,
java.lang.String mapping,
int scope)
Sets a mapping for a task variable
|
void |
updateDecompositionReferences(java.lang.String oldID,
java.lang.String newID)
Updates all references to a net or task decomposition in task mappings, when
the net or decomposition has had a name change
|
void |
updateTaskDecompositionReferences(java.util.Set<YTask> taskSet,
java.lang.String oldID,
java.lang.String newID)
Updates all references to a net or task decomposition in task mappings, when
the net or decomposition has had a name change
|
java.util.List<java.lang.String> |
validate(java.lang.String dataType,
java.lang.String value)
Validates a value against type
|
public static final int LOCAL
public static final int INPUT
public static final int OUTPUT
public static final int INPUT_OUTPUT
public YDataHandler()
public YDataHandler(YSpecification specification)
specification
- the specification that this handler will work withpublic static java.lang.String getScopeName(int scope)
scope
- the scope identifierpublic static java.util.List<java.lang.String> getScopeNames()
public YSpecification getSpecification()
public void setSpecification(YSpecification specification)
specification
- the specification that this handler will work withpublic void close()
public YDecomposition renameDecomposition(java.lang.String currentID, java.lang.String newID) throws YDataHandlerException
currentID
- the old net or task decomposition idnewID
- the new net or task decomposition idYDataHandlerException
- if there is no specification associated with this
handler, or it has no decomposition with the specified idpublic void updateDecompositionReferences(java.lang.String oldID, java.lang.String newID) throws YDataHandlerException
oldID
- the old net or task decomposition idnewID
- the new net or task decomposition idYDataHandlerException
- if there is no specification associated with this
handler, or it has no decomposition with the specified idpublic void updateTaskDecompositionReferences(java.util.Set<YTask> taskSet, java.lang.String oldID, java.lang.String newID) throws YDataHandlerException
oldID
- the old net or task decomposition idnewID
- the new net or task decomposition idYDataHandlerException
- if there is no specification associated with this
handler, or it has no decomposition with the specified idpublic void removeOutputReferencesToDecomposition(java.lang.String decompositionID) throws YDataHandlerException
decompositionID
- the id of the decomposition pending removalYDataHandlerException
- if there is no specification associated with this
handler, or it has no decomposition with the specified idpublic void removeVariable(java.lang.String decompositionID, java.lang.String variableName, int scope) throws YDataHandlerException
decompositionID
- the id of the containing net or task decompositionvariableName
- the name of the variable to removescope
- one of INPUT, OUTPUT or LOCALYDataHandlerException
- if there is no specification associated with this
handler, or it has no decomposition with the specified id, or the 'scope'
parameter is LOCAL and the referenced decomposition is not a net, or the 'scope'
parameter is invalidpublic void renameVariable(java.lang.String decompositionID, java.lang.String oldName, java.lang.String newName, int scope) throws YDataHandlerException
decompositionID
- the id of the net or task decompositionoldName
- the current name of the variablenewName
- the new name to assign to the variablescope
- one of INPUT, OUTPUT or LOCALYDataHandlerException
- if there is no specification associated with this
handler, or it has no decomposition with the specified id, or the 'scope'
parameter is LOCAL and the referenced decomposition is not a net, or the 'scope'
parameter is invalidpublic boolean setVariableIndex(java.lang.String decompositionID, java.lang.String variableName, int scope, int index) throws YDataHandlerException
decompositionID
- the id of the containing net or task decompositionvariableName
- the name of the variable to setscope
- one of INPUT, OUTPUT or LOCALindex
- the non-negative index to setYDataHandlerException
- if there is no specification associated with this
handler, or it has no net or task decomposition with the specified id, or the
'scope' parameter is invalid, or the 'index' parameter is negativepublic boolean setInitialValue(java.lang.String netID, java.lang.String variableName, java.lang.String value) throws YDataHandlerException
netID
- the id of the net containing the local variablevariableName
- the name of the local variablevalue
- the initial valueYDataHandlerException
- if there is no specification associated with this
handler, or it has no net decomposition with the specified id, or there is no
local variable found with the specified namepublic boolean setDefaultValue(java.lang.String decompositionID, java.lang.String variableName, java.lang.String value) throws YDataHandlerException
decompositionID
- the net or task decompositionID containing the variablevariableName
- the name of the variablevalue
- the default valueYDataHandlerException
- if there is no specification associated with this
handler, or it has no net or task decomposition with the specified id, or the
decomposition has no output-only parameter of that namepublic void addVariable(java.lang.String decompositionID, java.lang.String name, java.lang.String dataType, java.lang.String namespace, int scope, java.lang.String value, YAttributeMap attributes) throws YDataHandlerException
decompositionID
- the id of the net or task decompositionname
- the variable namedataType
- the variable data typenamespace
- the data type's namespacescope
- one of LOCAL, INPUT, OUTPUT or INPUT_OUTPUT (scope INPUT_OUTPUT will
result in the creation of two variables, one INPUT and one OUTPUT)value
- the initial (if LOCAL) or default (if OUTPUT only) value to assign
to the variable. The value is ignored if the scope is not LOCAL or
OUTPUT only. May be null.attributes
- the extended attributes for the variable. May be null.YDataHandlerException
- if there is no specification associated with this
handler, or it has no net or task decomposition with the specified id, or the
'scope' parameter is invalid, or the net or task decomposition already has a
variable of that namepublic boolean changeVariableScope(java.lang.String decompositionID, java.lang.String variableName, int oldScope, int newScope) throws YDataHandlerException
decompositionID
- the id of the net or task decompositionvariableName
- the name of the variable to changeoldScope
- the variable's current scope, one of LOCAL, INPUT, OUTPUT or
INPUT_OUTPUTnewScope
- the scope to set the variable to, one of LOCAL, INPUT, OUTPUT or
INPUT_OUTPUTYDataHandlerException
- if there is no specification associated with this
handler, or it has no net or task decomposition with the specified id, or the
'oldScope' parameter is invalid, or the 'newScope' parameter is invalidpublic boolean setVariableDataType(java.lang.String decompositionID, java.lang.String variableName, java.lang.String dataType, int scope) throws YDataHandlerException
decompositionID
- the id of the net or task decompositionvariableName
- the name of the variable to changedataType
- the data type to set the variable toscope
- one of LOCAL, INPUT, OUTPUT or INPUT_OUTPUTYDataHandlerException
- if there is no specification associated with this
handler, or it has no net or task decomposition with the specified id, or the
'dataType' parameter is invalid, or the variable has a value that is incompatible
with the new data type, or the 'scope' parameter is invalidpublic boolean setVariableDataTypeAndValue(java.lang.String decompositionID, java.lang.String variableName, java.lang.String dataType, java.lang.String value, int scope) throws YDataHandlerException
decompositionID
- the id of the net or task decompositionvariableName
- the name of the variable to changedataType
- the data type to set the variable toscope
- one of LOCAL, INPUT, OUTPUT or INPUT_OUTPUTvalue
- the new valueYDataHandlerException
- if there is no specification associated with this
handler, or it has no net or task decomposition with the specified id, or the
'dataType' parameter is invalid, or the value is incompatible with the new data
type, or the 'scope' parameter is invalidpublic boolean setVariableAttributes(java.lang.String decompositionID, java.lang.String variableName, YAttributeMap attributes, int scope) throws YDataHandlerException
decompositionID
- the id of the net or task decompositionvariableName
- the name of the variable to changeattributes
- the attributes to set for the variablescope
- one of INPUT, OUTPUT or INPUT_OUTPUTYDataHandlerException
- if there is no specification associated with this
handler, or it has no net or task decomposition with the specified id, or the
'scope' parameter is invalidpublic boolean setVariableLogPredicate(java.lang.String decompositionID, java.lang.String variableName, YLogPredicate predicate, int scope) throws YDataHandlerException
decompositionID
- the id of the net or task decompositionvariableName
- the name of the variable to changepredicate
- the log predicate to set for the variablescope
- one of INPUT, OUTPUT or INPUT_OUTPUTYDataHandlerException
- if there is no specification associated with this
handler, or it has no net or task decomposition with the specified id, or the
'scope' parameter is invalidpublic void setVariableMapping(java.lang.String netID, java.lang.String taskID, java.lang.String variableName, java.lang.String mapping, int scope) throws YDataHandlerException
netID
- the id of the task's containing nettaskID
- the id of the taskvariableName
- the name of the variable to set the mapping for
(task variable name for INPUT, net variable name for OUTPUT)mapping
- the mapping to setscope
- one of INPUT or OUTPUTYDataHandlerException
- if there is no specification associated with this
handler, or it has no net decomposition with the specified id, or there is no task
found with the specified id, or the 'scope' parameter is invalidpublic void setMIQuery(java.lang.String netID, java.lang.String taskID, java.lang.String variableName, java.lang.String miQuery, int scope) throws YDataHandlerException
netID
- the id of the task's containing nettaskID
- the id of the taskvariableName
- the name of the multi-instance variable to set the query formiQuery
- the query to setscope
- one of INPUT or OUTPUTYDataHandlerException
- if there is no specification associated with this
handler, or it has no net decomposition with the specified id, or there is no task
found with the specified id, or the 'scope' parameter is invalidpublic java.util.List<java.lang.String> validate(java.lang.String dataType, java.lang.String value) throws YDataHandlerException
dataType
- the type to validate againstvalue
- the value to validateYDataHandlerException
- if no specification is currently loadedpublic void setSchema(java.lang.String schema) throws YDataHandlerException
schema
- the specification's data schemaYDataHandlerException
- if no specification is currently loadedpublic java.util.List<java.lang.String> getDataTypeNames() throws YDataHandlerException
YDataHandlerException
- if no specification is currently loadedpublic java.util.List<java.lang.String> getBuiltInTypeNames() throws YDataHandlerException
YDataHandlerException
- if no specification is currently loadedpublic java.util.List<java.lang.String> getInternalTypeNames() throws YDataHandlerException
YDataHandlerException
- if no specification is currently loadedpublic java.util.List<java.lang.String> getUserDefinedTypeNames() throws YDataHandlerException
YDataHandlerException
- if no specification is currently loadedpublic org.jdom2.Namespace getDataSchemaNamespace() throws YDataHandlerException
YDataHandlerException
- if no specification is currently loadedpublic java.lang.String[] getMultiInstanceItemNameAndType(java.lang.String dataType) throws YDataHandlerException
dataType
- the MI (list) data typeYDataHandlerException
- if no specification is currently loadedpublic java.lang.String getXQuerySuffix(java.lang.String dataType) throws YDataHandlerException
dataType
- the type to get the suffix forYDataHandlerException
- if no specification is currently loadedpublic java.util.List<BindingReference> getBindingReferences(java.lang.String netVarName) throws YDataHandlerException
netVarName
- the net variable name to search bindings forYDataHandlerException
- if no specification is currently loadedpublic java.util.List<BindingReference> getBindingReferences(YNet net, java.lang.String netVarName) throws YDataHandlerException
net
- the net to searchnetVarName
- the net variable name to search bindings forYDataHandlerException
- if no specification is currently loaded