How to Create an asynccodeactivity

studio
custom_activities

#1

I am trying to create an activity using asynccodeactivity as I am trying to call Microsoft Vision API from the code. dll file has no errors and its working properly. But custom activity is not visible in Uipath Manage packages.

Is there any turorial on how to create ASYNCcodeactivity calls?


#2

Hi,

That custom activity, have u pasted in package folder in which UI path studio installed


#4

I have already created custom activities, now i am trying to create asynccustomactivity as i am calling an api and the result is available after completing the request. Have you created any async custom activities.

How to call an APi in custom activity and wait for resutl
@ovi @UiPath @UiPathMaster


#5

I did. From packaging/deployment they don’t differ from normal ones.
Obviously you need to inherit from AsyncCodeActivity<T> (<T> being optional) and implement both BeginExecute and EndExecute.
But aside of that, they don’t differ much, framework takes good care of managing the async part.

What issues are you encountering? If you already deployed “standard” custom activities, treat it the same after compiling.

Do note that you won’t feel the async unless you use it in Parallel or similar scenarios.


#6

can you please share a sample code that outputs a parameter
like this and returns result

[Category(“Output”)]
public OutArgument Result { get; set; }


#7

If noone responds till the weekend I’ll try to make something that I could share publicly then (not much time during the week).

In the meantime, can you double check if FIlter Activities is unchecked and that your package is in one of the source locations?


#8

Or actually why reinvent the wheel:


#9

finally, there is some has problem with me. I used codeactivity to connect my API. it’s working fine if I debug on console. but when I found deadlock when use uipath. I still don’t know why.

My last option is using asyncodeactivity.

Thank you to create this inquriy


#10

I got this error

AsyncCodeActivity.BeginExecute must return an IAsyncResult where IAsyncResult.AsyncState is the state object provided by the runtime.

do you know why?