how to call the subflows in Business Rule Condition

Saib1
Tera Guru

Hi ,

On the business rule , if we need to add the wf_activity we put the condition like below.

Condition : current.wf_activity.name=='XXXXXXXx'

whereas if we need to add the subflows on the condition what to do?

 

2 REPLIES 2

Harish KM
Kilo Patron
Kilo Patron

Hi refer the example here

https://developer.servicenow.com/dev.do#!/reference/api/quebec/server/sn_fd-namespace/ScriptableFlowAPI#ScriptableFlow-startFlow?navFilter=startflow

Regards
Harish

Community Alums
Not applicable

Hi,

 You can call workflow/subflow using below code :

var gr = new GlideRecord('wf_workflow');
gr.addQuery('name', 'Restart Linux Server');
gr.query();
if (gr.next()) {
var wf = new Workflow();
var workflowId = '' + gr.sys_id;
var vars = {};
wf.startFlow(workflowId, current, current.operation, vars);
}
action.setRedirectURL(current);

Mark my answer correct & Helpful, if Applicable.

Thanks,
Sandeep