Business Numerators. Through Numeration

The Through Numeration feature allows using the same chain of values for the objects that belong to different types. The code snippet below declares two classes:

  • c#
  • VB

[DefaultClassOptions]
public class ThroughNumeration_ObjectA : BaseObject
{
  public ThroughNumeration_ObjectA(Session session)
    : base(session)
  {
  }
  public string Name
  {
    get
    {
      return this.GetPropertyValue<string>("Name");
    }
    set
    {
      this.SetPropertyValue<string>("Name", value);
    }
  }
  public string ThroughNumber
  {
    get
    {
      return this.GetPropertyValue<string>("ThroughNumber");
    }
    set
    {
      this.SetPropertyValue<string>("ThroughNumber", value);
    }
  }
}
[DefaultClassOptions]
public class ThroughNumeration_ObjectB : BaseObject
{
  public ThroughNumeration_ObjectB(Session session)
    : base(session)
  {
  }
  public string Name
  {
    get
    {
      return this.GetPropertyValue<string>("Name");
    }
    set
    {
      this.SetPropertyValue<string>("Name", value);
    }
  }
  public string ThroughNumber
  {
    get
    {
      return this.GetPropertyValue<string>("ThroughNumber");
    }
    set
    {
      this.SetPropertyValue<string>("ThroughNumber", value);
    }
  }
}

<DefaultClassOptions> _
Public Class ThroughNumeration_ObjectA
  Inherits BaseObject
  Public Sub New(ByVal session As Session)
    MyBase.New(session)
  End Sub
  Public Property Name As String
    Get
      Return Me.GetPropertyValue(Of String)("Name")
    End Get
    Set
      Me.SetPropertyValue(Of String)("Name", value)
    End Set
  End Property
  Public Property ThroughNumber As String
    Get
      Return Me.GetPropertyValue(Of String)("ThroughNumber")
    End Get
    Set
      Me.SetPropertyValue(Of String)("ThroughNumber", value)
    End Set
  End Property
End Class
<DefaultClassOptions> _
Public Class ThroughNumeration_ObjectB
  Inherits BaseObject
  Public Sub New(ByVal session As Session)
    MyBase.New(session)
  End Sub
  Public Property Name As String
    Get
      Return Me.GetPropertyValue(Of String)("Name")
    End Get
    Set
      Me.SetPropertyValue(Of String)("Name", value)
    End Set
  End Property
  Public Property ThroughNumber As String
    Get
      Return Me.GetPropertyValue(Of String)("ThroughNumber")
    End Get
    Set
      Me.SetPropertyValue(Of String)("ThroughNumber", value)
    End Set
  End Property
End Class

You can see this code in the Objects.cs file of the attached BusinessNumerators sample.

There is a single ThroughNumerator which parameters are shown in the screenshot below (note the ThroughNumeration property):

numerator_26

ThroughNumerator is linked to both the ThroughNumeration_ObjectA and ThroughNumeration_ObjectB objects:

numerator_27

The image below demonstrates how numbers are generated when objects are created in a mixed order: the first object is A, then object B appears, then again object A, etc.

numerator_28

The ThroughNumeration option is also accessible via XAS:

numerator_15