SAS Intelligent Decisioning is a cool little tool with lots of deployment functionality built in. However, as you field workers know, it usually only takes about 5 minutes before your customer is asking to deploy decision logic in some novel and unsupported way. So how can we get decision and rule set generated code to incorporate in other applications like ESP, remote SAS servers, etc.?
For the purposes of this post, we're only concerned with extracting the generated decision code. So let's look at an example of the actual command used to extract the code:
https://intviya01.race.sas.com/decisions/flows/0b2a6c4f-afa3-4440-9705-16299cbc346c/code?codeTarget=...
As you can see, the command is a REST GET. It uses the Viya Decision Management REST API. Breaking the command into pieces, we can see how to use it:
For more information on the API and options, see the doc here and here. You can get the Decision ID from the Intelligent Decisioning User Interface (Decision --> Properties Tab) among other places.
The example above extracts the code from a Decision but you can also extract Rule Set code. A sample Rule Set code extraction call is below. Note the different URL path (/businessRules/ruleSets/😞
https://intviya01.race.sas.com/businessRules/ruleSets/a44445ab-3f65-4cc4-a206-bfe2e014e206/code?code...
Below is an example of the API command being rendered through Chrome and producing the decision code.
Select any image to see a larger version.
Mobile users: To view the images, select the "Full" version at the bottom of the page.
Running the API command in Chrome as shown above will trigger the Viya UI login screen for authentication.
More information on authentication to Viya's REST API can be found here, https://blogs.sas.com/content/sgf/2019/01/25/authentication-to-sas-viya/.
Search for more content from our group: SAS Global Enablement & Learning.
.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning and boost your career prospects.