search cancel

How to copy attributes from one object to another when using the object conversion option in processes or when using the Convert buttons in Ideas or Incidents (AKA Object Mapping)

book

Article ID: 42155

calendar_today

Updated On:

Products

Clarity PPM On Premise

Issue/Introduction

Introduction:

When converting an object instance from one type of object to another via the object conversion options in System Actions for processes or when using the convert buttons on Ideas or Incidents, it is often desirable to copy some attributes from the original object instance to the new one.  There are two methods you can use to create the mappings Clarity needs:  Automatic Mappings (you don't have to do anything) or using XOG to create those mappings.

 

Environment

Release:
Component: STUDIO

Resolution

AUTOMATIC MAPPING:

If attributes with the same id and data type exist on both the original object and the object type it is being converted to, any values in those attributes will be copied to the new object automatically.  This holds true for both out-of-the-box and custom attributes.  The names of the attributes do not have to be the same.  But the ids do.

EXAMPLE: 

If you look at the Project Name attribute on the project object and the Subject field on the Idea object, both attributes have the same Attribute ID:  name.  This means that when you convert an idea to a project the Subject field on the idea will be copied into the Project Name field on the project that is created during the conversion.

CREATING OBJECT MAPS VIA XOG (OBJECT MAPPING)

Unfortunately, it is not always possible to use the automatic object mapping feature that Clarity provides and the attribute you want to copy from on the original object instance does not have the same id as the attribute you want it copied to on the new object instance.  We can handle that too by using the XOG Client to xog in the attribute mappings you want for conversion between the two objects.

NOTE:  Refer to the XML Open Gateway Developer's guide if you do not know how to use the XOG Client.

This xog file gives examples of how to map an object, a sub-object and a sub-sub-object.  If you are mapping a master object to a master object you can delete the sections for the sub-object and sub-sub-object.

It is a best practice to choose a Mapping Description and Code that let you know which object you are converting from and to so that you can find it easily when setting up an object conversion in a process.

Attached below is a sample xog file that will allow you to define your mappings.

object_mapping_write.xml

Note: You can't map an attribute that uses one dynamic lookup to another attribute that uses a different dynamic lookup. The value stored is a number derived from the query - an ID in this case - and how that ID was derived from the query may be totally different between the two lookups. One ID retrieved from the first lookup might not ever be returned by the second lookup depending on how the queries were written.

Once you have xogged your file in, the information will be stored in the odf_object_mapping table in your database.  You can use the following query to view existing mappings.

select * from odf_object_mapping

Now that you have your object mapping stored in the database, you can use it when you create a process that converts an object.  You can find this option by creating a process and opening one of your steps. 

1.  Inside the step click the New button in the Actions section. 
2.  Click the radio button to the left of System Action and click the Next button.
3.  Choose the correct object from the Object drop down.
4.  Choose Convert Object from the Action drop-down.
5.  Click the binoculars to the right of Mapping Code.
6.  Select the Mapping you created.
7.  Fill out all other required/desired fields.

Now when you run this process your new object instance will contain the information you selected when you created the mapping and any additional information selected in the System Action.

 

Attachments

1558534474271TEC1998952.zip get_app