Skip to main content

Workflow Serverside activity development guide

Comments

6 comments

  • Official comment
    Ken Lyon

    Than Aung I can confirm there is an error in the instructions in the guide.

    The Action needs to be declared like this:

        public static string Action { get; } = "uuid:<uuid>::CalculateLog";

    It is correct in the first code snippet, but two subsequent ones declare it as a variable. It must be declared as a property (as shown above) to be properly detected as a valid Workflow Activity.

    I will ensure the guide is updated.

  • Ken Lyon

    The Developer Center has been updated. All examples of custom .activities for Workflow Server have been corrected.

    1
  • Than Aung

    Thanks Ken Lyon,

    It worked after converting to property from variable.

    One more comment for the server side sample, if user enter the integer value in either base or value , you will get wrong result. Somehow the object type passing to server side activity is integer type and it will not cast the value in this way of casting. (Refer to the below code block) 

    Moreover, Can you help update this as well https://developers.vertigisstudio.com/docs/workflow/sdk-server-overview/#debugging-server-workflow-activities

    I can't find GeocortexWorkflowServer.exe at all. 

    I found VertiGIS.Workflow.Server.exe from “C:\Program Files\VertiGIS\VertiGIS Studio Workflow\Web\service” and “C:\Program Files\VertiGIS\VertiGIS Studio Workflow\Deployment\service” and “C:\Program Files\VertiGIS\VertiGIS Studio Workflow\.working\Deployment\service” 

    However I can't find the process with this exe running in the process for me to attach from Visual studio debugger.

    public Task<IDictionary<string, object>> Execute(IDictionary<string, object> inputs, IActivityContext context)
    {
       double? logBase = null;
       if (inputs.ContainsKey("base") && inputs["base"] != null)
       {
           logBase = Convert.ToDouble(inputs["base"]);
       }
    
       double value = 0.0;
       if(inputs.ContainsKey("value") && inputs["value"]!=null)
       {
           value = Convert.ToDouble(inputs["value"]);
       }
       
       double logResult;
       if (logBase != null && logBase.HasValue)
       {
           logResult = Math.Log(value, logBase.Value);
       }
       else
       {
           logResult = Math.Log(value);
       }
    
       return Task.FromResult((IDictionary<string, object>)new Dictionary<string, object>()
       {
           ["result"] = logResult
       });
    }

     

    1
  • Than Aung

    Hey Ken Lyon,

    I found that I need to attach w3wp.exe for my case.

     

    Best Regards,

    Than
     

    1
  • Ken Lyon

    Than Aung I've made some updates to that website, including improving the type handling in the Calculate Logarithm example, and the instructions for how to attach to the Workflow Server process.

    Thanks for pointing these out!

    1
  • Than Aung

    Thanks Ken Lyon for the prompt response as well.

    0

Please sign in to leave a comment.