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

Q1IM: Fullsync Flag not Recognized in Process Head Generating Condition

Hello all,

I'm currently working on debugging a synchronization script for a connected system. At one point during the script, role assignments in the connected system are reconciled with our representations of the role assignments (stored in the UNSAccountBInUNSGroupBTotal table); the goal here is to recondile any access to roles added outside the IDM system. When the sync process isn't running, any insert into this table will fire a process called "AJG_JDE_AddRoleAssignment", which will in turn trigger a web service call to the connected system to add the role assignment to the user. Obviously, during the sync, we don't want the web service call to fire since it will attempt to add access already reflected in the target system, so our solution was to set the "FULLSYNC" flag in the sync script as follows (NOTE: We are placing role assignments added through the sync into the "UNSAccountBInUNSGroupB" table rather than in the total table for auditing purposes, but the insert there ultimately triggers an insert into the total table):

'Set FULLSYNC flag to True to avoid process generation during save

Connection.Variables("Fullsync") = "true"

Connection.BeginTransaction()

Try

Dim newRoleAssignment As ISingleDbObject = Connection.CreateSingle("UNSAccountBInUNSGroupB")

newRoleAssignment("UID_UNSGroupB").NewValue = workingIDMRole.GetValue("UID_UNSGroupB").String

 newRoleAssignment("UID_UNSAccountB").NewValue = IDMUser.GetValue("UID_UNSAccountB").String

 newRoleAssignment.Save()

 Connection.CommitTransaction()

 Connection.Variables.Remove("Fullsync")

          

Catch ex As Exception

If Connection.TransactionOpen Then

Connection.RollbackTransaction()

End If

AJG_Connected_JDE_Sync_WriteLog(StartTime,MsgSeverity.Warning, String.Format("The assignment of the {0} {1} could not be committed to the database - Instance: {2}, UserID: {3}", roleType, workingJDERole.RoleName, localInstanceName, JDEUser.UserID))

Connection.Variables.Remove("Fullsync")

End Try


The process head for "AJG_JDE_AddRoleAssignment" (Table: UNSAccountBInUNSGroupBTotal; Event: INSERT_SYNC) contains the following generating condition:

Value =

Not CBool(Connection.Variables("FULLSYNC")) _

AndAlso $FK(XProxyContext).NamespaceManagedBy$ = "Generic" _

AndAlso Not $FK(XProxyContext).IsNoWrite:Bool$ _

AndAlso $XProxyContext$.StartsWith("JDE_") _

AndAlso Not String.Equals($FK(UID_UNSGroupB).AJG_CustomAttribute03$, "D", StringComparison.InvariantCultureIgnoreCase)

The problem here is that the process is generating each time, regardless of the generating condition, triggering an unwanted web service call. What are we doing wrong?

Parents
  • Hello all,

    I have faced with the same problem - global variables set in Script (ScriptExec in processes) are not visible in processes. Have anybody managed to solve the problem?

    Process1 generation condition:

    Value = Not CBool(Variables("foobar"))

    Process2 have ScriptExec inside with follow code:

    Variables.Put("foobar", True)

    After that I manually run Process 2 from Process automation and while it's running I run Process 1. The process_1 shoudn't start but it does.

    Moreover: if I run script with variable set in Designer script tester the variable is set correctly and the condition works!

Reply
  • Hello all,

    I have faced with the same problem - global variables set in Script (ScriptExec in processes) are not visible in processes. Have anybody managed to solve the problem?

    Process1 generation condition:

    Value = Not CBool(Variables("foobar"))

    Process2 have ScriptExec inside with follow code:

    Variables.Put("foobar", True)

    After that I manually run Process 2 from Process automation and while it's running I run Process 1. The process_1 shoudn't start but it does.

    Moreover: if I run script with variable set in Designer script tester the variable is set correctly and the condition works!

Children
No Data