- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-27-2016 04:18 AM
I have added a wait for condition in the workflow and checking a field value inside the script , this field is getting populated from another REST message call.
In wait for condition, i have made a query to the table which has this field.
Now since the field is getting populated asynch , and if the script executes in wait for condition , and it does not match , it remains at the same running stage, until the workflow is retrigerred.
Is there a way, to retrigger the same halted activity?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-03-2016 05:02 AM
Thanks for your responses.
I have implemented a solution which works fine.
Trigerred the event defined in wait for event activity from the scripted web services using the below code.
new Workflow.broadcastevent(context.sys_id,"event_name").
For workflow, events is identified only through broadcast events and not gs.eventqueue
Eariler i was trying to trigger an event through eventqueue, which though was showing in event logs, did not interacted with event of wait for event activity.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2016 04:00 AM
By global table means, the workflow is defined on the global table..
Further, there is a wait for condition activity , as one of the activity present in this workflow as below :
Now once the workflow gets triggered and reaches wait for condition , this conditional script executes, and remains in the running state.
Note: In Condition Filter, i am not able to see any result field, so had to write conditional script.
Now, i trigger a different workflow / run a background script to populate the result field of the wf_context record which is created through the above workflow, hoping that the wait for condition will execute itself and pass through. But there needs to some mehanism to retrigger this activity since it does not execute itslelf again.
Do you have any idea over here?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2016 04:40 AM
In your screenshot you note that the value is set from another workflow - you did not mention that in your original post. Couldn't that other workflow fire the event?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2016 05:49 AM
Hi Julian,
In the screenshot i mentioned another workflow.. and in previous statement I mentioned "I have added a wait for condition in the workflow and checking a field value inside the script , this field is getting populated from another REST message call."
Basically another workflow, is triggering the REST Message whose endpoint is pointing to the scripted REST API and in this API, i am updating the result field of the workflow context. This is all behind the scene which need not be of interest here.
Overall, i am just setting the "result" field in workflow context record.
In the same scripted Rest API , i did tried creating an event, after registering that event in event registry.
Then created "wait for event" in the workflow activity instead of "wait for condition"
This behaves similar to wait for condition and halts at running state.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2016 06:04 AM
Anyone has any idea over here?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2016 06:26 AM
Hi Ashwani,
Just a question - do you think if there is a way to get the workflow context id when the field is updated from the REST message call?
Because, triggering an event could work if you trigger that event using proper workflow context (hint: broadcastEvent).
Will give some more thought to how to achieve this in the absence of workflow context id - if you confirm on above.