Highlighted
Knowledge Partner
Knowledge Partner
691 views

How to split One object into two in Publisher channel

Hi,

 

I have a Generic File driver that has a normal csv file.

I now have a line that looks like a normal user but has to be split into two objects. Such as one user and one user-role.

It's a bit strange design but it's old and works so we go with it for now..

 

How do I best split this incoming add into two?

Ther is no such thing as clone operation.

I guess my best option would be to just clone the whole thing and then strip out the parts I dont want?

I tried with create object but that fails and becomes a bit messy.

Labels (1)
0 Likes
10 Replies
Knowledge Partner
Knowledge Partner

Re: How to split One object into two in Publisher channel

Do Add dest object User-Role  $DN-In-Variable

for each XPATH ./add-attr

set local variable ATTR-NAME= XPATH $current-node/@attr-name

do add dest attr $ATTR-NAME value of XPATH $current-node/value

 

or somesuch.  I.e. Loop over all the add-attr nodes and add each one to the second node. .

 

0 Likes
Knowledge Partner
Knowledge Partner

Re: How to split One object into two in Publisher channel

I didn't get that add dest attr to work with a variable but that might be only in Designer. Didnät try it live.

 

What I have seems to work all the way down to the actual write moment.

Then it all of a sudden claim "A match found, using ..." even though I dont have a matchng rule for this object class. I also tried with removing the default association from the main object but that did not help.

I attach a full level 3 trace. Its a bit cluttered at first but it's the end that I need help with. At line 954 is a good starting point for the error.

0 Likes
Marcus Tornberg Super Contributor.
Super Contributor.

Re: How to split One object into two in Publisher channel

Hi.

You need to configure the association value in the driver and send in the <association> tag for each added object class. If you do not do this, IDM will not be able to convert the add to a modify, and your add will fail with already associated.

For the pidUser object this could be set in the driver config. For the pidStudent object, you will need to set it with xpath as this association value will be something different than for the pidUser object.

I had a policy to split a user to two different objects that utilized the filter to figure out what attributes to be moved from the User object to the Student object, but for the life of me, I cannot find it 😞

Best regards
Marcus
0 Likes
Knowledge Partner
Knowledge Partner

Re: How to split One object into two in Publisher channel

I have a rule for add-association but that obviously does not work..

I guess you mean I need to insert the <association> tag

 

I have this line that doesnt work. it's almost there but I think I need to get one node higher:

<do-append-xml-element before="'add-attr'" expression="add[@class-name='pidStudent']" name="association"/>

Because it seems like append-xml-element is inside the add not the instance as it usually is.

0 Likes
Knowledge Partner
Knowledge Partner

Re: How to split One object into two in Publisher channel

I think this is the way to do it.

Only in simulator so far:

 

<rule>
<description>Add association to student</description>
<conditions>
<and>
<if-class-name mode="nocase" op="equal">pidStudent</if-class-name>
</and>
</conditions>
<actions>
<do-append-xml-element expression="../add[@class-name='pidStudent']" name="association"/>
<do-append-xml-text expression="association">
<arg-string>
dfgdjsgj
</arg-string>
</do-append-xml-text>
</actions>
</rule>

0 Likes
Knowledge Partner
Knowledge Partner

Re: How to split One object into two in Publisher channel

Except the fact it doesn't work 😞

I get the association tag in ther. at the bottom because i didn't know how to get it up on top but anyway..

0 Likes
Knowledge Partner
Knowledge Partner

Re: How to split One object into two in Publisher channel

The Append XML attribute has a setting for add at end of the XML or beginning.  But order is not important so long as it is a child of <add> and sibling of <add-attr> nodes.

0 Likes
Knowledge Partner
Knowledge Partner

Re: How to split One object into two in Publisher channel

It is.
But I will move the split forward to the ctp. That might do the trick.

Thanks.
0 Likes
Knowledge Partner
Knowledge Partner

Re: How to split One object into two in Publisher channel

Do Add Association is NOT what you would expect. It does not add it to the current event, rather it sends an <add-association> event specifying the target object.  There is even a modify association that sends the old assoc to remove and the new one to add.

 

In your case, as Marcus is describing you need to add an <association> node via the Append XML Element tokens, into the event.

 

0 Likes
Knowledge Partner
Knowledge Partner

Re: How to split One object into two in Publisher channel

When are you doing the split?  If you do it before the Event Transform is complete you need to add an association value along the way as the others noted. If you did it in the Command Transform you should be able to avoid adding a direct association value. Specifically if you do NOT want the object associated. 

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.