Activity Creator vs Nuget Package Manager

I need to add a drop down list as an “in_argument” to a custom library. However, I want to build this as a template to add any number of text values for different situations. Sometimes I might have 2 values, sometimes 3 depending on the workflow. The values may also be different but I could (potentially) enter those into the invoked workflow in_argument setup.

I have seen many posts related to this question and all point to either the Activity Creator or Nuget Package Manger.

  1. Is one more acceptable/reliable/supported than the other? Activity Creator seems easier to set up but also seems to bring a lot of overhead.
  2. While the demos are somewhat helpful in understanding, can somebody walk me through the process and code required to actually build the drop down list? I have some c# experience, but not so much with all the class and enum structures.

Hi,

At least, Nuget package manager is for just nupkg. So you cannot create or edit your code for activity in it.
Activity creator is visual studio extension to make custom activity easier. We can create custom activity without it. However it provides various function such as Wizard, template of scope activity etc. I recommend you to use it.

While the demos are somewhat helpful in understanding, can somebody walk me through the process and code required to actually build the drop down list? I have some c# experience, but not so much with all the class and enum structures.

If you want to make static dropdown, define your enum type, then write arugument definition as the following.

enum YourEnum
{
     A,
     B
}

public YourEnum YourPropertyName { get; set; }

Or

In ActivityCreator, we can make it to set None at Direction and your enum type at Type in DefineProperties of Wizard.

Regards,

Thank you for the clarification. I will use the Activity Creator - after what you say, it makes sense to me.
I have done what you said in the Wizard. Is there anything required in the code? or do I just package and publish? I would like to define the items when I use the type in the in_argument (maybe in the default field?) but if that is not possible I could create a new version for each list? Sorry for the step-by-step, I just want to learn to do this the correct way. The raw code is below - have not added anything except from the wizard.

namespace UGIES.RPAextensions.Activities
{
    [LocalizedDisplayName(nameof(Resources.EnumDropDown_DisplayName))]
    [LocalizedDescription(nameof(Resources.EnumDropDown_Description))]
    public class EnumDropDown : ContinuableAsyncCodeActivity
    {
        #region Properties

        /// <summary>
        /// If set, continue executing the remaining activities even if the current activity has failed.
        /// </summary>
        [LocalizedCategory(nameof(Resources.Common_Category))]
        [LocalizedDisplayName(nameof(Resources.ContinueOnError_DisplayName))]
        [LocalizedDescription(nameof(Resources.ContinueOnError_Description))]
        public override InArgument<bool> ContinueOnError { get; set; }

        [LocalizedDisplayName(nameof(Resources.EnumDropDown_EnumDropDown_DisplayName))]
        [LocalizedDescription(nameof(Resources.EnumDropDown_EnumDropDown_Description))]
        [LocalizedCategory(nameof(Resources.Input_Category))]
        public Enum DropDownList { get; set; }

        #endregion


        #region Constructors

        public EnumDropDown()
        {
        }

        #endregion


        #region Protected Methods

        protected override void CacheMetadata(CodeActivityMetadata metadata)
        {

            base.CacheMetadata(metadata);
        }

        protected override async Task<Action<AsyncCodeActivityContext>> ExecuteAsync(AsyncCodeActivityContext context, CancellationToken cancellationToken)
        {
            // Inputs
    
            ///////////////////////////
            // Add execution logic HERE
            ///////////////////////////

            // Outputs
            return (ctx) => {
            };
        }

        #endregion
    }
}

Hi,

Probably you need to define your enum at anywhere.
It might be better to try to use built-in enum type such as System.IO.SearchOption, first.

Please set None at Direction and System.IO.SearchOption at Type.

Then build and publish.

If it works, next try to make and use your enum.

Regards,

1 Like

I apparently am missing something. I selected as you said (SearchOption) and packaged. I imported to to my uipath workflow and selected it. But I am not sure what to put in “Enter a VB expression”??

Hi,

Which panel is the above image?

If possible, can you share your custom activity as nupkg?

Regards,

The image is a capture of selecting the “in argument” in my workflow of the library.UGIES.RPAextensions.Activities.0.1.0.1028145405.nupkg (42.7 KB)

Hi,

Your custom activity seems no problem as the following. (It has dropdown list at property panel) Isn’t this what you expect?

Regards,

Thanks so much for staying with me through this. I see now I was implementing it incorrectly. Thank you for your time.

1 Like

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