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

Parents
  • 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

Reply
  • 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

Children
No Data