#FeatureBlog - 18.3 - Library (Reusable components)

What do You mean by inside an Invoke Code activity? Is it possible to invoke workflow from code activity?

My original goal was to call Library from Project X so that based on input parameter Library would then call xaml file from Project content. But it might not be possible if Project and Library are executed in different contents? I assume I can provide absolute path to Library so that actual workflow from Project content could be executed but the environment would be different so that relative paths and Package manager content would not be same -. or is that correct assumption?

3 Likes

Invoke Workflow isn’t possible from Invoke Code.

Library can itself be located in your choice of folder location and your dependencies file should be modified to point to that location for the library if you chose not to use Orchestrator.

However it is not possible to give dynamic expressions as argument when invoking a workflow file in a library.

In .Net words, UIPath library is a compiled dll and can not contain code that will need to resolve invoking workflows through reflection. If you want to load dynamic workflows based on input arguments, you will have to build a factory model where in you will have to write IF/ Switch Case.

If (arg1 == “A”) { Invoke Workflow A}
If (arg1 == “B”) { Invoke Workflow B}

5 Likes

Hello,

I am quite naïve in this technology. So could someone please help me with below doubts on this topic?

  1. Can I publish the library to the Orchestrator? If yes, then where will it be visible?
    The problem is that currently when I try to publish a library, the Orchestrator Option is deactivated, (I am using the community version) so I assume libraries cannot be published to Orchestrator.

  2. Can someone else use the library published by me? If yes, then how?
    Do we need to maintain a common location for the access?

Thanks for your time!

3 Likes

how to add icon to my library in uipath 2018.3.2

4 Likes

Hi @venkat4u

It is considered for the following releases. Stay tuned :slight_smile:

3 Likes

@loginerror

thats awesome…

may i check another one, is there any way i can add checkbox/drop down
in Library input arguments?

2 Likes

Hi @venkat4u

Could you clarify whether you mean a set of default values that would be available for particular fields in you Library activity properties?

2 Likes

i mean, in the Write Range acitivity, we have property called, AddHeaders…which is check box.

Regards,
venky

2 Likes

I got you now. I believe this is also on the list already :slight_smile:

3 Likes

wow. this is so cool. looking forward for more such stuff.

2 Likes

If you want to reusable own library. I suggest some good tips to make library good and fresh. You should clean multiple program.you should remove etc thing in a gallery. And you can create in the library.,

2 Likes

Is it possible to add descriptions to the activity properties to appear when you mouse-over the property name (like they do with built-in activities)? It would be super useful to give more detail on what the property is / does to other developers using the activity.

I tried this by adding annotations to the arguments of the workflow before publishing and importing, but the tooltip that pops up still has no description.

image

4 Likes

Hi @Foehl

I don’t know how much it will help, but we have a bunch of open sourced activity packs. They might serve you as an example :slight_smile:

2 Likes

Thanks @loginerror. I’ll take a look. If I manage to figure out how it’s done I’ll post some info on how to create the tooltips.

It would be nicer to have a user-friendly method built into the library creation process though rather than having to edit code.

3 Likes

What a hasty answer I gave, slightly irrelevant :slight_smile: Sorry for that.

More improvements to the libraries are indeed coming in future versions. Stay tuned!

Is it possible to give Check box as an argument?

Trying to create library for SMTP Email activity, and want to know if I can create an argument for “IsBodyHtml” check box in properties panel.

@ys15 I think you need to send an argument as Boolean type. Then, in your library use either an If or Pick Branch activity to execute SMTP with either IsBodyHtml option checked or unchecked (so 2 different Send SMTPs). If you are using Invoke Code to Send SMTP then you can implement that Boolean argument in the code like smtpMsg.IsBodyHtml = boolIsBodyHtml

3 Likes

@ClaytonM Thanks! That helped.

Thanks for this great update. It makes easy to reuse the code instead of using invoke workflows. When using this I noticed that the custom activities used in workflows become unusable if there are any updates to the arguments of the custom activities in the next new version. Is there anyway to manage this with less rework effort? Please suggest

Missing%20or%20invalid%20acitivity

2 Likes

Hi @saravana_689 we received this a lot too, but it’s either of two things:
1) There was a problem with your previous dependencies that you never resolved and the new version is actually fixing it by telling you what’s wrong, or 2) simply install the activity package to the project, since you upgraded and there could be a few packages that were not migrated.

Also, if they are custom packages in a feed different than the Official or Community (which I would recommend trying to avoid), then you need to include your activity feed in the NuGet.config file for each robot and development machine being used

And, it’s per project, so I think you will want to check each project in Studio. However, they will technically still work in Orchestrator unless the project has an issue with an activity version that is not in Official or Community. Then, you will need to open it in Studio and repair the dependencies.

One trick is though, that you can copy the “.local” folder and dependencies found in the “project.json” file for other projects. However, I don’t know if that’s really much faster.

3 Likes