View this page in the latest version of Appian. How to Extend Automation Rules for Case Management Studio Share Share via LinkedIn Reddit Email Copy Link Print On This Page The capabilities described on this page are included in Appian's advanced and premium capability tiers. Usage limits may apply. Overview Automation rules allow business users to set up automatic initial case assignment and dynamic case reassignment throughout the case lifecycle. This page will: Briefly describe what automation rules are. Provide instructions and examples for low-code developers on how to further extend and configure automation rules in Designer. This page is intended to provide guidance to low-code developers on how to extend the Control Panel's automation rule capabilities through low-code configurations in Designer. What are automation rules Automation rules are configurable rules that complete specific actions based on the triggers and conditions you define. In Case Management Studio, automation rules can be configured to automatically assign and re-assign cases to a role, an individual user, or a group. Automation rules consist of one trigger, multiple or no conditions, and one action. Automation rules are evaluated whenever one of the defined triggers is met and completed by the system without human intervention. You can create automation rules for all cases, for all cases in a case category, or for all cases in a case type. To learn about business user configurations for automation rules in the Control Panel workspace, see How to Create Case Categories and Case Types with Case Management Studio. Extend automation rule capabilities in Designer Low-code developers can further extend automation rule capabilities in Designer to add additional: Actions. Roles for case assignment and re-assignment actions. Roles in conditions. Fields in conditions. Adding additional actions An action in an automation rule is the event done when the trigger is kicked off and the conditions are met. For example, the Assign Case actions allow you to specify who to assign the case to and which routing type to use when assigning the case. Through configurations in Designer, you can extend the automation rules capabilities to go beyond the out-of-the-box actions, allowing your business users to use custom actions in automation rules and address more use cases. To add additional custom actions to automation rules, we first need to set up the process model and the expression rule for the action. In Designer, create a new process model or reference an existing process model to carry out the action that is kicked off by the automation rule. For example, you should create a new process model if you're kicking off an integration that is unique to your business. If you are writing a comment to a case, reference an existing process model instead, such as the CMGT_Comment_CreateUpdate process model. Create a constant that references that process model. In Designer, find and open the CMGT_CFG_ENUM_ACT_ASSIGN_CASE expression rule. Create a new expression rule for the action with a map function and the same keys as the CMGT_CFG_ENUM_ACT_ASSIGN_CASE expression rule. Before we can configure the expression rule for the action, we need to create a few supporting objects. To create the necessary supporting objects: Create a new constant that stores the unique text value for the new action. This is used for filtering and matching. See CMGT_CFG_TXT_ACT_ASSIGN_CASE as an example. Create a translation string for the name of the action. This is used for the display name of the action in the selection dropdown. Create an interface to handle any input fields the user will need to enter when selecting and configuring the new action in the Control Panel workspace. See CMGT_WFL_AutomationRule_Configure_AssignmentLogic as an example. Create an expression rule that takes in the correct inputs based off the selections in the interface you just created and formats the read-only view of the selections. See CMGT_WFL_CaseType_Rules_FormatAssignAction as an example. Create an expression rule that takes in and formats the process parameters for the action's process model. See CMGT_AUTO_EVAL_CaseAssignment_DetermineProcessParameters as an example. If the process model doesn't require any process parameters, create an empty expression rule for this value. It's important to pass in a value, even if it's null, so that it doesn't cause the process to error. Create an expression rule that checks which fields are needed in order to select the new action. See CMGT_WFL_AutomationRule_Configure_Action_AssignCase_IsComplete as an example. Now that we have the supporting objects created, we can update the expression rule for the action. To call the supporting objects and make additional configurations to the expression rule: In the expression rule for the action, find and update the following keys and their values in the a!map() function. Key How to update the value actionCode Reference the constant for the unique text value. name Reference the translation string for the action name. configurationRule Reference the user input interface used to configure the action. configurationDisplayRule Reference the expression rule that formats the read-only view of the action. PmConstant Reference the constant that points to the process model for the action. pmParameterEvalRule Reference the expression rule for the process parameters. context Reference the CMGT_CFG_TXT_ACT_CONTEXT_CASE constant, which allows the action to be used as an option in automation rules. Your expression should look similar to the expression below: With our supporting objects created and referenced by the expression rule for the action, we now need to configure a few other objects to finish the setup of the new action: Add the expression rule for the action to the list of actions in the CMGT_CFG_ENUM_ACTIONS expression rule. Find and open the CMGT_WFL_AutomationRule_Configure_Action interface. In the expression for the CMGT_WFL_AutomationRule_Configure_Action interface, update the saveInto parameter for the action dropdown to include the initial saves of the fields and record types needed for the new action, if applicable. See lines 65-88 of the CMGT_WFL_AutomationRule_Configure_Action interface or the if() statement with the ASSIGN_CASE and the REASSIGN_CASE action codes as examples. Find and open CMGT_WFL_AutomationRule_Configure_Action_IsComplete expression rule. Find the match statement. Add a new equals condition for the new action id from the constant you created to store the unique text value for the new action. Add a new then condition and reference the expression rule you created to check which fields are needed in order to select the new action. Adding additional roles for case assignment and re-assignment actions To add additional roles for actions case assignment and re-assignment automation rules: In Designer, find and open the CMGT_WFL_AutomationRule_Configure_AssignmentLogic and CMGT_AutomationRule_Configure_AssignmentLogic interfaces. In expressions for both interfaces, update the local!roleTypes local variable to add the new reference ID for the new roles. This is the value of the roleTypeId parameter in the CMGT_QR_GetRoleType query rule. Make sure to SAVE CHANGES. Now these roles will appear in the Control Panel workspace: Adding additional roles to conditions A condition in an automation rule is an individually configurable logical statement that consists of a field, operator, and value, and all allows you to define additional logic to make your automation rules more tailored to your case processes. A condition is based on the value of a Field, which has default options for business users to choose from. Some of the default field options are role-based, such as case assignee, group assignee, and case watcher. Through additional configurations in Designer, low-code developers can add fields for other kinds of roles to the condition configurations. Including other relevant roles in conditions allows you to make more robust conditions that can apply to more users throughout your organization and processes. To add additional roles to be used as fields in conditions: In Designer, find and open the CMGT_AUTO_EVAL_AvailableFieldCustomizations_CaseRole expression rule. In the expression rule, find the customFieldsToAdd key in the outer a!map() function. If the new role you want to add is a group, copy the a!map() section for the Group Assignee and paste it at the end of the array. You'll edit this map in the subsequent steps. If the new role you want to add is a user, copy the a!map() section for the user assignee and paste it at the end of the array. You'll edit this map in the subsequent steps. The user assignee refers to any of the sections in the map function with the comment highlighting the Case Assignee or Case Watcher. Use the one most applicable to your use case. Update the value of the customFieldCode key to a unique code for the new role type you are adding. Update the value of the displayName key to the name of the role to show to business users during configuration. Update the values of both the evaluations and configurations parameters in the extraConfigurations key: For evaluations, update the value of the filters parameter to call the ID of the new role. For configurations, update this to be a list of a!map() functions that include any necessary additional configurations for the specific field for the role. These configurations include anything that impacts the type and value fields that are displayed when a field for a role is selected. Leave the other keys and their values unchanged. Make sure to SAVE CHANGES. Now these fields will appear in the Control Panel workspace: Adding additional fields to conditions You may have fields from record types related to a case that you want to use when creating conditions in automation rules. The steps below explain how to configure which related record fields can be used in the conditions for automation rules depending on the type of record type relationship you’re using. You can do these configurations with three types of record type relationships: one-to-one, many-to-one, and many-to-one relationships. These configurations only work for record data that is directly related to the CMGT_Case record type, and cannot be used with record data that is related to record types for case categories and types. Add fields from a one-to-one relationship You can use related record fields from a record type with a one-to-one relationship with the CMGT_Case record type in a condition for an automation rule. Records with a one-to-one relationship to the CMGT_Case record type are written alongside the case. For example, you may have a separate custom record type for case address information (i.e. CMGT_CaseAddress) that stores street address, city, county, state, and zip code. When an end-user submits a new case, the address fields from the case are written directly to a new record in the case address information record type and a relationship is created between the new case record and new case address record. To configure fields from a record type with a one-to-one relationship with the CMGT_Case record type to use in automation rule conditions, you first need to create and configure a new expression rule: In Designer, find and duplicate the CMGT_AUTO_EVAL_AvailableFieldCustomizations_Case expression rule. In the new expression rule, update the keys in the map function with the following values: Key How to update the value recordTypeUuid The UUID of the related record type. recordType The record type reference of the related record. relationship The relationship reference from the CMGT_Case record to the related record. recordCaseField The field reference from the related record to the caseId field. fieldMapsToAdd A list of a!map(), with one a!map() for each related record field that you want to be available when creating conditions. See the table below for a list of keys. customFieldsToAdd Not needed for one-to-one relationships. In the fieldMapsToAdd key, set the keys in each map function to the values below: Key How to update the value uuid The uuid of the field on the related record. See tip below for tips on finding the record field UUID. fieldName The name of the field on the related record. displayName The reference to the displayName property of the record field. relationship The relationship reference from the CMGT_Case record to the related record. field The reference to the record field on the related record. fieldType The text value of the field's data type. Valid values are listed below. recordType The record type reference to the record type that stores the choice list options for the choice list field. This key is only needed if the field is a choice list field. typeIcon Not needed. typeDisplayName Not needed. parentRecordTypeUuid The uuid of the CMGT_Case record, set to CMGT_UUID_RECORD_TYPE_CASE. Tip: The easiest way to find the uuid of a record field is to write out the reference to the field in an expression and then comment it out. The field uuid will display in curly brackets {} before the field name. Valid values for fieldType: TEXT LONG_TEXT XL_TEXT INTEGER DECIMAL DATE DATETIME BOOLEAN GROUP RecordType CHOICE_LIST USERNAME Once your new expression rule is created and configured, you can add it to existing objects throughout the application: Open the CMGT_AUTO_EVAL_AvailableFieldsCustomizationsWrapper_Case expression rule and add your new expression rule to the list of expression rules. Open the CMGT_AUTO_EVAL_returnRuntimeValue expression rule. In this expression rule, update the condition in the if() statement so that it is wrapped in an or() function. Add the following two conditions to the or() function: 1 2 index(ri!field, "relationshipType", null) = "ONE_TO_ONE", index(ri!field, "relationshipType", null) = "ONE_TO_MANY", Add fields from a many-to-one relationship You can use related record fields from a record type with a many-to-one relationship with the CMGT_Case record type in a condition for an automation rule. Records with a many-to-one relationship to the CMGT_Case record type can be added as related data in the control panel object. For example, you might want to use a choice list field for Region on CMGT_Case record type, where Region is a reference to data that was set up as related data on the Control Panel. To configure fields from a record type with a many-to-one relationship with the CMGT_Case record type to use in automation rule conditions, you need to edit three existing objects: In Designer, open the CMGT_Automation_ConditionValueField interface. In the expression for the match() statement, find where the whenTrue condition is set to "CHOICE_LIST". Update the condition so that it is wrapped in the or() function. Add a new condition to the or() function where fv!value = "RELATED_DATA". Open the CMGT_Automation_returnConditionValueForDisplay expression rule. In the expression for the match() statement, find where the whenTrue condition is set to "CHOICE_LIST". Update the first condition in the and() function so that it is wrapped in the or() function. Add a new condition to the or() function where fv!value = "RELATED_DATA". Open the CMGT_UTIL_RecordBackedDropdownField interface. In the expression, find the a!dropdownField() component. In the data parameter of the local!PkField local variable, remove the second a!queryFilter. Now, when you go to configure a condition for an automation rule, the field will appear: Add fields from a one-to-many relationship You can use related record fields from a record type with a one-to-many relationship with the CMGT_Case record type in a condition for an automation rule. Records with a one-to-many relationship to the CMGT_Case record type may have multiple instances per single case. For example, your case might have multiple required reviews, so you might have a separate custom record type (CMGT_CaseReview) that stores the name, description, type, etc. for each required review. Each time a review is made for the case record, a new record is created in the CMGT_CaseReview record type. To configure fields from a record type with a one-to-many relationship with the CMGT_Case record type to use in automation rule conditions, you first need to create and configure a new expression rule: In Designer, find and duplicate the CMGT_AUTO_EVAL_AvailableFieldCustomizations_CaseRole expression rule. In the new expression rule, update the keys in the map function with the following values: Key How to update the value recordTypeUuid The UUID of the related record type. recordType The record type reference of the related record. relationship The relationship reference from the CMGT_Case record to the related record. recordCaseField The field reference from the related record to the caseId field. fieldMapsToAdd A list of a!map(), with one a!map() for each related record field that you want to be available when creating conditions. See the table below for a list of keys. customFieldsToAdd Not needed for one-to-one relationships. See the note below to determine if you need this key, and how to set it up. Note: For examples of how to set up the fields in the customFieldsToAdd key, see the CMGT_AUTO_EVAL_AvailableFieldCustomizations_CaseRole expression rule for reference. For example, you might need extra configurations if there are different types of required reviews, and you want to create a condition that just applies to one type. In the fieldMapsToAdd key, set the keys in each map function to the values below: Key How to update the value uuid The uuid of the field on the related record. See tip below for tips on finding the record field UUID. fieldName The name of the field on the related record. displayName The reference to the displayName property of the record field. relationshipType ONE_TO_MANY relationship The relationship reference from the CMGT_Case record to the related record. field The reference to the record field on the related record. fieldType The text value of the field's data type. Valid values are listed below. recordType The record type reference to the record type that stores the choice list options for the choice list field. This key is only needed if the field is a choice list field. typeIcon Not needed. typeDisplayName Not needed. parentRecordTypeUuid The uuid of the CMGT_Case record, set to CMGT_UUID_RECORD_TYPE_CASE. Tip: The easiest way to find the uuid of a record field is to write out the reference to the field in an expression and then comment it out. The field uuid will display in curly brackets {} before the field name. Valid values for fieldType: TEXT LONG_TEXT XL_TEXT INTEGER DECIMAL DATE DATETIME BOOLEAN GROUP RecordType CHOICE_LIST USERNAME Once your new expression rule is created and configured, you can add it to existing objects throughout the application: Open the CMGT_AUTO_EVAL_AvailableFieldsCustomizationsWrapper_Case expression rule and add your new expression rule to the list of expression rules. Open the CMGT_AUTO_EVAL_returnRuntimeValue expression rule. In this expression rule, update the condition in the if() statement so that it is wrapped in an or() function. Add the following two conditions to the or() function: 1 2 index(ri!field, "relationshipType", null) = "ONE_TO_ONE", index(ri!field, "relationshipType", null) = "ONE_TO_MANY", Feedback Was this page helpful? SHARE FEEDBACK Loading...