I need help with creating an xml file to xog out custom fields that I created in PPM. The file needs to be able to xog out 1 or 10 attributes that I created. They may be from the same object such as the Project object or from multiple objects like the Project and Idea object.
Any help would be greatly appreciated.
If you are talking about the values for the custom fields the object instances have, they should come out when you read the instances or if the argument is supported (like with the project object) using
<args name="include_custom" value="true"/>
You would have to read the instances of each object separately - one object at a time.
If you are talking about the definitions of the attributes then you would have to read again each object separately.
There is no generally available read input files to read just attribute definitions or custom attribute definitions of an object.
With some fancy gel you could accomplish that.
I should just read the object and use as many arguments as I can from
<args name="singleContentType" value="object" /><args name="no_dependencies" value="true" /><args name=“include_dependencies” value=“false”/>
<args name="exclude_parent" value="true"/>
<args name="noparents" value="true" />
that work for the specific object to limit the size and content.pack xml file and object query
Then I should strip out of the output manually everything else except the object section and the attritubtes.
Thanks for your response Urmas. Here's a little more background for my question. In on of my previous jobs I worked with a vendor that created a xog file so that I could xog out 1 or many Roles from one environment and xog it into another by just adding the ID's into one line of the xml. I'm assuming that I should be able to do the same for attributes that I created on the project object. Is that not the case with what you're describing?
That is the first case: you want to read the project object instances with their values for your custom attributes.
Then your filter should be something like
<Filter name="projectID" criteria="OR">ID1,ID2 </Filter>
That is use OR and separate the ID's (codes) with commas.
When you write the file you can strip many of the attributes if the project already exists.
<NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_project.xsd"><Header action="write" externalSource="NIKU" objectType="project" version="220.127.116.116"/> <Projects> <Project projectID="zproject" name="zproject">
<CustomInformation> <ColumnValue name="OWNER">admin</ColumnValue> </CustomInformation> <Tasks> </Tasks> <Allocations/> <scenarioDependencies/> <InvestmentAssociations> <Allocations> </Allocations> <Hierarchies/> </InvestmentAssociations> <General/> <OBSAssocs> </OBSAssocs> </Project> </Projects> </NikuDataBus>
Thanks Urmas. I'm going to plan to try this out next week.
Just to make sure I understood won hat you want to do a recap
- the custom attributes already exist on both systems
- on one system the instances have values for the custom attributes
- you want to transfer those values to the other system
I want to xog new custom attributes that exist in one environment into an environment where they don't exist.
That sounds more like you want to XOG new custom attribute definitions from one system to another.
If you use
<NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_read.xsd"> <Header version="8.0" action="read" objectType="contentPack" externalSource="NIKU"> <!-- the contentType is used to determine which filter goes where --> <args contentType="job_definition" name="order_by_1" value="code"/> <args contentType="menu" name="order_by_1" value="code"/> <args contentType="view" name="order_by_1" value="code"/> <args contentType="process" name="order_by_1" value="code"/> <args contentType="object" name="order_by_1" value="code"/> <args name="singleContentType" value="object" /> <args name="noparents" value="true" /> <args name="no_dependencies" value="true" />
</Header> <ObjectQuery> <Filter name="object_code" criteria="EQUALS">project</Filter> </ObjectQuery></NikuDataBus>
you would get
Custom attributes for the main object (project)LinksDisplay MappingsScore ContributionsActionsAutonumberingAnd all the child objects
No lookups if they are used for the custom attributes
Normally I should XOG in first any lookups needed (of course they have to be read first=
The last time I XOGed in object attribute definitions was in r8 and I do not recall any more if it safe to only to write the new ones and to drop the old ones. You would have to test that.
I should think that you would need the attributes also placed in the views.
If you want to XOG them you would have to modify the arguments in the read input file the get the views.
That I do remember that you can XOG in only the view definitions of an object.
On the other hand if it is only 10 attributes I would be tempted to create them manually. It is not hat much work if you do all at the same time and can compare the two systems all the time.