Flow designer flow is not triggering and it's not showing any error messages also

rajasekharteja
Tera Guru

Hello Everyone,


I got stuck where Approval's are not getting triggered for the job and I could see there is no execution entry created when we submit from Draft state to submit to 'Awaiting Approval'.

 

If we submit directly without using Draft option the flow is getting triggered and approvals are getting generated.

 

I have checked all the Business rules on that particular table and tried In activating the Business rule and tested but still unable to trigger the flow.

PFA flow.

 

I'm brainstorming on this , could anyone please help me with your inputs on this work. 

 

Thanks,

Raj

1 ACCEPTED SOLUTION

rajasekharteja
Tera Guru

Hello @K Akhila / @Michael Fry1 ,

Thanks for providing timely response.

As mentioned above in After update BR it's mentioned current.setWorkflow(false); so it's not triggering the flow now i'm triggering the flow using sn_fd.FlowAPI.startFlow and it's triggering the approval.

Thanks,

Raj

View solution in original post

11 REPLIES 11

Also, I tried 'changes from' Draft and 'changes To' Pending Approval but still it's not triggering the flow.

K Akhila
Kilo Guru

KAkhila_0-1684067725900.png

Please check the trigger condition again. Also please check if any client script r Business rule might affecting this. Check if the state changes and what UI action triggering. r In the Business rule check what script is added when state changes. 

Hello @K Akhila / @Michael Fry1 ,

 

Thanks for providing your inputs on this.

 

I have checked all the business rules, client scripts and ui actions and client scripts and I don't find any script causing this issue.

 

The issue I could see is whenever we submit Job 'Draft' to 'submit' in the history table old value is empty, whereas old value should be 'Draft' if I'm not wrong.

 

Please provide your inputs if my understanding is correct. 

 

PFB Snapshot for reference.

 

rajasekharteja_0-1684151380068.png

 

Thanks,

Raj

Hello @K Akhila / @Michael Fry1 ,

 

I could see there is one BR which is running on parent table when the job is in draft state in this BR it's mentioned current.setWorkflow(false) because of this line of code in the history table state value is not updating.

 

Can we write the below code on the current table.

 

(function executeRule(current, previous /*null when async*/ ) {
 
    var state = testGlobals.jobState,
        varSet;
 
    //Check the flag for draft jobs are set to Yes or not
    if (current.variables.draft_information.draft_confirmation == 'Yes') {
        if (new x_snc_coe.AuditJobUtil().isJobApprovalRequired(current) == true) {
            if (current.sys_class_name != 'job_1') { // For job_1 doesn't need immediate approval, so added this condition
                current.state = state.AWAITING_APPROVAL;
            } else {
                current.variables["independence_check"].independence_check == "Yes" ?
                    (current.state = state.ON_HOLD) :
                    (current.state = state.SCOPING);
            }
        } else {
            //set the state to On Hold or Pending CoE Acceptance based on the indpendence check.
            if (
                current.sys_class_name == "job_2" ||
                current.sys_class_name == "job_3"
            ) { //for Pensions and ESH
                varSet = "request_information";
            } else { //all other CoEs
                varSet = "independence_check";
            }
            current.variables[varSet].independence_check == "Yes" ?
                (current.state = state.ON_HOLD) :
                (current.state = state.PENDING_COE_ACCEPTANCE);
            gs.addInfoMessage('Your request has been submitted to the Team');
        }
    
// to update the Assignment groups when a Job is moved from Draft to Any other State
        if (current.sys_class_name == "job_4") {
            var aceTeam = current.variables.ace_team; //Mapping Ace Team to Assignment group
            current.assignment_group = aceTeam;
        }
 
        current.setWorkflow(false);
        if (current.update()) {
            gs.addInfoMessage("Job updated.");
        }
    }
})(current, previous);
 
Thanks,
Kuchi

This BR is running on the parent table? That shouldn't affect any Flows running on child table.