Designing processes - EMC Community Network

Designing processes - EMC Community Network Designing processes - EMC Community Network

community.emc.com
from community.emc.com More from this publisher
30.01.2015 Views

Designing the Process 2. Add a second copy function and click the destination variable. 3. Click the Line drawing mode button in the toolbar. 4. Place the cursor over the small handle in the source variable and click once. 5. Click the handle on the left side of the copy function to complete the mapping. As you can see, Var 0 on the left, has been mapped to Var 0 and to Var 1 on the right. Setting the context for repeating attributes A multi-valued attribute can be mapped to a single-valued attribute or to another multi-valued attribute. Depending on how you set the Input Context option, the mapping rule function is executed once for each input value (the for-each case) or the mapping rule function is executed against the array of attributes as a whole (the for-all case). You can view or update the Input Context option in the function dialog box. The following example clarifies this feature. In this example, on the input side (left-hand side) of the mapping you have a repeating attribute IntArray, of type Int, with values [1, 2, 3, 4, 5]. The mapping rule function is Add(IntArray, 1). Case 1: (for-each). This performs the Add function for each individual value in IntArray, creating a multi-valued attribute on the right-hand side. In this case the output on the right-hand side will be [2, 3, 4, 5, 6]. Case 2: (for-all). This performs the Add function against IntArray as an argument, creating a single-valued output. In this case the output on the right-hand side will be 16 = (1+2+3+4+5) + 1. Here is an example to show the use of the for-each construction. In this example, you have a process receiving emails with attachments but do not know the content type of the attachments. You just have the attachment name, but you need to know the content type in order to store it in the repository. To solve this problem, look at the file extension of each attachment and use it to set the object type. To do this you iterate through the file names, getting the file name and the extension. The for-each 38 EMC Documentum xCelerated Composition Platform Version 1.6 Best Practices Guide

Designing the Process construct allows you to implement this loop. The split construct allows you to extract the file extension for each attachment. Here are the detailed steps of the implementation: 1. Select Split function in the Data mapper. 2. Double-click the Split function icon that shows up, and select the For Each radio button. 3. Map Email → Attachment → Name to Attachment → Content → file-extension. The Activity Inspector screen appears as: 4. Double-click the Split function that is connecting the left-hand side to the right-hand side. 5. Click the plus sign (+) and add a period (.). 6. Click the plus sign (+) and add 1. 7. Use the up/down arrows to reorder them as follows: EMC Documentum xCelerated Composition Platform Version 1.6 Best Practices Guide 39

<strong>Designing</strong> the Process<br />

2. Add a second copy function and click the destination variable.<br />

3. Click the Line drawing mode button in the toolbar.<br />

4. Place the cursor over the small handle in the source variable and click once.<br />

5. Click the handle on the left side of the copy function to complete the mapping.<br />

As you can see, Var 0 on the left, has been mapped to Var 0 and to Var 1 on the right.<br />

Setting the context for repeating attributes<br />

A multi-valued attribute can be mapped to a single-valued attribute or to another multi-valued attribute.<br />

Depending on how you set the Input Context option, the mapping rule function is executed once<br />

for each input value (the for-each case) or the mapping rule function is executed against the array<br />

of attributes as a whole (the for-all case). You can view or update the Input Context option in the<br />

function dialog box.<br />

The following example clarifies this feature. In this example, on the input side (left-hand side) of the<br />

mapping you have a repeating attribute IntArray, of type Int, with values [1, 2, 3, 4, 5]. The mapping<br />

rule function is Add(IntArray, 1).<br />

Case 1: (for-each). This performs the Add function for each individual value in IntArray, creating<br />

a multi-valued attribute on the right-hand side. In this case the output on the right-hand side will<br />

be [2, 3, 4, 5, 6].<br />

Case 2: (for-all). This performs the Add function against IntArray as an argument, creating a<br />

single-valued output. In this case the output on the right-hand side will be 16 = (1+2+3+4+5) + 1.<br />

Here is an example to show the use of the for-each construction. In this example, you have a process<br />

receiving emails with attachments but do not know the content type of the attachments. You just have<br />

the attachment name, but you need to know the content type in order to store it in the repository. To<br />

solve this problem, look at the file extension of each attachment and use it to set the object type. To<br />

do this you iterate through the file names, getting the file name and the extension. The for-each<br />

38 <strong>EMC</strong> Documentum xCelerated Composition Platform Version 1.6 Best Practices Guide

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!