Not yet rated

Problem

How to modify properties of a document when it is created/updated in IBM CM using LiveCycle Processes?

Solution

When a document is created/updated in IBM CM using LiveCycle, along with the contents of the document, its properties can also be modified. Properties of a document ultimately depends upon the Item type of the document in IBM CM. Case 1: In case, if at the design time of the process, Item Type of the document is already known, LiveCycle ES2 workbench can fetch all the properties that are attached to a document of that item type and user can then set values for all/none of these depending upon the item type's required and non-required properties. Case 2: However, if in case Item Type is not previously known, OR you might instead want to use a more flexible design where properties are actually forwarded through a map variable you will take a slightly different approach.

Detailed explanation

To get comfortable with the approach 2, I would recommend you to go through Case 1 as well which would actually clear the ultimate goals we are trying to achieve.

Case 1

Follow these steps of creation a test LiveCycle Application and process which would do nothing but, just creating a document in IBM CM, settings its content and properties. (An end-to-end scenario)

1.       Create a new LiveCycle Application.

2.       Create a new Process inside this application.

3.       Drop CreateItem API in workbench.

4.       Select the Item Type "NOINDEX" and other settings.

5.       You will see in the Attributes section, all the properties attached to that item type will be visible.

6.       Click on the bubble just next to the SOURCE property's value column .

7.       In the XPath Builder dialog add the string value of the property you want to specify (( IllinoisDoc in this case).

8.       Click on Ok. Run the process and check out if the SOURCE property is set.

9.       That is the way we specify properties/metadata for a document that is being created inside IBM CM.

 

Case 2

In case you specify a variable for Item Type it will not be able to get the attributes in the Meta-Data section, so in that case you need to use a map variable as shown below.

1.       Drop the Set Value operation on the canvas.

2.       Declare a propertiesMap variable of Map type in the variables section of the process. We'll use this variable to store all the properties that need to be set in IBM CM.

3.       Select the Set Value operation and look at its Process Properties.

4.       Click on the + sign to add a location and expression pair.

5.       In the XPath Builder pop out, click on the location and add the following in the Location section of down - right hand side of the pop up:- /process_data/propertiesMap[@id='SOURCE']   Please make sure you use SOURCE as the property name and don't use a different case like S ource.

 

6.       

How to modify properties of a document when it is created/updated in IBM CM using LiveCycle Processes?

 

7.       Then select the [expression] section.

 

8.       Add a value you want the SOURCE property to have. In this case its 'IllinoisDoc'.

 

How to modify properties of a document when it is created/updated in IBM CM using LiveCycle Processes?

 

9.       Click on Ok. It should look something like this:-

 

How to modify properties of a document when it is created/updated in IBM CM using LiveCycle Processes?

 

10.   Now drop a create item operation of IBM CM.

11.   Fill in the appropriate values in the sections Login Settings and Item Creation Settings.

12.   In the Meta-data section select variable instead of literal and select the propertiesMap variable from the dropdown.

 

How to modify properties of a document when it is created/updated in IBM CM using LiveCycle Processes?

 

13.   Save and invoke the process.

14.   Once executed I could see the values getting set successfully in CM.

How to modify properties of a document when it is created/updated in IBM CM using LiveCycle Processes?


+
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License. Permissions beyond the scope of this license, pertaining to the examples of code included within this work are available at Adobe.

Report abuse

Related recipes