Path: / API / runtimeAPI / setVariable

Searches for variable with id variableId within the given activity instance with the given UUID.
If the variable is found within the activity, the given value is set.
If the variable is not found within the activity the search is performed within the process instance.
If the variable is found within the process instance, the given value is set.

For XML data
Here is the effect of set variable for XML data:
StringDocumentElementAttribute
"myXmlData" Stores content of XML String into myXmlData Stores a copy of Document in myXMLData Not supported Not supported
"myXmlData" + BonitaConstants.XPATH_VAR_SEPARATOR + "/root/node" (or any XPath expression resolving to an element Creates Node from string, and replace node by new node Not supported Replace node by new element Adds attribute to node
"myXmlData" + BonitaConstants.XPATH_VAR_SEPARATOR + "/root/node/text()" Sets text content of node Not supported Not supported Not supported
"myXmlData" + BonitaConstants.XPATH_VAR_SEPARATOR + "/root/@attribute" Sets the value of attribute. Create it if it does not exist Not supported Not supported Sets the value of attribute to the value of passed attribute
"myXmlData" + BonitaConstants.XPATH_VAR_SEPARATOR + "/root/node" + BonitaConstants.XPATH_VAR_SEPARATOR + BonitaConstants.XPATH_APPEND_FLAG Not supported Not supported Append a copy of element to node Not supported


Resources
NameDescription
{activityUUID} Searches for variable with id variableId within the given activity instance with the given UUID.