Issue: Workflow breaks in conditional check. Task assignments happen as expected but when a conditional check is made, the workflow gets suspended and does NOT proceed further.
Solution: If the logic is using values from a drop-down field in the list,
- Assign it to a workflow variable first and
- Use that for comparision and progressing the flow of the work(flow) so it flows through the flowing process without any flowterruption…(you get the idea)
Here are a couple of errors that weren’t very easy to read for me and got resolved by using the variable instead of direct drop down comparison in the conditional logic:
- RequestorId: 6af60554-722a-25a9-0000-000000000000. Details: An unhandled exception occurred during the execution of the workflow instance. Exception details: System.FormatException: The input source is not correctly formatted. —> System.Xml.XmlException: Encountered unexpected character ‘C’. at System.Xml.XmlExceptionHelper.ThrowXmlException(XmlDictionaryReader reader, XmlException exception) at System.Runtime.Serialization.Json.XmlJsonReader.ReadAttributes() at System.Runtime.Serialization.Json.XmlJsonReader.Read() at Microsoft.Workflow.Common.Json.JXmlToJsonValueConverter.MoveToRootNode(XmlDictionaryReader jsonReader) at Microsoft.Workflow.Common.Json.JXmlToJsonValueConverter.JXMLToJsonValue(XmlDictionaryReader jsonReader) — End of inner exception stack trace — at Microsoft.Workflow.Common.Json.JXmlToJsonValueConverter.JXMLToJsonValue(XmlDictionaryReader jsonReader) at Microsoft.Workflow.Common.Json.JXmlToJsonValueConverter.JXMLToJsonValue(Stream jsonStream, Byte[] jsonBytes) at Microsoft.Activities.DynamicValue.ParseJson(String json) at System.Activities.CodeActivity`1.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager) at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation) Exception from activity ParseDynamicValue DynamicActivity<Boolean> Conditional Branch – divisions match Approved ControlFlowStep Start a task process – Director No Conditional Branch – IsDirector Sequence If If While State Machine – start with PendingApproval Sequence Flowchart Precision Workflow.WorkflowXaml_6082b5e4_5914_4290_bd2f_b4ecc8df5dab
- RequestorId: 6af60554-722a-25a9-0000-000000000000. Details: An unhandled exception occurred during the execution of the workflow instance. Exception details: System.FormatException: Input string was not in a correct format. at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) at Microsoft.Activities.Expressions.ParseNumber`1.Execute(CodeActivityContext context) at System.Activities.CodeActivity`1.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager) at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation) Exception from activity ParseNumber<Int32> FormatString IsEqualString Conditional Branch – divisions match Approved ControlFlowStep Start a task process – Director No Conditional Branch – IsDirector Sequence If If While State Machine – start with PendingApproval Sequence Flowchart Precision Workflow.WorkflowXaml_6082b5e4_5914_4290_bd2f_b4ecc8df5dab
Solution workflow at a glance:
Resulting smooth operations…smoooth operationsss…isn’t there a song like that? I think there is, perhaps I am just happy that this is resolved…oh well! If it helps ya, give a like.