ECMA 2 not giving me all attributes in PutExportEntries with capabilities set to MAExportType.ObjectReplace

Hi,

I have a ECMA 2 MA and I'm trying to export complete objects to a target system when an object is updated.

I have set the MACapabilities to MAExportType.ObjectReplace so that I can access all attributes on the user, not only the change one(s). But I can't seem to get it to work. When I run:

foreach

(CSEntryChangecsentryChange incsentries)

            {

foreach

(stringattribName incsentryChange.ChangedAttributeNames)

                    {

The only attributes I can access is the changed ones. Does anyone have a clue on this? Is there a bug with the capabilities?

Regards

Patrik

September 2nd, 2015 8:59am

Good morning Patrik,

A quick question... Did you have a different MAExportType defined when you originally created the connector?  What I have seen is that once a connector is created with a defined MAExportType, changing the type afterwards and recompiling the assembly will have no effect on the existing connector.

If that's the case, you'll need to create a new connector to make use of the MAExportType.ObjectReplace.

Cheers,

Marc

Free Windows Admin Tool Kit Click here and download it now
September 3rd, 2015 7:55am

Hi Marc,

Thank's for the quick reply. I'm aware of that "feature" and just to be sure I tried adding in Delta Import support in the capabilities and recreated the MA from scratch. When I set up run profiles the Delta Import step shows up as expected so there is no doubt that the MA have actually been created with the capabilties in my code.

But nevertheless, when I try exporting up a update the only attribut that shows up is the changed one, not the complete list with all attributes as one would expect running the MA with MAExportType.ObjectReplace

Do I have to access these attributes in a different way than:

foreach

(CSEntryChangecsentryChange incsentries)

            {

foreach

(stringattribName incsentryChange.ChangedAttributeNames)

                    {

All the best

Patrik

September 3rd, 2015 11:35am

Hi Patrik,

Setting the capabilities to MAExportType.ObjectReplace should give you the full object definitions during an export. I'm doing that in a custom MA and it works for me.

However, if you loop over the ChangedAttributeNames collection, you should get only the changed attributes.

Have you tried just accessing all the object properties?

Free Windows Admin Tool Kit Click here and download it now
September 4th, 2015 8:15am

Hi Paolo,

Thanks for the reply. Could you elaborate on that? :) The PutExportEntries method is giving me a list of CSEntryChange objects. When I look at the properties on that object I cannot see how I should access the attributes. Could you show me an example on how you access the attributes on the object?

All the best

Patrik

September 4th, 2015 8:27am

In my code, I just iterate over AttributeChanges, instead of checking the ChangedAttributeNames:
foreach (var attributeChange in entry.AttributeChanges) {  
  foreach (var valueChange in entry.AttributeChanges[attributeChange.Name].ValueChanges)
    object value = valueChange.Value;
    // do something with value...
  }
}

Hope this helps :)

Free Windows Admin Tool Kit Click here and download it now
September 4th, 2015 8:33am

Hi Paolo,

Many thanks for the fast reply. I was just playing around with the AttributeChanges collection realizing that I must have missed something obvious :) Duhh. Sometimes you cannot see the forest for all the trees :)

Thanks for the code :) It confirmed I was on the right track

All the best

Patrik

September 4th, 2015 8:42am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics