Coded Workflow, error when calling a workflow in a library from an external project

Hi!

I have the same problem that this user comments in the following post.

When I run the tests from the library, the entire process is correct, but when I run it from an external project I receive the same error.

In my case I am not ignoring any files in the publication.

Attached is a screenshot of the project in which the “Ebroker” library is installed. When “Click-Interactions” is executed, a ‘RunWorkflow(“Reusable\Click.cs”);’ is used inside

As I mentioned, if I run the test from the library, everything is correct. But from the external project I get the error.

Thank you!

@fjartacho

Can you please show your library from projects instead of activities panel

Cheers

hi @Anil_G!

I attached the screenshot.

The code I show is the part where the error is generated when I run it from an external project

Thank you!

@fjartacho

Looks like when running from process it is pointing to process folders

Please try this use a Path.GetFullPath("Reusable") and Path.GetFullPath("click.cs")

Check the anove outputs by givign these in library code log messages

Cheers

@Anil_G

When I run the process from the library it returns the path of “Reusable” and “Click.cs” (although the latter is not correct). Even so, the entire process is carried out correctly as you can see in the log.

If I run the activity from the external process, it directly returns the previous error.

Thanks!

@Anil_G

I have moved to the beginning of the activity “Click-Interactions.cs”:

Log("Path Reusable: " + System.IO.Path.GetFullPath(“Reusable”));
Log("Path Click.cs: " + System.IO.Path.GetFullPath(“Click.cs”));

And now when I run from the process it prints the absolute path. As you told me, it recognizes the absolute path of the process that is running at that moment. If I run it from the library, it identifies the library path, but if it is run from the external process, it identifies the external process path.

How can this be solved?

@fjartacho

As per error and screenshots when run from library…looks like it is trying to find the click.cs in project folder instead of library folder

let me look if I find any workaround for it…ideally it should take the library path only

cheers

It’s strange because even if I create a “Reusable” folder in the external process and add a Click.cs file inside, it still gives me the error.

Although the file exists within the folder structure of the external process, it cannot find it.

Thanks for the help! I hope you find the solution :smiley:

The second scenario works for me if in addition to creating “Reusable\Click.cs” in the project folder, I also create “Framework\Main\UpperButtonsPanel\Click-Interacciones.cs”. When you run “Click-Interacciones.cs” from the project, it now runs the entire operation.

Thanks @Anil_G for helping me find the solution! I hope so.

1 Like

@fjartacho

Found a workaound to execute from library directly please try the saem…I tried and it is working as expected

So instead of using RunWorkflow…I am Explicitly initializing the CodedWorkflow I Need and then calling execute…this way it is workign from the project as well…

Hope this helps

cheers

@Anil_G

I do not know what I’m doing wrong.

I run the process from the library:
Workflow1 calls Workflow2 (the way you explained to me) and I get the following error.

Workflow2.cs contains the following code.

Even though you publish the library and then run it from the external process, it gives the same error.

Excuse my clumsiness, there must be something I’m not doing correctly.

@fjartacho

can you run only workflow2 separately…looks like it has some issues in workflow2 only

cheers

@Anil_G

Execute it correctly

@fjartacho

I just tried it looks like log is creating an issue

instead of log use Console.WriteLine

cheers

@Anil_G

It has worked!

So if I call the workflow this way, I can’t use log records inside?

Thanks!

@fjartacho

Ideally in the called workflow if logs are present it is throwing an issue

so we cannot use…I believe the initial issue is fixed now…so use console.writeline for now

Hop this solves your issue

cheers

@Anil_G

Thank you very much for all the time you have dedicated to me.

Have a very good day!

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