Description

You want to be able to download/process the documents that are stored in document references on Automation Engine. WebCenter 18.0.1 and newer allows you to select document references from project attributes so they can be sent to Automation Engine. Older versions of WebCenter have no tools to select document references.

We can however send the project attribute values over to Automation Engine, these contain the document version ID's we can process further.

Procedure

In WebCenter, either send over the project attributes containing the document references using the sync option, or submit them using a WebCenter workflow to a workflow in Automation Engine.

Once we have the information in Automation Engine, we can manipulate the date as we need it. The setup is as follows, WebCenter sends the document version ID's for each of the document references in the project as a concatenated string.

For e.g: 00002_0000017689 | 00002_0000017690

Using a script SmartName, we can split up this string based in the separation characters into multiple substrings. An Automation Engine workflow will then help us to generate an XML file for each of the substrings.

Extract the info of the workflow parameters

Make sure the workflow is triggered once from WebCenter in Automation Engine and save it as a workflow. This way we have access to the workflow parameters.

Next create a new SmartName that creates a String Extract from a workflow parameter.

Create script SmartName

Next we create small script SmartName that splits the strings and returns us the content for the Create XML File task.

You can extend the script to cope with multiple document reference attributes if needed.

function f ()
{
 //set the output of the smartname to a string object.
 var input = '[your smartname]';
 //generate an array with the split string tokens
 var array = input.split(' | ');
 //create xml template
 var xmlTemplate = '<?xml version="1.0" encoding="UTF-8" standalone="no" ?><root>';
 //loop through the array of string tokens
 for(i = 0; i < array.length; i ++)
 {
 //enclose each string token in an xml element
 xmlTemplate = xmlTemplate.concat('<el>', array[i],'</el>');
}
 //close the xml root element
 xmlTemplate = xmlTemplate.concat('</root>');
return xmlTemplate;
}
f ();

This will return us an XML output of the format:

<root>
   <el>versionID_1</el>
   <el>versionID_2</el>
   <el>versionID_3</el>
   <el>versionID_4</el>
</root>

Create XML File Ticket

Insert your SmartName in the Create XML File ticket. Make sure you disable the Replace reserved characters in SmartName values with XML entities.

Split XML File ticket

Configure the ticket to split the elements inside of the root element. Each element will result in an XML file containing exactly one Document Version ID.

The Split XML File ticket will output all XML files in a single group, it needs to be followed by a Data Splitter in order to work properly in the rest of the workflow.

Modify Workflow Parameter Values

Here we create a new Workflow Parameter called version ID, that will update the values for each XML file. As the input file is an XML file, we can use an xpath expression to update the Workflow Parameter values.

Integrate with WebCenter 

Choose Download Document and click the Options button. Fill out your workflow parameter version ID in the Document version ID input field.

The ticket will download a file for each document reference attached in the project.


Article information
Applies to

WebCenter 18.x

Automation Engine all versions

Created

20-Jun-18

Last revised


AuthorLEFR
Case Number