public class Script_Factory
extends java.lang.Object
| Constructor and Description |
|---|
Script_Factory()
Create a new instance of Script_Factory
|
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
addNamespace(java.lang.String bpelName,
java.lang.String bpelNamespace)
Add the namespace to the element name and return.
|
static java.util.ArrayList<java.lang.String> |
checkFormat(java.lang.String idName)
Check the script id or name.
|
static org.licas_xml.abs.Element |
combineScripts(org.licas_xml.abs.Element mainScript,
org.licas_xml.abs.Element combineWith)
Combine the two scripts by adding the
combineWith elements to the mainScript
element at the appropriate positions, to create a single script. |
static Script_Element |
createNewElement(java.lang.String scriptType)
Create a new element of the specified type.
|
static Script_Element |
createNewElement(java.lang.String scriptType,
java.lang.String elemID)
Create a new element of the specified type.
|
static Script_Element |
createNewElement(java.lang.String scriptType,
java.lang.String elemID,
Script_Element addTo)
Create a new element of the specified type.
|
static Script_Element |
elementFromScript(org.licas_xml.abs.Element scriptXml,
Script_Element addTo)
Create a new element based on the xml description.
|
static java.util.ArrayList<java.lang.String> |
filterNames()
Get a list of known output variable id names.
|
static org.licas_xml.abs.Element |
functionElement(org.licas_xml.abs.Element scriptElem)
Get the function element from the script element if there is one.
|
static java.util.ArrayList<java.lang.String> |
getAttrValues(org.licas_xml.abs.Element scriptXml,
java.util.ArrayList<java.lang.String> attrNames,
boolean subElements)
Get a list of element values with an attribute with a name contained in the list
of id types.
|
static java.lang.String |
getNamespace(java.lang.String bpelName)
Get the namespace part and return.
|
static java.util.ArrayList<java.lang.String> |
inputVarNames()
Get a list of known input variable id names.
|
static boolean |
isAlwaysTrue(Script_Element scriptElement)
Return true if the script element condition is always true.
|
static boolean |
isAutoElement(Script_Element scriptElement)
Return true if the script element is auto-related, where the script method is to
invoke a behaviour using a message retrieved the auto engine queue.
|
static boolean |
isControlLoop(Script_Element scriptElement)
Return true if the script element is a control loop type.
|
static boolean |
isParallel(Script_Element scriptElement)
Return true if the script element is a parallel statement type, or of type
Script_Parallel.. |
static boolean |
isSequential(Script_Element scriptElement)
Return true if the script element is a sequential statement type.
|
static java.util.ArrayList<java.lang.String> |
operationNames()
Get a list of known operation variable id names.
|
static java.lang.String |
removeNamespace(java.lang.String bpelName)
Remove the namespace and return just the element name.
|
static java.util.ArrayList<java.lang.String> |
sourceNames()
Get a list of known source variable id names.
|
static java.util.ArrayList<java.lang.String> |
typeNames()
Get a list of known source variable type names.
|
public static boolean isAutoElement(Script_Element scriptElement)
scriptElement - the element to check.public static boolean isControlLoop(Script_Element scriptElement)
scriptElement - the element to check.public static boolean isSequential(Script_Element scriptElement)
scriptElement - the element to check.public static boolean isParallel(Script_Element scriptElement)
Script_Parallel..scriptElement - the element to check.public static boolean isAlwaysTrue(Script_Element scriptElement)
scriptElement - the element to check.public static org.licas_xml.abs.Element combineScripts(org.licas_xml.abs.Element mainScript,
org.licas_xml.abs.Element combineWith)
combineWith elements to the mainScript
element at the appropriate positions, to create a single script. The mainScript element
will appear first, with combineWith appearing directly afterwards.mainScript - the main script. Must start with Policy or Process.combineWith - the script to combine with it. Must start with the same, and only
include the other known base element types - sources, variables, etc.public static java.util.ArrayList<java.lang.String> getAttrValues(org.licas_xml.abs.Element scriptXml,
java.util.ArrayList<java.lang.String> attrNames,
boolean subElements)
scriptXml - the xml element to search from.attrNames - the list of attribute names.subElements - if true search all sub-elements as well.public static Script_Element createNewElement(java.lang.String scriptType) throws Script_Exception, java.lang.Exception
scriptType - the type of element to create. If not known, then a Script_Element
is created instead.Script_Exception - if the new element is not compatible.java.lang.Exception - any other error.public static Script_Element createNewElement(java.lang.String scriptType, java.lang.String elemID) throws Script_Exception, java.lang.Exception
scriptType - the type of element to create. If not known, then a Script_Element
is created instead.elemID - this is the public id used to identify this element in the Auto process.
The element is also stored under this value and so it cannot be null.Script_Exception - if the new element is not compatible.java.lang.Exception - any other error.public static Script_Element createNewElement(java.lang.String scriptType, java.lang.String elemID, Script_Element addTo) throws java.lang.Exception
scriptType - the type of element to create. If not known, then a Script_Element
is created instead.elemID - this is the external id used to identify this element specifically. The
element is also stored under this value and so it cannot be null.addTo - the script element to add the new element to. If null, then the
element is only created and not added to anything.java.lang.Exception - any error.public static Script_Element elementFromScript(org.licas_xml.abs.Element scriptXml, Script_Element addTo) throws java.lang.Exception
scriptXml - a description of the element to create.addTo - the script element to add the new element to. If null, then the
element is only created and not added to anything.java.lang.Exception - any error.public static java.util.ArrayList<java.lang.String> checkFormat(java.lang.String idName)
idName - the name to check over. Compound will use ':' to separate two values.public static java.util.ArrayList<java.lang.String> operationNames()
public static org.licas_xml.abs.Element functionElement(org.licas_xml.abs.Element scriptElem)
scriptElem - the script element to parse from.public static java.util.ArrayList<java.lang.String> sourceNames()
public static java.util.ArrayList<java.lang.String> typeNames()
public static java.util.ArrayList<java.lang.String> inputVarNames()
public static java.util.ArrayList<java.lang.String> filterNames()
public static java.lang.String addNamespace(java.lang.String bpelName,
java.lang.String bpelNamespace)
bpelName - element name without any namespace.bpelNamespace - related namespace.public static java.lang.String getNamespace(java.lang.String bpelName)
bpelName - element name with optional namespace.public static java.lang.String removeNamespace(java.lang.String bpelName)
bpelName - element name with optional namespace.