Synchronization Editor - Script for Quota Variables

Hi,

with OI9 it is now possible to use variables the set quotas within the workflows of a Sync Project.

I have used the variables before to write little scripts, and am wondering if I could write a generic script to have flexible quotas in any Sync Project and and object operation.

Unfortunately  I have not been able to find some documentation on what information is exactly hidden where inside the "args" and "Base" objects.

If I could extract the variable set, object method and base object, I might be able to write a single script to dynamically set the quota higher for exceptionally small systems.

If anybody knew where to find some documentation, or how to extract these values, I would be very grateful Slight smile

E.g.:

Public Function GenerateValue(ByRef args as SystemVariableGenerateValueArgs) As String
    Dim quota = "0.03"
    Dim myArgs = args...
    Dim myBase = Base...
    
    If myCondition Then
        quota = ...
    End If
    
    Return quota
End Function

Best regards,

 Jessey

  • If you searched and did not find documentation it most probably is not available. Use the Visual Studio debugger and dotPeek as documentation. The myBase variable looks similar to the MyBase keyword and would point to the VI.Projector.Scripting.ProjectorScriptBase base class. The args argument is clear and dotPeek will give you some insight in what the class contains. I do not think that you will get access to the object operation but a One Identity developer could provide some clarity.

  • Maybe this can help (p.s. not fully tested)

    Dim quota As String = "0"
    
    Dim objectCount As Integer = args.QueryDatabase( _
        Connection.SystemQuery _
            .From("UNSAccountB") _
            .SelectDisplays _
            .Filter("UID_UNSRootB = '00000000-0000-0000-0000-000000000000'")) _
            .Result.Count
    
    If objectCount > 0 Then
        Select Case objectCount
            Case 1 To 100
                quota = "50"
            Case 101 To 500
                quota = "20"
            Case 501 To 1000
                quota = "10"
            Case Else
                quota = "5"
        End Select
    End If
    
    Return quota