public class ActionBlock
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Class and Description |
---|---|
class |
ActionBlock.Action |
class |
ActionBlock.BlockProperty |
class |
ActionBlock.ReturnProperty |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COMMAND_ACTION |
static java.lang.String |
COMMAND_ACTIONBLOCK |
static java.lang.String |
COMMAND_UNKNOWN |
Constructor and Description |
---|
ActionBlock()
Default contructor
|
ActionBlock(org.json.JSONObject jsonObject)
Contructor based on JSONObject
|
ActionBlock(java.lang.String xml)
Contructor based on xml definition
|
ActionBlock(java.lang.String name,
java.lang.String xml)
Contructor based on a name (for performance monitoring) and an xml definition
|
Modifier and Type | Method and Description |
---|---|
void |
addActionBlockCommand(ActionBlock actionBlock)
Internal method.
|
void |
addBlockPropertyCommand(java.lang.String propertyid,
java.lang.String value)
Internal method.
|
void |
addChildCaseActionBlock(java.lang.String caseValue,
ActionBlock childActionBlock)
Internal method.
|
void |
addReturnPropertyCommand(java.lang.String propertyid,
java.lang.String value)
Internal method.
|
void |
endProcessing()
Internal method.
|
ActionBlock.Action |
getAction(java.lang.String name)
Internal method.
|
ActionBlock |
getActionBlock(int index)
Internal method.
|
java.lang.String |
getActionClass(int actionindex)
Returns the actionclass for the given index of an acion in the block
|
java.lang.String |
getActionClass(java.lang.String name)
Returns the action class for the given action block name
|
int |
getActionCount()
Returns the number of actions defined in the block.
|
java.lang.String |
getActionid(int actionindex)
Returns the actionid for the given index of an acion in the block
|
java.lang.String |
getActionid(java.lang.String name)
Returns the actionid for the given action block name
|
java.lang.String |
getActionName(int actionindex)
Returns the name of an action for the given index
|
java.util.HashMap |
getActionProperties(int actionindex)
Gets the property values for the given Action in the Block.
|
java.util.HashMap |
getActionProperties(java.lang.String name)
Gets the property values for the given Action in the Block.
|
java.lang.String |
getActionProperty(int actionindex,
java.lang.String propertyid)
Gets a property value for the given Action in the Block.
|
java.lang.String |
getActionProperty(java.lang.String name,
java.lang.String propertyid)
Gets a property value for the given Action in the Block.
|
java.lang.String |
getActionTest(int actionindex)
Returns the test for the given index of an acion in the block
|
java.lang.String |
getAsyncDueDt()
Returns the due date for action block when executed asynchronously
|
java.util.HashMap |
getBlockProperties()
Returns a pointer to all of the actionblock properties
|
java.lang.String |
getBlockProperty(java.lang.String propertyid)
Returns a single block property.
|
java.lang.String |
getCaseValue() |
ActionBlock |
getChildCaseActionBlock(java.lang.String caseValue) |
java.lang.Object |
getCommand(int index)
Internal method.
|
int |
getCommandCount()
Internal method.
|
java.lang.String |
getDebugLog()
Returns the debug log
|
java.util.List<java.lang.String> |
getDistinctActionClasses() |
java.util.List<java.lang.String> |
getDistinctActions() |
int |
getErrorAction()
Returns the current error action number (-1 if no error action)
|
java.lang.String |
getErrorActionName()
Returns the current error action name (empty string if no error action)
|
ErrorHandler |
getErrorHandler()
Internal method.
|
java.util.HashMap |
getGroovyBindings()
Returns a pointer to all of the actionblock properties
|
java.lang.String |
getName()
Returns the name assigned to the action block
|
java.util.HashMap |
getReturnProperties()
Returns a pointer to all of the actionblock properties
|
java.lang.String |
getReturnProperty(java.lang.String propertyid)
Returns a single block property.
|
java.lang.String |
getTest()
Internal method.
|
java.lang.String |
getTest(java.lang.String name)
Returns the test for the given action block name
|
java.lang.String |
getTestName()
Returns the label assigned to the action block test condition
|
java.lang.String |
getTodolistid() |
java.lang.String |
getVersionid(int actionindex)
Returns the versionid for the given index of an acion in the block
|
java.lang.String |
getVersionid(java.lang.String name)
Returns the versionid for the given action block name
|
boolean |
hasChildCaseActionBlock() |
boolean |
isDebugMode()
Whether the actionblock is in debug mode
|
void |
log(java.lang.String message)
Internal method.
|
void |
setAction(java.lang.String name,
java.lang.String actionid,
java.lang.String versionid)
Creates a new action inside the action block and initialize its properties.
|
void |
setAction(java.lang.String name,
java.lang.String actionid,
java.lang.String versionid,
java.util.HashMap properties)
Creates a new action inside the action block and initialize its properties.
|
void |
setAction(java.lang.String name,
java.lang.String actionid,
java.lang.String versionid,
PropertyList properties)
Creates a new action inside the action block and initialize its properties.
|
void |
setAction(java.lang.String name,
java.lang.String test,
java.lang.String actionClass,
java.lang.String actionid,
java.lang.String versionid,
java.util.HashMap hmProperties)
Internal method.
|
void |
setAction(java.lang.String name,
java.lang.String test,
java.lang.String actionClass,
java.lang.String actionid,
java.lang.String versionid,
PropertyList properties)
Internal method.
|
void |
setActionBlockProperty(java.lang.String name,
java.lang.String blockpropertyid,
java.lang.String actionpropertyid)
Sets a block property based on an action output property.
|
void |
setActionClass(java.lang.String name,
java.lang.String actionClass)
Creates a new action inside the action block and initialize its properties.
|
void |
setActionClass(java.lang.String name,
java.lang.String actionClass,
java.util.HashMap properties)
Creates a new action inside the action block and initialize its properties.
|
void |
setActionClass(java.lang.String name,
java.lang.String actionClass,
PropertyList properties)
Creates a new action inside the action block and initialize its properties.
|
void |
setActionLabel(java.lang.String actionName,
java.lang.String actionlabel)
Internal method.
|
void |
setActionProperties(int actionindex,
java.util.HashMap properties)
Sets the property values for the given Action in the Block.
|
void |
setActionProperties(int actionindex,
PropertyList properties)
Sets the property values for the given Action in the Block.
|
void |
setActionProperties(java.lang.String name,
java.util.HashMap properties)
Sets the property values for the given Action in the Block.
|
void |
setActionProperties(java.lang.String name,
PropertyList properties)
Sets the property values for the given Action in the Block.
|
void |
setActionProperty(java.lang.String name,
java.lang.String propertyid,
java.lang.String value)
Sets a property value for the given Action in the Block.
|
void |
setAsyncDueDt(java.lang.String asyncDueDt)
Sets a due date for action blocks executed asynchronously
|
void |
setBlockProperties(java.util.HashMap properties)
Sets a collection of properties for the action block.
|
void |
setBlockProperties(PropertyList properties)
Sets a collection of properties for the action block.
|
void |
setBlockProperty(java.lang.String propertyid,
java.lang.String value)
Sets a single property for the block.
|
void |
setCaseValue(java.lang.String caseValue) |
void |
setDebugLog(java.lang.String log)
Internal method.
|
void |
setDebugMode(boolean debugMode)
Put the actionblock into Debug mode
|
void |
setErrorAction(int errorAction)
Sets the current error action number (-1 if no error action)
|
void |
setGroovyBindings(java.util.HashMap bindings)
Sets a collection of binding maps for the Groovy expressions
|
void |
setJSONObject(org.json.JSONObject jsonObject)
Populates an action block based on a xml definition
|
void |
setName(java.lang.String name)
Populates an action block based on a xml definition
|
void |
setReturnProperties(java.util.HashMap properties)
Sets a collection of properties for the action block.
|
void |
setReturnProperties(PropertyList properties)
Sets a collection of properties for the action block.
|
void |
setReturnProperty(java.lang.String propertyid,
java.lang.String value)
Sets a single property for the block.
|
void |
setTest(java.lang.String test)
Sets a conditional test for the action block.
|
void |
setTestName(java.lang.String testName)
Sets a label for the conditional test for the action block.
|
void |
setTodolistid(java.lang.String todolistid) |
void |
setXML(java.lang.String xml)
Populates an action block based on a xml definition
|
void |
startProcessing()
Internal method.
|
void |
synchronizeProperties(ActionBlock returnactionblock)
Internal method.
|
org.json.JSONObject |
toJSONObject() |
java.lang.String |
toJSONString()
Public toJSON
|
java.lang.String |
toString()
Public toString
|
java.lang.String |
toXML()
Public toXML
|
public static final java.lang.String COMMAND_ACTION
public static final java.lang.String COMMAND_ACTIONBLOCK
public static final java.lang.String COMMAND_UNKNOWN
public ActionBlock()
public ActionBlock(java.lang.String name, java.lang.String xml) throws SapphireException
SapphireException
public ActionBlock(java.lang.String xml) throws SapphireException
SapphireException
public ActionBlock(org.json.JSONObject jsonObject) throws SapphireException
SapphireException
public void setXML(java.lang.String xml) throws SapphireException
xml
- XML String containing actionblocks, actions, properties and returnsSapphireException
public void setJSONObject(org.json.JSONObject jsonObject) throws SapphireException
jsonObject
- JSON Object containing actionblocks, actions, properties and returnsSapphireException
public java.lang.String getName()
public java.lang.String getTestName()
public void setName(java.lang.String name)
name
- name A name for the action block to be used for monitoring performance statspublic java.lang.String getCaseValue()
public void setCaseValue(java.lang.String caseValue)
public java.lang.String getAsyncDueDt()
public void setAsyncDueDt(java.lang.String asyncDueDt)
asyncDueDt
- Due datepublic java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toXML()
public java.lang.String toJSONString()
public org.json.JSONObject toJSONObject()
public void setTest(java.lang.String test)
test
- A groovy expression that determines whether this actionblock should execute or notpublic void setTestName(java.lang.String testName)
testName
- A label for a conditional test in a actionblockpublic void setGroovyBindings(java.util.HashMap bindings)
bindings
- A HashMap of bindings for the block.public java.util.HashMap getGroovyBindings()
public void setBlockProperties(java.util.HashMap properties)
properties
- A HashMap of properties for the block.public void setBlockProperties(PropertyList properties)
properties
- A PropertyList of properties for the block.public void setBlockProperty(java.lang.String propertyid, java.lang.String value)
propertyid
- The property identifier.value
- The property value.public java.lang.String getBlockProperty(java.lang.String propertyid)
propertyid
- The property identifier.public java.util.HashMap getBlockProperties()
public void setReturnProperties(java.util.HashMap properties)
properties
- A HashMap of properties for the block.public void setReturnProperties(PropertyList properties)
properties
- A PropertyList of properties for the block.public void setReturnProperty(java.lang.String propertyid, java.lang.String value)
propertyid
- The property identifier.value
- The property value.public java.util.HashMap getReturnProperties()
public java.lang.String getReturnProperty(java.lang.String propertyid)
propertyid
- The property identifier.public void setAction(java.lang.String name, java.lang.String actionid, java.lang.String versionid) throws ActionException
name
- Unique name used to identify the action inside the block.actionid
- Identifier of the Sapphire server-side action to be processed.versionid
- Version of the action to be processed.ActionException
- When the action already exists or the action identifier/version are incorrect.public void setAction(java.lang.String name, java.lang.String actionid, java.lang.String versionid, java.util.HashMap properties) throws ActionException
name
- Unique name used to identify the action inside the block.actionid
- Identifier of the Sapphire server-side action to be processed.versionid
- Version of the action to be processed.properties
- A HashMap of properties that you want for the action in a String/String key/value pair.ActionException
- When the action already exists or the action identifier/version are incorrect.public void setAction(java.lang.String name, java.lang.String actionid, java.lang.String versionid, PropertyList properties) throws ActionException
name
- Unique name used to identify the action inside the block.actionid
- Identifier of the Sapphire server-side action to be processed.versionid
- Version of the action to be processed.properties
- The properties that you want for the action in a String/String key/value pair.ActionException
- When the action already exists or the action identifier/version are incorrect.public void setActionClass(java.lang.String name, java.lang.String actionClass) throws ActionException
name
- Unique name used to identify the action inside the block.actionClass
- An class descendant of BaseActionActionException
- When the action already exists or the action identifier/version are incorrect.public void setActionClass(java.lang.String name, java.lang.String actionClass, java.util.HashMap properties) throws ActionException
name
- Unique name used to identify the action inside the block.actionClass
- An class descendant of BaseActionproperties
- A HashMap of properties that you want for the action in a String/String key/value pair.ActionException
- When the action already exists or the action identifier/version are incorrect.public void setActionClass(java.lang.String name, java.lang.String actionClass, PropertyList properties) throws ActionException
name
- Unique name used to identify the action inside the block.actionClass
- An class descendant of BaseActionproperties
- The properties that you want for the action in a String/String key/value pair.ActionException
- When the action already exists or the action identifier/version are incorrect.public void setActionProperty(java.lang.String name, java.lang.String propertyid, java.lang.String value) throws ActionException
name
- Unique identifier used to identify the action inside the block.propertyid
- The property that you want to update.value
- The value of the property.ActionException
- When the action does not exist or the property identifier/value pair is invalid.public java.lang.String getActionProperty(java.lang.String name, java.lang.String propertyid) throws ActionException
name
- Unique identifier used to identify the action inside the block.propertyid
- The property identifier.ActionException
- When the action name does not exist or the property identifier is invalid.public java.lang.String getActionProperty(int actionindex, java.lang.String propertyid) throws ActionException
actionindex
- Index used to identify the action inside the block.propertyid
- The property identifier.ActionException
- When the action name does not exist or the property identifier is invalid.public void setActionProperties(java.lang.String name, java.util.HashMap properties) throws ActionException
name
- Unique identifier used to identify the action inside the block.properties
- A HashMap of properties for the action.ActionException
- When the action name does not exist or the properties are null.public void setActionProperties(java.lang.String name, PropertyList properties) throws ActionException
name
- Unique identifier used to identify the action inside the block.properties
- The properties for the action.ActionException
- When the action name does not exist or the properties are null.public void setActionProperties(int actionindex, java.util.HashMap properties) throws ActionException
actionindex
- Unique identifier used to identify the action inside the block.properties
- A HashMap of properties for the action.ActionException
- When the action index is invalid or the properties are null.public void setActionProperties(int actionindex, PropertyList properties) throws ActionException
actionindex
- Unique identifier used to identify the action inside the block.properties
- The properties for the action.ActionException
- When the action index is invalid or the properties are null.public java.util.HashMap getActionProperties(java.lang.String name) throws ActionException
name
- Unique identifier used to identify the action inside the block.ActionException
- When the action name does not exist.public java.util.HashMap getActionProperties(int actionindex) throws ActionException
actionindex
- The index of the action in the blockActionException
- When the action name does not exist.public int getActionCount()
public ActionBlock getChildCaseActionBlock(java.lang.String caseValue)
public boolean hasChildCaseActionBlock()
public java.util.List<java.lang.String> getDistinctActions()
public java.util.List<java.lang.String> getDistinctActionClasses()
public java.lang.String getActionName(int actionindex) throws ActionException
ActionException
- When the index is invalid for the block.public java.lang.String getActionid(java.lang.String name) throws ActionException
name
- The name of the action in the block.ActionException
- When the name is invalid for the block.public java.lang.String getActionid(int actionindex) throws ActionException
actionindex
- The index of the action in the block.ActionException
- When the index is invalid for the block.public java.lang.String getActionClass(java.lang.String name) throws ActionException
name
- The name of the action in the block.ActionException
- When the name is invalid for the block.public java.lang.String getActionClass(int actionindex) throws ActionException
actionindex
- The index of the action in the block.ActionException
- When the index is invalid for the block.public java.lang.String getVersionid(java.lang.String name) throws ActionException
name
- The name of the action in the block.ActionException
- When the name is invalid for the block.public java.lang.String getVersionid(int actionindex) throws ActionException
actionindex
- The index of the action in the block.ActionException
- When the index is invalid for the block.public java.lang.String getTest(java.lang.String name) throws ActionException
name
- The name of the action in the block.ActionException
- When the name is invalid for the block.public java.lang.String getActionTest(int actionindex) throws ActionException
actionindex
- The index of the action in the block.ActionException
- When the index is invalid for the block.public void setActionBlockProperty(java.lang.String name, java.lang.String blockpropertyid, java.lang.String actionpropertyid) throws ActionException
name
- The name of the actionblockpropertyid
- The property that you want to updateactionpropertyid
- The name of the property for the given action blockActionException
- When the name is invalid for the block.public int getErrorAction()
public void setErrorAction(int errorAction)
errorAction
- the number of the action in errorpublic void setDebugMode(boolean debugMode)
debugMode
- whether the actionblock is in debug mode or notpublic boolean isDebugMode()
public java.lang.String getDebugLog()
public java.lang.String getErrorActionName()
public ErrorHandler getErrorHandler()
public ActionBlock.Action getAction(java.lang.String name) throws ActionException
ActionException
public java.lang.String getTodolistid()
public void setTodolistid(java.lang.String todolistid)
public void synchronizeProperties(ActionBlock returnactionblock) throws ActionException
ActionException
public void setAction(java.lang.String name, java.lang.String test, java.lang.String actionClass, java.lang.String actionid, java.lang.String versionid, PropertyList properties) throws ActionException
ActionException
public void setAction(java.lang.String name, java.lang.String test, java.lang.String actionClass, java.lang.String actionid, java.lang.String versionid, java.util.HashMap hmProperties) throws ActionException
ActionException
public void setActionLabel(java.lang.String actionName, java.lang.String actionlabel) throws ActionException
ActionException
public void addActionBlockCommand(ActionBlock actionBlock) throws ActionException
ActionException
public void addChildCaseActionBlock(java.lang.String caseValue, ActionBlock childActionBlock)
public void addBlockPropertyCommand(java.lang.String propertyid, java.lang.String value) throws ActionException
ActionException
public void addReturnPropertyCommand(java.lang.String propertyid, java.lang.String value) throws ActionException
ActionException
public void startProcessing()
public void endProcessing()
public void setDebugLog(java.lang.String log)
public void log(java.lang.String message)
public int getCommandCount()
public java.lang.String getTest()
public ActionBlock getActionBlock(int index)
public java.lang.Object getCommand(int index)