workflow execution is not working during update

vinitaraico
Tera Contributor

Hi Team,

I have created a workflow where condition is if state change to "awaiting vendor " added a timer activity  to wait for 24 once 24 hour pass  send a notification and change the status of incident to "active" ,flow is working fine and set the status of incident to active  ,However if again i am changing status from active to "awaiting vendor " workflow not working  after 24 hour also state is not changing t active .

 

any suggestion why it is not working second time 

 

2 REPLIES 2

Sandeep Rajput
Tera Patron
Tera Patron

@vinitaraico Usually workflow triggers only for one time when the condition associated with it is evaluated to true. If you wish to re-trigger the workflow then you can do it by creating an onAfter Update business rule on your table and adding the condition State Changes To "Awaiting Vendor". You can put the following script inside the script field.

 

new Workflow().restartWorkflow(current, false);

 

Please refer to https://developer.servicenow.com/dev.do#!/reference/api/washingtondc/server_legacy/c_Workflow_api#r_... to know more about restartWorkflow method.

 

Hope this helps.

Thanks Sandeep ,I tried But it is not working