Policy Automation for B2C Service

Get Involved. Join the Conversation.


    Leomar Cortez
    Assign a number to an entity instance
    Topic posted October 28, 2018 by Leomar CortezRed Ribbon: 250+ Points 
    119 Views, 1 Comment
    Assign a number to an entity instance
    In an entity, create an attribute that assigns a count/number based on the value of another attribute


    I have an entity Bank Accounts with type which can either be Payroll or Non-Payroll.  What I want to do is assign a Sequence number attribute to each instance.  For example, if the user added a Payroll account, the Sequence for this instance will have a value of 1.  If he adds a Non-Payroll account, the Sequence for the new instance will have a value of 1 also since it is the first non-payroll account.  The resulting table should look something like this, assuming it only has 3 attributes (acct no, type, sequence):

    Acct. No. - Type - Sequence

    87655353 - Payroll - 1

    0987669 - Non-Payroll - 1

    354548784 - Payroll - 2

    973734733 - Payroll - 3

    9776553 - Non-Payroll - 2

    How can I do this?  Is there a function I can use or should I define a relationship of the entity to itself?