How to trigger Sub flow (Flow designer) using business rules

Madhan27
Mega Guru

I am trying to create a business to trigger Sub flow for an closed alert,  I copied the flow designer code snippet and pasted in the business rules but I am not getting what are the values to be given for the below following.

 

Madhan27_0-1702822414107.png

 

Thanks in advance. 

1 ACCEPTED SOLUTION

Madhan27
Mega Guru

We need to set the conditions when to run and in actions with the below following script its calling the flow designer on closed alerts.

 

 

(function executeRule(current, previous /*null when async*/ ) {

    (function() {


        try {

            var inputs = {};
            inputs['ah_alertrulename'] = 'ICO Fault Management Flow';
            inputs['ah_alertruleid'] = 'dee9da63873971d035a90e96cebb3530';
            inputs['ah_alertgr'] = current;
            var result = sn_fd.FlowAPI.getRunner().subflow('global.ico_fault_management_flow').inForeground().withInputs(inputs).run();
            var outputs = result.getOutputs();

        } catch (ex) {
            var message = ex.getMessage();
            gs.error(message);
        }

    })();

View solution in original post

5 REPLIES 5

Madhan27
Mega Guru

We need to set the conditions when to run and in actions with the below following script its calling the flow designer on closed alerts.

 

 

(function executeRule(current, previous /*null when async*/ ) {

    (function() {


        try {

            var inputs = {};
            inputs['ah_alertrulename'] = 'ICO Fault Management Flow';
            inputs['ah_alertruleid'] = 'dee9da63873971d035a90e96cebb3530';
            inputs['ah_alertgr'] = current;
            var result = sn_fd.FlowAPI.getRunner().subflow('global.ico_fault_management_flow').inForeground().withInputs(inputs).run();
            var outputs = result.getOutputs();

        } catch (ex) {
            var message = ex.getMessage();
            gs.error(message);
        }

    })();