Are there any examples available for the Execute JavaScript workflow node in WebCenter?
Answer
Examples
Setting the first 6 characters of a project attribute in another project attribute
var project = API.getProject();
// Get the source attribute
var attributeSource = project.getAttribute(“ArtFileName”);
// Get the value of the source attribute
var attributeSourceValue = attributeSource.getValue();
// Calculate the new value
var newValue = attributeSourceValue.substring(0, 6);
// Get the target attribute
var attributeTarget = project.getAttribute(“ItemNumber”);
// Set the new value in the target attribute
attributeTarget.setValue(newValue);
Documentation
Documentation of the workflow node can be found here.
The API of the JavaScript workflow node in HTML format can be found here.
The API of the JavaScript workflow node in PDF format for WebCenter 16.1 and WebCenter 16.1.1 can be found here: WebCenter16.1.1_JavaScriptAPI.pdf
The API of the JavaScript workflow node is slightly different than the one for JavaScript buttons in an attribute category.