OpenRPA: Error because of Workflow name

OpenRPA version: 1.4.50
OpenFlow version: 1.4.36
Using self hosted openflow:
Error message:

My colleague discovered that when he had a workflow which had “-” in the name, the Workflow designer reports an error when he tries to add a String In argument with a default value.

So he is allowed to save the workflow (that has a weird name admittedly), code, run and use it, with String Out parameters for instance. But when he adds a String In parameter with a default argument, then the error occurs. In my opinion, he should never have been allowed to save it with this name in the first place, if the workflow name does not support normal usage (adding String In parameters for with default values).

I have attached an example workflow here.
Bug - Workflow.json (4.0 KB)
I hope it gets imported with “-” in its name.

It does not have a default value for the parameter, but when you add it and try to save the error occurs.

When setting an empty string as default parameter:

System.NullReferenceException: Object reference not set to an instance of an object.
   at MS.Internal.Xaml.Parser.XamlScanner.ReadElement()
   at MS.Internal.Xaml.Parser.XamlScanner.DoXmlRead()
   at MS.Internal.Xaml.Parser.XamlPullParser.<P_NonemptyPropertyElement>d__11.MoveNext()
   at MS.Internal.Xaml.Parser.XamlPullParser.<P_PropertyElement>d__9.MoveNext()
   at MS.Internal.Xaml.Parser.XamlPullParser.<P_ElementBody>d__8.MoveNext()
   at MS.Internal.Xaml.Parser.XamlPullParser.<P_Element>d__5.MoveNext()
   at MS.Internal.Xaml.Parser.XamlPullParser.<Parse>d__4.MoveNext()
   at MS.Internal.Xaml.NodeStreamSorter.MoveNext()
   at System.Xaml.XamlXmlReader.Read()
   at System.Activities.Debugger.XamlDebuggerXmlReader.Read()
   at System.Xaml.XamlSubreader.LimitedRead()
   at System.Activities.XamlIntegration.DynamicActivityXamlReader.BufferedPropertyList.BufferDefinitions(DynamicActivityXamlReader parent)
   at System.Activities.XamlIntegration.DynamicActivityXamlReader.ProcessCurrentNode()
   at System.Activities.XamlIntegration.DynamicActivityXamlReader.Read()
   at Microsoft.Activities.Presentation.Xaml.ActivityTemplateFactoryBuilderReader.Read()
   at Microsoft.Activities.Presentation.Xaml.ViewStateXamlHelper.StripViewStateElement(XamlReader inputReader, Dictionary`2& viewStateInfo, Dictionary`2& viewStateSourceLocationMap)
   at Microsoft.Activities.Presentation.Xaml.ViewStateXamlHelper.ConvertViewStateToAttachedProperties(XamlReader inputReader, ViewStateIdManager idManager, Dictionary`2& viewStateSourceLocationMap)
   at Microsoft.Activities.Presentation.Xaml.WorkflowDesignerXamlHelper.DeserializeString(String text, DeserializationMode mode, IList`1& loadErrors, Dictionary`2& sourceLocations)
   at Microsoft.Activities.Presentation.Xaml.WorkflowDesignerXamlHelper.DeserializeString(String text, IList`1& loadErrors, Dictionary`2& sourceLocations)
   at Microsoft.Activities.Presentation.Xaml.WorkflowDesignerXamlHelper.SerializeToString(Object obj, String fileName)
   at System.Activities.Presentation.WorkflowDesigner.WriteModelToText(String fileName)

And this error when setting some string:

System.Xaml.XamlParseException: 'this:Bug_-_Workflow.String_Argument_In' is not a valid XAML member name.
   at MS.Internal.Xaml.Parser.XamlScanner.PreprocessAttributes()
   at MS.Internal.Xaml.Parser.XamlScanner.ReadObjectElement(XamlName name, Boolean isEmptyTag)
   at MS.Internal.Xaml.Parser.XamlScanner.DoXmlRead()
   at MS.Internal.Xaml.Parser.XamlPullParser.<Parse>d__4.MoveNext()
   at MS.Internal.Xaml.NodeStreamSorter.StartNewNodeStreamWithSettingsPreamble()
   at MS.Internal.Xaml.NodeStreamSorter..ctor(XamlParserContext context, XamlPullParser parser, XamlXmlReaderSettings settings, Dictionary`2 xmlnsDictionary)
   at System.Xaml.XamlXmlReader.Initialize(XmlReader givenXmlReader, XamlSchemaContext schemaContext, XamlXmlReaderSettings settings)
   at System.Activities.Debugger.XamlDebuggerXmlReader..ctor(TextReader underlyingTextReader, XamlSchemaContext schemaContext, Assembly localAssembly)
   at Microsoft.Activities.Presentation.Xaml.WorkflowDesignerXamlHelper.DeserializeString(String text, DeserializationMode mode, IList`1& loadErrors, Dictionary`2& sourceLocations)
   at Microsoft.Activities.Presentation.Xaml.WorkflowDesignerXamlHelper.DeserializeString(String text, IList`1& loadErrors, Dictionary`2& sourceLocations)
   at Microsoft.Activities.Presentation.Xaml.WorkflowDesignerXamlHelper.SerializeToString(Object obj, String fileName)
   at System.Activities.Presentation.WorkflowDesigner.WriteModelToText(String fileName)

Back in the day’s workflows was saved as yaml files on disk in openrpa. Since multiple workflows in different projets could have the same name i could not use filename as the workflow name ( yes, i could have used folders for each project. Sue me ! :smiley: ) i did what i saw ther rpa vendors do, i set the class name inside the yaml to correspond to the workflow name. This had the advantage that you could also easily set the workflow name by simpl clicking the backgground of the designer.

Now we use LiteDB in openrpa, we export in Json and you can use openflow, so using unique class names in the yaml is no longer needed.
I will try and get that removed the next time I’m working on OpenRPA ( and i know you are a developer too, so you are also more than welcome to create a PR to remove it )
You/we/I just need to double and triple check there is no more references to the name in yaml except inside wfdesigner class

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.