Hi all,
Example.zip (190.4 KB)
Can someone please help me understand why I am getting this NullReferenceException when invoking this coded workflow (that is in a published library) from a coded workflow in a process?
I believe it is because the CodedWorkflow services (including the logging service) are not being initialised but I can’t work out how to initialise them.
using UiPath.CodedWorkflows;
namespace MyLibrary
{
public class MyCodedWorkflow : CodedWorkflow
{
[Workflow]
public void Execute()
{
Log("Running MyCodedWorkflow!");
}
}
}
using UiPath.CodedWorkflows;
namespace MyProcess
{
public class MyCodedWorkflowInProcess : CodedWorkflow
{
[Workflow]
public void Execute()
{
var workflow = new MyLibrary.MyCodedWorkflow();
workflow.Execute();
}
}
}
Am I executing the workflow correctly? This UiPath Documentation (Invoking coded automations using libraries) says a coded workflow should be invoked like this but the coded workflow is a class, not a method.
myFavoriteLibrary.<WorkflowFromThatLibrary>()
The only way I can make it work is:
var workflow = new MyLibrary.MyCodedWorkflow();
workflow. Execute();
I appreciate the help.
Thanks,
Tim