UiPath / CoreWF

WF runtime ported to work on .NET 6
MIT License
1.13k stars 214 forks source link

Content element not working #37

Closed dmetzgar closed 5 years ago

dmetzgar commented 5 years ago

When using a XAML like the following:

<Activity x:Class=""WFTemplate""
          xmlns=""http://schemas.microsoft.com/netfx/2009/xaml/activities""
          xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml"">
  <Sequence>
    <WriteLine>
      <Content>
        <Text>""HelloWorld""</Text>
      </Content>
    </WriteLine>
  </Sequence>
</Activity>

I get this exception:

Result Message: Portable.Xaml.XamlObjectWriterException : The value  for 'Text' property is null
Result StackTrace:  
at Portable.Xaml.XamlObjectWriterInternal.OnWriteGetObject()
   at Portable.Xaml.XamlWriterInternalBase.WriteGetObject()
   at Portable.Xaml.XamlServices.Transform(XamlReader xamlReader, XamlWriter xamlWriter, Boolean closeWriter)
   at CoreWf.XamlIntegration.FuncFactory`1.Evaluate() in C:\dev\corewf\src\CoreWf\XamlIntegration\FuncFactory.cs:line 91
   at CoreWf.DynamicActivity.OnInternalCacheMetadata(Boolean createEmptyBindings) in C:\dev\corewf\src\CoreWf\DynamicActivity.cs:line 122
   at CoreWf.Activity.InternalCacheMetadata(Boolean createEmptyBindings, IList`1& validationErrors) in C:\dev\corewf\src\CoreWf\Activity.cs:line 1074
   at CoreWf.ActivityUtilities.ProcessActivity(ChildActivity childActivity, ChildActivity& nextActivity, Stack`1& activitiesRemaining, ActivityCallStack parentChain, IList`1& validationErrors, ProcessActivityTreeOptions options, ProcessActivityCallback callback) in C:\dev\corewf\src\CoreWf\ActivityUtilities.cs:line 647
   at CoreWf.ActivityUtilities.ProcessActivityTreeCore(ChildActivity currentActivity, ActivityCallStack parentChain, ProcessActivityTreeOptions options, ProcessActivityCallback callback, IList`1& validationErrors) in C:\dev\corewf\src\CoreWf\ActivityUtilities.cs:line 910
   at CoreWf.ActivityUtilities.CacheRootMetadata(Activity activity, LocationReferenceEnvironment hostEnvironment, ProcessActivityTreeOptions options, ProcessActivityCallback callback, IList`1& validationErrors) in C:\dev\corewf\src\CoreWf\ActivityUtilities.cs:line 826
   at CoreWf.Hosting.WorkflowInstance.ValidateWorkflow(WorkflowInstanceExtensionManager extensionManager) in C:\dev\corewf\src\CoreWf\Hosting\WorkflowInstance.cs:line 376
   at CoreWf.Hosting.WorkflowInstance.RegisterExtensionManager(WorkflowInstanceExtensionManager extensionManager) in C:\dev\corewf\src\CoreWf\Hosting\WorkflowInstance.cs:line 182
   at CoreWf.WorkflowApplication.EnsureInitialized() in C:\dev\corewf\src\CoreWf\WorkflowApplication.cs:line 611
   at CoreWf.WorkflowApplication.RunInstance(WorkflowApplication instance) in C:\dev\corewf\src\CoreWf\WorkflowApplication.cs:line 1215
   at CoreWf.WorkflowApplication.Invoke(Activity activity, IDictionary`2 inputs, WorkflowInstanceExtensionManager extensions, TimeSpan timeout) in C:\dev\corewf\src\CoreWf\WorkflowApplication.cs:line 1245
   at CoreWf.WorkflowInvoker.Invoke(Activity workflow, TimeSpan timeout, WorkflowInstanceExtensionManager extensions) in C:\dev\corewf\src\CoreWf\WorkflowInvoker.cs:line 298
   at CoreWf.WorkflowInvoker.Invoke(Activity workflow, TimeSpan timeout) in C:\dev\corewf\src\CoreWf\WorkflowInvoker.cs:line 87
   at CoreWf.WorkflowInvoker.Invoke(Activity workflow) in C:\dev\corewf\src\CoreWf\WorkflowInvoker.cs:line 81
   at XamlTestCases.XamlTests.XamlWorkflowNoInputs(String xamlString) in C:\dev\corewf\src\XamlTestCases\XamlTests.cs:line 92

The Content element must not be setting the value of the Text property on WriteLine. Need to investigate why not.

ewinnington commented 5 years ago

Hopefully with System.Xaml open now, we can solve such issues.

bcisnero commented 5 years ago

Sorry again but what the help wanted label means in this context?

lbargaoanu commented 5 years ago

Ideally a PR with a fix.

bcisnero commented 5 years ago

Ok, got it. Thanks!

bcisnero commented 5 years ago

So can somebody please assign this to me? because I already started to investigate and although I haven't been able to reproduce the exception I'm going to keep trying to see if I can make it fail and also I'm going to do a little cleanup code by removing all or some of the compiler warnings and apply the VS 2019 code suggestions.

lbargaoanu commented 5 years ago

Cleanup where? :) Because we kind of don't need right now a lot of insignificant changes across a code base we don't quite understand and with probably pretty low test coverage. It's just risky. If you're confident you can open a PR with a passing test similar to the XAML above, then we can close this issue. That's a useful contribution, and you can move on to smth else.

bcisnero commented 5 years ago

Understood, I’ll try all the tests and if nothing fails then I submit the PR, is that ok?

El El jue, 13 de junio de 2019 a la(s) 22:39, Lucian Bargaoanu < notifications@github.com> escribió:

Cleanup where? :) Because we kind of don't need right now a lot of insignificant changes across a code base we don't quite understand and with probably pretty low test coverage. It's just risky. If you're confident you can open a PR with a passing test similar to the XAML above, then we can close this issue. That's a useful contribution, and you can move on to smth else.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/UiPath/corewf/issues/37?email_source=notifications&email_token=ADBF3BQV4X6XNDAKPJVVQ6DP2MHHZA5CNFSM4FWFSQ5KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXVT5WQ#issuecomment-501956314, or mute the thread https://github.com/notifications/unsubscribe-auth/ADBF3BQYFLQ2D7ZOEIIC7OLP2MHHZANCNFSM4FWFSQ5A .

lbargaoanu commented 5 years ago

Sure.

ewinnington commented 5 years ago

The XAML provided is invalid. It doesn't work on the .net Framework with System.Xaml either:

Message is:

 System.InvalidOperationException: CacheMetadata for activity 'WFTemplate' threw 'System.Xaml.XamlObjectWriterException: 
Cannot create unknown type '{http://schemas.microsoft.com/netfx/2009/xaml/activities}Content'.
   at System.Xaml.XamlObjectWriter.WriteStartObject(XamlType xamlType)
   at System.Xaml.XamlWriter.WriteNode(XamlReader reader)
   at System.Xaml.XamlServices.Transform(XamlReader xamlReader, XamlWriter xamlWriter, Boolean closeWriter)
   at System.Activities.XamlIntegration.FuncFactory`1.Evaluate()

I get the same message in when the test is used on .net core with Portable.Xaml. Message: Portable.Xaml.XamlObjectWriterException : Cannot create unknown type '{http://schemas.microsoft.com/netfx/2009/xaml/activities}Content'.

Since we have the same behavior on both .net core with Portable and .net framework with System.Xaml, I don't see this as an issue.

github-actions[bot] commented 4 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.