Get the mapped code for a decision
post/flows/{decisionId}/mappedCode
Returns the code that is used to run the decision based on the provided data and mapping information in the request.
1{2 "code": "\nds2_options scond=none;\n/* Custom Object add_cf retrieved on Fri May 07 16:53:12 UTC 2021 */\n/*{\"signatureExtension\":[]}*/\npackage \"add_dec_add_cf\" ;\n method execute(double a, double b, in_out double c);\n c=a+b;\n end;\nendpackage;\n ds2_options scond=none;\n\n/* Decision add_dec version 1.5 generated on Fri May 07 16:53:12 UTC 2021 */\n package Decision_ba7b8073_83f7_41ae_827 ;\n dcl package logger logr_perf('App.tk.SID.Perf');\n dcl double timer_start;\n dcl double elapsed_time;\n dcl double total_timer_start;\n dcl double total_elapsed_time;\n\n dcl package \"add_dec_add_cf\" \"add_dec_add_cf_hdl\"();\n\n method initRuleFiredRecording();\n dcl integer ruleFiredStartPosition;\n\n /* query and set offsets - always traverse in same order as execute() method */\n ruleFiredStartPosition = 1;\n end;\n\n method init();\n initRuleFiredRecording();\n end;\n\n method execute (\n double \"a\"\n ,double \"b\"\n ,in_out double \"c\"\n ,in_out varchar \"PathID\"\n ,in_out char \"ruleFiredFlags\"\n ,in_out integer \"rulesFiredForRecordCount\"\n ,in_out integer \"_filter_\"\n\n );\n dcl integer dg_filter_;\n\n total_timer_start = datetime();\n\n timer_start = datetime();\n \"add_dec_add_cf_hdl\".execute(\"a\", \"b\", \"c\");\n elapsed_time = datetime() - timer_start;\n logr_perf.log( 'd', 'Package Name: Decision_ba7b8073_83f7_41ae_827, Node Name: add_cf, Node ID: 5da31100-8063-4dae-8b6d-dbc5965328d9, NODE DURATION: ' .. elapsed_time);\n if (\"_filter_\" = 0) then return;\n\n \"PathID\" = \"PathID\" || '/' || '5da31100-8063-4dae-8b6d-dbc5965328d9';\n\n \"end\":/*label for decision node link to flow end*/\n\n total_elapsed_time = datetime() - total_timer_start;\n logr_perf.log( 'd', 'Package Name: Decision_ba7b8073_83f7_41ae_827, TOTAL DURATION: ' .. total_elapsed_time);\n\n end;\n endpackage;\n ds2_options scond=none;\n thread decisionFlowThread ;\n dcl package Decision_ba7b8073_83f7_41ae_827 decisionPackage();\n dcl varchar(38) \"PathID\";\n dcl char(1) \"ruleFiredFlags\";\n dcl integer \"rulesFiredForRecordCount\" having label 'Rules Fired Count';\n dcl char(36) \"_recordCorrelationKey\";\n\n dcl integer \"_filter_\";\n /* declare input terms not read in from SET statement */\n\n /* declare output terms not read in from SET statement */\n dcl double \"c\";\n\n /*declare static terms */\ndcl double \"b\";\ndcl double \"a\";\n\n keep\n\n \"PathID\" \"ruleFiredFlags\" \"rulesFiredForRecordCount\" \"_recordCorrelationKey\"\n \"c\"\n ;\n\n method resetruleFiredCounts( in_out char \"ruleFiredFlags\", in_out integer \"rulesfiredforrecordcount\");\n \"rulesfiredforrecordcount\"=0;\n end;\n\n method init();\n decisionPackage.initRuleFiredRecording();\n end;\n\n method run();\n dcl integer localRC;\n\n set \"Public\".\"DUAL\"(\n );\n\n \"b\" = 3;\n \"a\" = 2;\n\n \"PathID\" = '';\n\n resetruleFiredCounts(\"ruleFiredFlags\", \"rulesfiredforrecordcount\");\n\n \"_filter_\" = 1;\n\n decisionPackage.execute(\n \"a\"\n ,\"b\"\n ,\"c\"\n ,\"PathID\"\n ,\"ruleFiredFlags\", \"rulesFiredForRecordCount\"\n\n ,\"_filter_\"\n);\n \"_recordCorrelationKey\" = uuidgen();\n\n output;\n end;\nendthread;\n\n ds2_options scond=none;\n\n data \"Public\".\"add_dec_Scenario_1_add_dec_2021-05-07_16-53-11_output\"(\n overwrite=yes);\n\n dcl thread decisionFlowThread t;\n\n method run();\n set from t threads=4;\n output \"Public\".\"add_dec_Scenario_1_add_dec_2021-05-07_16-53-11_output\";\n end;\n enddata;\n",3 "codeType": "text/vnd.sas.source.ds2",4 "outputTableName": "add_dec_Scenario_1_add_dec_2021-05-07_16-53-11_output",5 "outputLibraryName": "Public",6 "version": 17}
Name | Type | Required | Description |
---|---|---|---|
decisionId | string | true | The identifier for the decision. Examples: "094078e7-278a-4719-a704-6e5e65af29ee" |
Request containing hints to generate mapped code using the Scoring Definition by Score Object.
Name | Type | Required | Description |
---|---|---|---|
scoreDefinitionId | string | true | The score definition ID that is used for generating mapped code. |
hints | object | false | Hints for generating mapped code. The mapped code request is forwarded to the score object of the score definition. The score object should understand these hints. |
Status | Meaning | Description | ||
---|---|---|---|---|
200 | OK | The request succeeded. | Headers | Schema |
400 | Bad Request | The request was invalid. | Headers | Schema |