In reply to: Daniel Krüger (Cosmo Consult)
Hi Nik,
the OnTimeout is created when a workflow enters a step with the current configuration. If you change the interval this will only apply to workflows which entered the step afterwards.
If you want to repeat something for all workflows you need to create a cycling action. I think it's on the tab where you can set global menu buttons.
While you can check the OnTimeout actions in the administrative view of a workflow instance you need to use the Designer Studio for the cycling actions.
Back to your original goal.
As you mentioned this can be dangerous because numerous versions may be created.
I would choose a different approach. I'm assuming that you started/created some external content from the workflow and are now waiting for a state change of the external content. Maybe you placed a purchase order in an ERP system and are waiting that this is closed. Because you don't have access to the ERP systems it can't tell your workflow that it's finished and you need to pull the state.
In this case I would create a separate monitoring workflow. A new instance will be created via a cycling action.
1. Step: Gather all waiting workflows in an item list
2. Step: Query the ERP system for the state of those workflows
3. Step: Compare returned values to workfow values and set an action: Nothing Todo, move forward
4. Step move all workflows whit the appropriate action.
This has a few benefits:
You have a detailed overview/logging why something didn't happen
You can test it without waiting for the external system.
You don't create multiple versions on the workflow instances
You can delete these monitoring workflow instances via a cycling action after some days
Best regards,
Daniel
Hi Daniel!
Thanks for your answer.
I wasn't aware that timeout is only running, when workflow instance enters the step, where timeout is defined, but thanks for the clarification on that.
I build a custom action, which checks changes in some fields compared with external data (text fields, user fields) and I'm only saving changes, when data
has changed. Property args.HasErrors is very useful on that ;-)
So we are able to do a periodic pull of external data and we are not creating any new versions if nothing has changed.
When it comes to external data at the moment we have a well defined a JSON structure and some mock data for testing. In the future it is planned
to call some external REST services to get the data, but this is not available yet.
At the moment I have no idea of how to get the JSON file, maybe it should be added periodically as an attachment to another workflow (via REST call from
the external system)?
The next thing is how to read this attachment in my custom action, how can this be done?
And I also don't want to pull the whole content each time (this happens on every workflow element), parse the whole structure and filter out my relevant data to be able to update current instance (we are talking about several thousand instances).
Maybe you have some thoughts on that, which are pushing me in the right direction?
Thanks a lot in advance & best regards, Nik