How to split One object into two in Publisher channel
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.
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. .
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.
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 😞
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.
I think this is the way to do it.
Only in simulator so far:
<description>Add association to student</description>
<if-class-name mode="nocase" op="equal">pidStudent</if-class-name>
<do-append-xml-element expression="../add[@class-name='pidStudent']" name="association"/>
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.
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.
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.