Hi,
I have a workflow that waits until a custom event takes place or reaches maximum time limit before going to the next item. I need to update the maximum time limit value while the workflow is running. I want to do this from another workflow when certain conditions are met.
To put it simply, is it possible to update attributes of a workflow instance from another workflow?
I have checked WorkflowToken object and do no see anything to perform an update operation. An help is appreciated. Thanks in advance.
Hi,
Messing with the attributes of another workflow execution sounds like a bad idea to me.
Why not using some more conventional options to share configuration information, eg. using configuration element attributes? ConfigurationElement scripting class has useful methods to rad/write element attributes values.
Agree with you. Right now I am already working on the approach you have mentioned.
Meanwhile, do you know if the waitCustomEventUntil end time can be increased ?
System.waitCustomEventUntil(string , string , endDate)
You might want to give some more details of what you're trying to achieve. One alternative Approach is that you could leverage a message server and the amqp plugin to manage complex interactions between workflows.
Hi Cloudred,
We have a workflow that requests for IP address and waits for 40 minutes using waitCustomEventUntil. Refer to below code.
// Calculate custom event wait time
endDate = new Date();
endDate.setMinutes(endDate.getMinutes()+ 40);
eventType = "internal";
eventName = payload["machine"]["id"]
eventCustom = System.waitCustomEventUntil(eventType,eventName,endDate);
unpause= (eventCustom != null) ;
When we receive IP address, we resume the above workflow using System.sendCustomEvent(eventName);
Request IP address workflow will wait until a custom event occurs with 'eventName'. Now we need to extend the end time of custom event to 2 hours while the workflow is waiting during the 40 minute timeframe in case of we see any errors.
Thanks.