09-05-2017 11:36 AM
Is there an equivalent in an iWorkflow script of the workflow action "Assign to user" for rule-based load balanced workflow queues?
09-05-2017 11:46 AM
I don't think so. Our approach for that need is to have the script set a Property, and have Workflow Assign To based on the Property.
09-05-2017 11:46 AM
I don't think so. Our approach for that need is to have the script set a Property, and have Workflow Assign To based on the Property.
09-05-2017 01:02 PM
09-06-2017 05:52 AM
About as easy as it can get, off the WorkfowEventArgs object:
args.PropertyBag.Set("propName", "a value");
args.SessionPropertyBag.Set("propName2", "another value");
Reading a property set by Workflow is a teeny bit more work, using a standard C# "TryGetValue()" on args.PropertyBag. I like to wrap it up in a little extension method, something like this:
public static class MyExtensionMethods
{
public static string GetString(this Hyland.Unity.Workflow.PropertyBag thisPropertyBag, string propertyName, string defaultValue = "")
{
string value;
return thisPropertyBag.TryGetValue(propertyName, out value) ? value : defaultValue;
}
}
I like to keep many Unity scripts working as much as possible as "pure functions"- they take an input via properties and return an output via a property. Workflow sets inputs, and uses the outputs. That is often helpful for putting things that need to be in a script, or are clearest to implement in a script, while keeping as much business logic as possible in Workflow. It also can be helpful for making a script more generic and re-usable without making it itself more complicated.
Of course, that approach doesn't always make sense (there are other times when I'll argue that once a script is involved, it is cleanest to have it do as much as possible in one place), and trying to do it blindly or everywhere will just add complexity and confusion.
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.