Interactions in SAS Model Risk Management are a powerful tool that allow you to control how users interact with the solution and how different components interact with each other. By leveraging out-of-the-box (OOTB) interactions, you can gain a better understanding of how these interactions work and how to customize them to meet your specific needs. In this post, I'll walk you through a demonstration of using an existing interaction from SAS Model Risk Management to understand the basics of interactions.
Getting Started
Before we dive into the demonstration, let's set the stage. Interactions in SAS Risk Cirrus function like scripts that handle events and perform specific actions. These interactions are constructed using logical steps, which outline the sequence of actions to be executed. By using OOTB interactions, you can see how these functions are constructed with logical steps and how they can be changed.
Types of Interactions
There are three types of interactions in SAS Risk Cirrus: Solution, Page, and Component.
Solution triggers are called when the solution first loads. For example, when the solution first loads, you may want to set up initial configurations such as loading user-specific settings, initializing menus, or setting default values for certain fields.
Page interactions are specific to certain pages. An example of this could be when a specific page loads, you may need to validate the data displayed on the page to ensure that all required fields are filled out correctly.
Component interactions control the behavior of individual components. This could be as simple as controlling the visibility of a field based on the selection made in a dropdown menu.
Logical Steps
Logical steps are the basic building blocks of interactions in SAS Risk Cirrus. These steps outline the actions an interaction will take. They include tasks like setting variable values, using If/Else statements to make decisions, performing actions on widgets, calling functions from libraries, moving between pages, and returning specific values. By putting these steps together, you can create interactions that make your solution more dynamic and user-friendly.
Here's a list of all logical step types:
Each step type has different options associated with them. For example, the Add a comment step type only has a comment field whereas the Execute a function step type has a selection of Libraries and Functions associated with it. See the images below:
Now, that we've got some background context under our belt, let's see what this looks like in practice. We will be reviewing an OOTB interaction called, mrm_requiredFields, which is responsible for setting components to required within SAS Model Risk Management.
1. Open SAS Viya to open the landing page, which provides an overview of the available applications installed on your environment.
2. Sign into SAS Viya as an Administrator.
3. Click the Applications menu in the top left corner to reveal all installed applications.
4. Under the Administration header, click Manage Risk Solutions to open the SAS Risk Cirrus dashboard.
5. Click the SAS Model Risk Management solution card to access SAS Risk Cirrus Builder.
6. Click the << double arrows to expand the right-side menu.
7. Click the Interactions menu item.
8. Click the Editor button to open the Interactions Editor window.
9. From the Interaction scope drop-down menu, select Page level.
Note: At the Solution Level, the first interaction to run will be onFirstLoad, which loads all data and components to the screen.
From the Page drop-down menu, select MRM Model.
10. In the list of Interactions, search for the interaction named mrm_requiredFields in the Filter field.
11. Click the Copy icon to make a copy of themrm_requiredFields interaction.
Note: All OOTB interactions are read-only. To modify and override the OOTB interaction, you must make a copy and give it the exact name as the OOTB interaction you are copying. All custom interactions will have an ‘x_’ prefix by default.
12. In the Name field, enter mrm_requiredFields. The new name should look like x_mrm_requiredFields.
13. Click OK.
14. In the right-side menu, explore the following options:
15. Click on the mrm_onModelDraftLoad interaction from the References menu.
16. Use your keyboard's search function (Ctrl+F for Windows or Cmd+F for Mac) to find the mrm_requiredFields interaction within the mrm_onModelDraftLoad interaction.
17. Select the mrm_requiredFields interaction and review the logical steps using the Block Editor or the Script Editor. The Block Editor provides a user-friendly way to create functions or interactions, while the Script Editor works like a standard code editor.
18. Click the Pencil icon in the Block Editor to view more information about each logical step.
Let's break the logical steps into sections to understand what the interaction is doing:
This video demonstrates the logical steps involved with lines 2-7.
In this logical step, it's using the logical step type 'Execute a widget action' for the mrm_developers widget on the current page (MRM Model). And then, uses the True value for the 'Set required' Action.
19. Open the Script Editor. We can see the same logic as the Block Editor but in a different format.
You can use the Block Editor for selecting each of the options and the Script Editor for easy viewing.
20. Open a new tab and navigate to the SAS MRM bookmark to open SAS Model Risk Management.
21. Navigate to the Models page and open any model.
22. Find the following components:
Model ID, Model Name, Classifications (or Dimensions), and Development source. These can be found on the Details tab.
Model Owners, Model Developers, Model Users, and Model Risk Management Group. These can be found on the Teams tab.
Note: All these widgets have red asterisks, which means they are required to proceed in the workflow. These are all the widgets from lines 9 thru 15.
23. Navigate to the Production tab in SAS Model Risk Management.
24. Select the "Model has an overlay" box to see additional fields appear, some marked as required.
25. Now, navigate back to the Interactions Editor browser tab.
26. Lines 16 thru 19 are conditional required fields that apply to the Model has an Overlay checkbox from the MRM UI.
The rest of the logical step lines (20 thru 29) apply to other conditional widgets in the MRM UI like Open-Source Tools, Workflow Template, Risk Rating, and AI Rating.
This method to understand interactions allows you to get a visual of what is actually happening within the functionality of SAS Model Risk Management. In this way, you also get the how behind how logical steps work in relation to interactions.
By following these steps, you can gain a deeper understanding of how interactions work in SAS Risk Cirrus and how to customize them to meet your specific needs. This demonstration highlights the power and flexibility of interactions, enabling you to create dynamic and responsive solutions.
For more information on SAS Model Risk Management customization, click here.
For more posts about SAS Model Risk Management, click the following:
Find more articles from SAS Global Enablement and Learning here.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
The rapid growth of AI technologies is driving an AI skills gap and demand for AI talent. Ready to grow your AI literacy? SAS offers free ways to get started for beginners, business leaders, and analytics professionals of all skill levels. Your future self will thank you.