Not able to find the custom activities


#1

I am able to install my custom package ,but not able to view that activities.
Any one suggest me the mandatory points which needs to be taken care while creating custom package

Below my custom code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Activities;
using System.Activities.Presentation.Metadata;
using System.ComponentModel;
namespace MathCustomActivity
{
public class SimpleFormula : IRegisterMetadata
{
public string output()
{
return “Success”;
}
public void Register()
{

    }

}

}


#2

Hi @Gopie,

Refer this post,
Nuget Package is not shown in Activities Tab

Regards,
Arivu


#3

Hi Arivu,
Thanks for your reply.
I have copy paste the same code shared by you and followed the steps.But still facing same issue.
Installed the package but activities are not displayed.

Regards,
Gopi


#4

Hi @Gopie,

Check with class name what you created in the custom activity.

For Example

you need to search in the activity tab like "SimpleFormula"

Regards,
Arivu :slight_smile:


#5

There is no custom activity in that code, just a normal class.
An activity is a class that inherits from Activity, CodeActivity, NativeActivity or their generic counterparts or subclasses.


#6

Hi @arivu96,

Thanks for your reply.

I have created the custom activity with your same code shared with me previously. Below the custom code. So only i have searched that activity in studio as " Addition1". But still facing same issue.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Activities;
using System.ComponentModel;

namespace Addition
{
public class Addition1 : CodeActivity
{
[Category(“Input”)]
public InArgument value1 { get; set; }

[Category("Input")]
public InArgument<int> value2 { get; set; }

[Category("Output")]
public OutArgument<int> value3 { get; set; }

protected override void Execute(CodeActivityContext context)
{
    value3.Set(context, (Convert.ToInt32(value1.Get(context)) + Convert.ToInt32(value2.Get(context))));
}

}
}

Thanks & Regards,
Gopie


#7

Hi @andrzej.kniola,

Thanks for your reply

Can you please let me know the mandatory key points which needs to be taken care to convert our code to custom activity.
Kindly share us the sample simple custom activity code to for our reference.

Regards,
Gopie


#8

Hi @Gopie,

you used correct code only.

Try to install this package and try again

May be you did something wrong in converting into package i think so.

Regards,
Arivu