With Java Actions, you can use the functions explained in "A.1 General JavaScript Functions" and the functions listed below.
The functions listed below use the Server Enactment Context API, com.fujitsu.iflow.server.intf.ServerEnactmentContext, to provide access to workflow information. For a description, refer to the API Javadoc.
void sec.addAttachment(String attachmentName, String attachmentPath)
void sec.addProcessXMLAttributeSubstructure(String udaName, String xPath, String value)
void sec.addProcessXMLAttributeSubstructureByIdentifier(String identifier, String xPath, String value)
void sec.deleteAttachment(String attachmentName)
void sec.deleteProcessXMLAttributeSubStructure(String udaName, String xPath)
void sec.deleteProcessXMLAttributeSubStructureByIdentifier(String identifier, String xPath)
void sec.escalateActivity(String assignees)
String sec.getActivityActor(String activityName)
Array sec.getActivityAssignees()
String sec.getActivityName()
String sec.getActor()
Array sec.getAllAttachmentNames()
Array sec.getAllAttributeNames()
String sec.getAttachment(String attachmentName)
Number sec.getCurrentActivityId()
Number sec.getCurrentProcessId()
Array sec.getGroupMembers(String groupName)
String sec.getProcessAttribute(String attName)
String sec.getProcessAttributeByIdentifier(String identifier)
String sec.getProcessAttributeStringType(String udaName)
String sec.getProcessDefinitionId()
String sec.getProcessDefinitionName()
String sec.getProcessDescription()
String sec.getProcessInitiator()
String sec.getProcessName()
Array sec.getProcessOwners()
Number sec.getProcessPriority()
Number sec.getActivityPriority()String sec.getProcessTitle()
String sec.getProcessXMLAttributeElementValue(String udaName, String xPath)
String sec.joinString(Array)
Array sec.resolveRelationship(String relationship, String sourceValue)
void sec.sendEmail(String to, String from, String cc, String bcc, String subject, String body, String mimeType)
void sec.setActivityAssignees(Array assignees)
void sec.setOwners(Array users)
void sec.setProcessAttribute(String name, String value)
void sec.setProcessAttributeByIdentifier(String identifier, String value)
void sec.setProcessDescription(String description)
void sec.setProcessName(String name)
void sec.setProcessOwners(Array users)
void sec.setProcessPriority(Number priority)
void sec.setActivityPriority(Number priority)
void sec.setProcessTitle(String title)
void sec.setProcessXMLAttributeElementValue(String udaName, String xPath, String value)
void sec.setProcessXMLAttributeElementValueByIdentifier(String identifier, String xPath, String value)
void sec.setProcessXMLAttributeSubstructure(String udaName, String xPath, String value)
void sec.setProcessXMLAttributeSubstructureByIdentifier(String identifier, String xPath, String value)
void sec.validateProcessXMLAttributeValue(String udaName)
void sec.validateProcessXMLAttributeValueByIdentifier(String identifier)
Array sec.splitString(String commaSeparatedList)
Using User Defined Attributes (UDAs)
You can use UDAs that have been added to the process definition in your JavaScripts by using the following syntax:
uda.<udaIdentifier>.
Note that you must use the identifier and not the name of the UDA, because multibyte characters are not allowed for variable names in JavaScript.
The following example creates a variable and initializes it to the value of a UDA.
var someVariable = uda.Price;
The following example shows how to assign the value of a variable to a UDA.
var lastName = "Jones";
uda.udaIdentifier = lastName;
The methods uda.get and uda.set allow you to access UDAs by their names.
uda.get returns the value of the specified UDA
var value = uda.get("<udaName>");
uda.set sets the UDA to the specified value
uda.set("<udaName>", "<udaValue>");
When assigning a JavaScript return value to a UDA, ensure that their data types match.
Otherwise, the assignment fails.
Note
If the assignment of a value to a target UDA fails due to conversion or any other kind of error, error details are logged in the IBPMServer.log. The target UDA is not updated and holds its earlier value.
Interstage BPM maps UDA data types to the following Java data types:
UDAs of the BIGDECIMAL type are mapped to Packages.java.math.BigDecimal objects
UDAs of the DATE type are mapped to Packages.java.util.Date objects
For details about Java objects, refer to the Javadoc provided with the JDK.