Hoppa till huvudinnehållet

creating custom client activities with VS

Kommentarer

4 kommentarer

  • Permanently deleted user
    using System.Linq;

     

    using System.Text;

     

    using System.Activities;

     

    using System.Data;

     

    namespace AddTwoNumbers

     

    {

     

        public sealed class CodeActivity1 : CodeActivity

     

        {

     

            // Define activity input argument

     

            public InArgument<int> Value1 { get; set; }

     

            public InArgument<int> Value2 { get; set; }

     

            // Define activity output argument

     

            public OutArgument<int> MyResult { get; set; }

     

            // If your activity returns a value, derive from CodeActivity<TResult>

     

            // and return the value from the Execute method.

     

     

            protected override void Execute(CodeActivityContext context)

     

            {

     

                int myValue1 = Value1.Get(context);

     

                int myValue2 = Value2.Get(context);

     

                

     

                // return the addition of the two values

     

                MyResult.Set(context, myValue1 + myValue2);

     

            }

     

            

     

        }

     

    }

     

    Is this you are looking for?

     

    Kindly let me know if you need any further help.

     

    Regards,

     

    Mohammad Ashraf
    0
  • Permanently deleted user
    Thanks Mohammad - that's a great start for me!  I'm just a newbie with custom activities - is this a client activity or server activity?  

     

    Basically, this is what GTX support recommended for my situation where I want to suspend a layer service from drawing until a series of changes to the layer are made. Right now when my workflow runs it redraws the map layer after each change making it very slow.

     

     

    "In the Esri JavaScript API there is a way to suspend drawing of individual services while you fiddle with their layers, but there isn’t currently a way to trigger this from a workflow. You would need to create custom client activities to call the suspend() and resume() functions."

     

    Wish me luck!
    0
  • Permanently deleted user
    Hi James,

     

    This is server side activity.

     

    Regards,

     

    Mohammad Ashraf
    0
  • Permanently deleted user

    Hi James,

     

    I was just curious that if you are still want to write a client side activity. The steps to develop a custom client side activity goes as follows:

     

    1. Create a custom activity class as you have done above without execute method.

     

    2. Register the activity handler in a custom module written in Javascript (if you are using HTML5 viewer). This handler should be based on activity type.

    I would suggest if you are not using this activity many times in a single workflow, then better use DynamicExternal activity and then register activity handler by ID. This is do the job.

    Please let me know if you need any sample or any clarifications.

     

    Regards,

     

    Mohammad Ashraf
    0

Du måste logga in om du vill lämna en kommentar.