AddRoles
The purpose of the AddRoles business rule is to add existing clients in the database to new roles on an existing policy or segment. This rule can only be attached to a policy-level transaction and can only be used to add roles to the policy on which the activity is being processed. For each role in AddRoles, at least ROLECODE and CLIENTGUID/CLIENTGUIDCOLLECTION are required. All other fields, if not specified, will be set to null. This rule must be listed in TransactionBusinessRulePacket.
Multiple roles of the same role code may be created by the rule when the configuration uses the CLIENTGUIDCOLLECTION attribute and <FromCollection> element.
Note: Reversing off an activity that uses AddRoles changes the role code of the added role to a Deleted role code. The role record should not be deleted completely. AddRoles will automatically set the OptionText of combo box or radio button fields.
Element / Tag | Attribute | Definition |
---|---|---|
<AddRoles> |
|
The opening and closing tag of the AddRoles business rule. |
<Role> |
|
Required/Repeatable Element: This element is used to define the criteria for the specified roles that are added to the policy. Criteria are defined through various attributes. |
ROLESTATUS |
Optional attribute: MathVariable or literal code value from AsCode.CodeName: AsCodeRoleStatus. If this attribute is not specified in syntax, all roles will be added in active status. Values: AsCodeRolesStatus |
|
CLIENTGUID, CLIENTGUIDCOLLECTION |
Required attribute: These attributes are mutually exclusive. If a single Client should be added to a particular type of role, use CLIENTGUID. If multiple Clients should be added to the same role, use CLIENTGUIDCOLLECTION. CLIENTGUIDCOLLECTION is mutually exclusive with ROLEPECENT. Values: For CLIENTGUIDCOLLECTION the key is CLIENTGUID and value is PERCENT. |
|
ROLECODE |
Required attribute: The type of role the client added depends on the value of the ROLECODE attribute. The MathVariable must contain a valid RoleCode from AsCode=>AsCodeRole table. |
|
COMPANYGUID |
Optional attribute: This attribute is used to specify the CompanyGUID that the newly added role should be saved with in the AsRole table. |
|
STATECODE |
Optional attribute: This attribute is used to specify the StateCode from AsCode=>AsCodeState table that the newly added role should be saved with in the AsRole table. |
|
PERCENTDOLLARCODE |
Attribute PERCENTDOLLARCODE will no longer be supported. While it exists in AsRole, we will copy a NULL value for that column to AsRole. |
|
ROLEPERCENT |
Optional attribute: Used to specify the percentage of allocation for the newly added role through this business rule. Saves the specified Role Percent in the AsRole table. |
|
ROLEAMOUNT |
Optional attribute: Used to specify the amount of allocation for the newly added role through this business rule. Saves the specified Role Amount in the AsRole table. |
|
POLICYGUID SEGMENTGUID |
Optional and Required attributes in case the user wants to add a role at segment level. | |
<Tests> |
|
Optional Element: Allows configuration of Test(s) to see if a section of rule should be invoked. All conditions in this section must evaluate to true before the role(s) is/are added. |
<Test>
|
|
Required/Repeatable Element: (Expression) Condition to add a role to the policy. |
TYPE | Optional attribute (="Expression") To indicate the type of the condition. Example: <Test TYPE="Expression">SomeMathVariable=27</Test> |
|
<Fields> |
|
Optional Element: Used to create a record in AsRoleField table by passing the required information from the transaction. |
<Field> |
|
Required/Repeatable Element: This tag is used to specify the values with which the newly added roles should be updated in AsRoleField table. |
<From> |
|
Required Element value: These elements are mutually exclusive. When a single client is being added as a role, use <From>. The element accepts a field or MathVariable. When there is a potential to add multiple clients as a role, use <FromCollection>. The element accepts a MathVariable of a collection type. The keys are ClientGUIDs. |
<To> |
|
Required Element value: (RoleScreenFieldName) Name of the RoleScreen field. |
XML Sample
<AddRoles>
<Role ROLESTATUS="Literal Code Value from AsCodeRoleStatus|MathVariable">
<Role CLIENTGUIDCOLLECTION="AddClientGUIDCollection" ROLECODE="AddRoleCodeCollection" ROLEPERCENT="RolePercentMV" ROLEAMOUNT="RoleAmountMV">
<Tests>
<Test TYPE="Expression">ClientCount=4</Test>
</Tests>
<Fields>
<Field>
<FromCollection>TaxIDCollection</FromCollection>
<To>TaxIDField</To>
</Field>
</Fields>
</Role>
<Role CLIENTGUID="AddClientGUID" ROLECODE="AddRoleCode" PERCENTDOLLARCODE="" ROLEPERCENT="RolePercentMV2" COMPANYGUID="CompanyGUIDMV" STATECODE="StateCodeMV">
<Fields>
<Field>
<From>TaxIDMV</From>
<To>TaxIDField</To>
</Field>
</Fields>
</Role>
</AddRoles>