How to fix he activity delegate with Handler referenced activity error?

Dear everyone

I am getting this error when trying to run/ test my process in UiPath Studio

Error ERROR Validation Error The activity delegate with Handler ‘Udtræk tilknyttede devices på medarbejder, opdater mail og send mail til medarbejder. Opdater Excel rapport’ cannot be referenced by activity ‘For Each’ because the latter is not in the implementation of activity ‘DynamicActivity’. An activity delegate can only be referenced by the implementation of an activity which specifies that activity delegate as a child or import. The activity delegate with Handler ‘Udtræk tilknyttede devices på medarbejder, opdater mail og send mail til medarbejder. Opdater Excel rapport’ is declared by activity ‘For Each’. Loop - Copy (1).xaml

I have an Invoke Workflow File inside my for-each loop where the error is coming from. Any idea what might cause this error?

Thanks in advance

Hi @nmjvk

UiPath may occur when you try to invoke a workflow that contains activities that require a scope (such as browser or application scope) without providing the scope. This may cause the invoked workflow to fail and throw an exception.

To fix this error, you have a few options:

• You can add the scoped activity inside the invoked workflow instead of outside it. This way, the scope will be available for all the activities inside the invoked workflow

Check out the thread

• You can use arguments to pass the scope from the main workflow to the invoked workflow.

EX : If you have a browser scope in your main workflow, you can create an argument of type UiPath.Core.Browser and assign it to BrowserScope.BrowserElement property. Then, you can pass this argument to your invoked workflow and use it for your activities that require a browser scope.

Regards
Gokul

Dear @Gokul001

Thank you so much for your swift response. I am not sure I quite follow you excatly.

In my process, I have multiple Invoke Workflow File, they are all passing successfully except one Invoke Workflow File activity. I can see, it might be some of the Import Arguments that might fail?

image

Could you perhaps tell me if this is a right assumption or not? Thank you.

Hi @nmjvk

Do you have this Workflow in the given Path? It seem like the path of the XAML file is missing Can you check oit out

image

Regards
Gokul

Dear @Gokul001

Yes, I do.

This process is just writing to a database to check some statistics for some coworkers.

Regards
Jumanji

Okay @nmjvk , Then Why do have that Red line in the Invoke Workflow activity? You can check the path of the Invoke workflow activity

@nmjvk

if you are on latest UiPath version…currently invoke workflow activity supports only relative paths which can be obtained by clicking the folder icon and selecting the xaml…If youa re trying to invoke any xaml outside the project folder it might not be possible as well

And as per the screenshot we can see that the path provided in the invoke workflow is either wrong or is not inside the same project

If you want to invoke some other xaml in another project then instead you have to use invoke process

Hope this helps

cheers

Dear sir @Gokul001 and sir @Anil_G

Doing a relative path fixed the issue with the Invoke Workflow File having a wrong path, I don’t recall this being a problem with later versions of UiPath.

However, I still receive the exact same error, and now the process wont show me where the error is, only that it is inside the For Each loop activity. Any guidance on what to do from here?

Regards
Jumanji

@nmjvk

Yes previously invoke workflow used to support it…but not now…

And coming to error…can you provide more info like what you are trying to do inside for loop and what is the Input argument type you are using and what is the type argument

If possible it would be great if you can share the project which has error so that we can open from our end as well

cheers

Dear @Anil_G

Sure, I will do that. Give me 5 min since I will have to rewrite the whole process in English so you can understand it. Thanks in advance

Regards
Jumanji

Dear sir @Anil_G and sir @Gokul001

Here is my workflow for the process at which I am experiencing errors.

Loop - Copy (English version).xaml (51.2 KB)

Please do let me know if there are any issues opening or reading my process.

cheers
Jumanji

@nmjvk

It looks like some issue with the for loop you have… I just created a new for loop and then moved whole sequence from one for loop to another then new one and then the error disappeared

can you please try the same

cheers

Dear @Anil_G

Is there a possibility that you can share your code with me?

cheers
Jumanji

@nmjvk

Here it is

Loop - Copy (English version).xaml (82.7 KB)

cheers

Dear @Anil_G

I can’t open your workflow, it says the Document is invalid

Cheers
Jumanji

@nmjvk

Please check this

PepProcess - Copy (8).zip (17.4 KB)

cheers

1 Like

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