This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Sync Project - inserting objects works but not the update

Hi Experts, 

I'm having a really bad time trying to make a synchronization project to work. Almost there but can't find the missing configuration to make the update work when calling the synchronization workflow from a process (ADHocProjection). 

I have the following:

  • SQL DB Sync project
  • Using stored procedures for Insert/Update/Delete. For the updates I'm using "Script based" data operations, and "Pattern based" for Inserts and Deletes.
  • Sync project is being used for Provisioning only (1IM > Target System)
  • Adding or updating an object works fine from the "Target system>Browse" functionality within the Synchronization Editor.
  • Running a simulation or executing the sync workflow works fine. Meaning it detects when is an insert/update on an object and it runs the Stored Procedures defined.
  • (Tricky part) the mapping is between 1IM.UNSAccountBInUNSGroupB > DBTargetSystem.Accounts, since Account and Role membership represents an Account in the target system.
    • User can be a member of only one role (UNSGroupB) at the time.
    • Insert is triggered when there is a new record in UNSAccountBInUNSGroupB and there is no matching Account in the target system.
    • Update "should" be trigger when there is a new record in UNSAccounBInUNSGroupB but there is already an Account in the target system.
  •  When running the Sync workflow from a process task (on insert in UNSAccounBInUNSGroupB table) the provisioning log shows: "There are no changed objects logged for this synchronization log". This only happens when the Account exists in the Target System, so when it suppose to run an update and not an insert. 

Any suggestions? Tips?

Thanks,

JM 

  • Hi,

    A couple of points to check.  

    You are receiving an Insert event and then you want an Update action to happen.  I wonder if we have a good match between the Event passed to Get_AdHocData() in your Process chain pre-script and the definition of the Provisioning process operation?  If the values don't match (below they do match: Insert and Insert) then it will think there is nothing to do. 

     

    Another point, in general one would rather use the ASSIGN/REMOVE events for handling M:N tables.  The reason is that there are state attributes on that table that can be Updated.  So by looking just to Insert/Delete, we might miss or be late to process, some membership events.  

    If you move to ASSIGN/REMOVE events then that would also have to align correctly.  If needed, there is an example with the Azure Connector pre-script where it transforms ASSIGN/REMOVE to INSERT/DELETE before calling Get_AdHocData(), so that the Provisioning process operation would have 'Insert' in it.

    Dim evt as String = EventName
    If evt.Equals("Assign", StringComparison.OrdinalIgnoreCase) _
    OrElse evt.Equals("HandleOutStanding", StringComparison.OrdinalIgnoreCase) then
      evt = "Insert"
    ElseIf evt.Equals("Remove", StringComparison.OrdinalIgnoreCase) then
      evt = "Delete"
    End If

    Imports System.Collections.Generic
    Dim data As IDictionary(Of String,string) = DPR_GetAdHocData( _
    $FK(UID_AADUser).FK(UID_AADOrganization).XObjectKey$, _
    "AzureAD","",evt)

    hth,

    Rob.

  • Hey Rob,
    I'm using now the Assign and Remove events as you suggested, I switched it to Insert/Delete when testing (process was not triggering) but now that you mentioned it I replace it back with the proper events and is triggering as expected.

    The DPR_GetAdHocData() returns the right workflow to call, and I'm able to see the log in the Sync Project, so it means it was triggered and the workflow/mappings should detect what to do (insert/update/delete).

    I'm using a workaround that includes another mapping and workflow, the mapping has a faulty matching rule, therefore when the workflow/mapping is called it won't find a corresponding object in the target system, so it will run the Insert stored procedure.

    That workaround works in my case since the store procedure is the same for inserts and updates. The delete event (from Remove on UNSAccountBInUNSGroupB) is using another workflow/mapping so it can detect the matching object in target system and proceed with the delete.

    Maybe my logic is wrong, or am I missing something?

    Thanks for your input Rob, and if you see something else in my configuration please let me know.
    JM
  • Hi JM,

    Not sure...but if your pre-script was to convert Insert to Update, under the right conditions that you describe, would that activate the Update Workflow correctly?  In the case where it was a 'true Insert',  then it would leave the event as Insert.

    You are right to pay attention ot the Object Mapping rules: you correctly point out that failure to correctly match objects can result in the connector choosing an operation that we would not expect.  As you say, failing to find the object will certainly not help the update operation succeed :-).

    If you zip up some screen shots or artifacts from your config we can try to read over it.

    What version are you working with and is this a freshly created Sync Project?  I would recommend 7.1.1 with a newly created Sync Project to be sure that all is crispy.

    Rob.