It is possible to create an activity “Multi Get Asset Activiy”?
it would basically have the same functionallity of Multiple Assign activity, in some cases the developer is requesting several assets.
It is possible to create an activity “Multi Get Asset Activiy”?
Just an opinion:
- I think it would clutter the properties tab if there were a Multi-Get Asset activity. It might make it more difficult to identify which output is linked to which call in a Multi-Get Asset activity.
- Since UiPath also considers Credential type as an Asset, it might mean that some of the return values have two outputs with secure strings mixed in between all the return values and this will require to be handled in how the UI is presented, where the developer need to choose the type of asset for each call (row).
I am not sure if there is a strong enough reason to change what currently works really well.
That’s a really good idea, I think. We could have the same layout as with a multiple assign, where on the left you’d have asset names and on the right you’d have variable placeholders where to store the retrieved assets.
I’d only do this for assets, though, not credentials.
The reason to change something that “works really well” is that it doesn’t work that well, imo.
If a project requires 25 assets (which is not that many), and you retrieve all assets in a boilerplate InitializeSettings workflow, then it takes quite while to fetch them all, one by one. In fact, it’s typical for me to spend 3-4 times as long, in fetching assets, than it is for the automation to run. When an automation is scheduled for every 5 minutes, this is a large delay that needn’t be there.
A way around this might be to “roll your own” multi asset fetch.
- Create a JS file containing each (non-credentialed) asset required
- Deserialize the json, into an array of JObjects
- Iterate over the array and populate a dictionary (maybe the Config dictionary? if working with the REF template) to pass around the automation
One fetch to get many assets would be grand. It would allow the consolidation of asset retrieval on initialization, with one call to orchestrator. This is a boon to developers because high frequency integration automations (say, every 5 minutes) have initializations where asset retrieval can take a full minute to complete (at least in cloud orcehstrator), while the automation itself takes only seconds.
This would mean that Get Credentials (which in UiPath terms is also an asset) will not fit in the requested multi-assign activity as it would need to return two values (username and password). The proposed json file parsing will also not satisfy this requirement as password in json string is a no no.
In my opinion, dividing / extending Get Asset to Get Multi Asset will only confuse current and future developers. Off course if credentials are not categorized as assets, I completely agree with you that a Json file is a better file to parse than an excel config file to build up asset dictionary.
I am not sure why it would take so long to initialize (get asset from Orchestrator), in my experience the Get Asset activity and building up the config dictionary setting does not take that long (about 12 assets takes less than 3 to 4 seconds on runtime in an on-premises orchestrator). I am curious to know more about your experience though. Could there be somekind of a network delay or database read delay which results in a higher initialization time in your case? If this is the case when we use the cloud orchestrator, I learnt something new today
Getting credentials is already it’s own activity, so I’m not sure what else there is to cordon off from a multi-asset fetch.
This activity also mirrors the current “Get Multiple Assign,” so I’m not sure where the confusion might lie?
Fetching for us was fairly fast for on-prem, but fetching from the cloud takes much longer than the figures you’ve quoted; probably upwards of 7-8 times longer. The time is roughly the same, regardless of rather it’s my machine in the development tenant, here on my home network, or the production server making the call, which has direct T1 access and resides in our corporate office.
This is the multi fetch using a json asset idea that I mentioned, above. Hope someone finds it useful. You must install uipath.WebAPI.activities for InitAllSettings.xaml to function properly. You can find it easily by searching for json under ManagePackages.
InitAllSettings.xaml (21.2 KB)
settings.json (220 Bytes)
Hi again @bradford.rust,
We use the same approach as well.
It has worked well for us for the past 6 months and has survived the test of time.
In our case, since we have a on premises Orchestrator we don’t worry about the number of calls to get the asset /s does (not hurt performance) but this method essentially would do the same function requested above. It’s lightweight and fast.
Just an addition: We also extend this method to config file contents which helps us update the config file in a json string format in Orchestrator. This has ensured that we do not need to edit the excel file in the release nuget package.
We use a text asset and in the performer deserialize the content to get the Jobject key-value pairs and based on Dev or Prod env choose the correct values.
Bumping this to reiterate the need for this request.
Get Multiple Assets should take in a collection (all values from the Assets sheet in the config file, for example), make one single call to Orchestrator, and then return all of the results as a datatable or JSON.
It is then much faster to iterate through that output collection locally, a handful of milliseconds, then iterating multiple server calls, each of which in my testing take 600-900ms. If a project has more than a couple assets (which is common), this can easily add 10-20 seconds of overhead before processing transactions even begins.
Here’s a screenshot from my current project, showing how slowly Get Asset can run. Note that one asset took 1.25 whole entire seconds to arrive.
What I’ve been doing lately is calling on the orchestration API to get all assets from a folder, using “/odata/Assets/UiPath.Server.Configuration.OData.GetFiltered”. It’s a GET request, that specifies a folder path, and returns a json array.
You can iterate over the array to ask the question “is this a credential?” and place it into the proper container (assets or credentials).
InitAllSettingsAPI.xaml (28.6 KB)