Hoppa till huvudinnehållet

How to get reference of ActivityContext object?

Kommentarer

5 kommentarer

  • Permanently deleted user
    Hi Ramesh,

     

    Not sure that I’m understanding your question…

     

    I suppose you have a class like below. Your custom activity should define some Input and outputs arguments.

     

    The execute method should have a parameter of type CodeActivityContext let’s say called ‘context’

     

    So with context.GetValue(this.SchemeYear) you should be able to obtain one by one values from your CodeActivityContext parameter.

     

    Similar thing to set output parameter: context.SetValue(Result, true); 

     

    See code below that summarize the full class

     

    I hope that’s what are you looking for. If not please send more details. namespace Namespace.CustomActivities { public sealed class getYear : CodeActivity { // Inputs public InArgument<int> SchemeYear { get; set; } // Outputs public OutArgument<bool> Result { get; set; } protected override void Execute(CodeActivityContext context) { if (context == null) { DardLogger.Error("Provided Context is null"); throw new ArgumentNullException("context"); } var schemeYear = context.GetValue(this.SchemeYear); context.SetValue(Result, true); } } }

     

     
    0
  • Permanently deleted user
    Hi (https://support.geocortex.com/GSCProfile?communityId=09a6000000008Qu&userId=005600000054tZA&showHeader=false) Francesca ,

     

    I am looking to get Geocortex.Workflow.Client.ActivityContext object in Execute method to work with methods like ActivityContext . GetEsriMap, ActivityContext . GetSite. Is it possible to get Map & Site objects in Custom Activity as shown below?

     

      protected override void Execute(CodeActivityContext context)

     

    {

     

          Geocortex.Workflow.Client. ActivityContext objActivityContext =           (Geocortex.Workflow.Client. ActivityContext)context;             Esri.ArcGISRuntime.Controls.Map objMap= objActivityContext. GetEsriMap();

     

          }
    0
  • Permanently deleted user
    Hi Ramesh,

     

    I didn’t have that scenario yet.

     

    I think it depends on what you need to do with Esri.ArcGISRuntime.Controls.Map. If you need to perform actions on the map then probably you need to use a client side custom activity (javascript). If you need a value from the map possibly you can pass values as input parameter. If you need a method/object in the map library you could possibly reference the dll in your project…. But unfortunately I don’t have any working examples.

     

    Let us know use and how you are resolving this.

     

     
    0
  • Permanently deleted user
    Hi Francesca,

     

    I want to show schematics view dynamically (generated by user) on map. Can you suggest a possible way of doing this?

     

     
    0
  • Permanently deleted user
    Hi Ramesh,

     

    The .NET side of workflow does not have direct access to the Map or Site objects.  These objects belong to the client (viewer) and thus we us a client activity to get any sort of interactive information about the viewer.

     

    To show some arbitrary geometries on the map we would recommend the Update Graphics Layer activity, which does not require custom code and can send geometry and a renderer to the viewer for visualization.

     

    Regards,

     

    -Malcolm
    0

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