Zum Hauptinhalt gehen

runworkflow with arguments on click

Kommentare

7 Kommentare

  • Kevin Penner

    Hi Jeff,

    I think you'll need to wrap the workflow call in a command.

    -Kevin

    0
  • Permanently deleted user

    ok when i do that, i get a json format error - did you mean like this: inserting the command and command parameter syntax?  i guess that is what i am asking, whats the syntax to run a workflow with arguments when you click on the feature to get a map tip.  i want it to also, at the same, time run a workflow that draws the photo footprint.

      "onFeatureClick": [

                            "ShowMapTip",

     

                            "HighlightFeatureDefault",             

                           {"command":"runworkflowwitharguments",

                          "commandParameter": "lmf_1_acre"}

    ]

     

    i get  json error with this syntax, the site does not load.

    J

    0
  • Kevin Penner

    Hi Jeff,

    The best way to do this is write a command which takes in the map click arguments. You can see how to write commands in Typescript by looking in the SDK samples. The JSON would then look like this:

                        "onClick": [

     

                            "InvokeMapTip",

     

                            "ClearMarkupQuiet",

     

                            "HighlightFeatureDefault",

     

                            "RunMyOnClickWorkflow"

                         ],

    You'd have a command declared in a module ie:

    this.app.commands("RunMyOnClickWorkflow").register(this, (args) => {

        var workflowArgs = {};

        workflowArgs["workflowId"] = "MyClickWorkflowId"; //This is the ID of the workflow.

        workflowArgs["clickedPoint"] = args.mapPoint; //This 'clickedPoint' lines up to the workflow argument and passes in the clicked point.

        this.app.commands("RunWorkflowWithArguments").execute(workflowArgs);

    });

    0
  • Kevin Penner

    I do notice that there is no type on the following config:

    "libraryId":  "RunMyOnClickWorkflow",         "moduleName": "RunMyOnClickWorkflow",         "moduleType": "",   What are the contents of the JS libraries you have created?
    0
  • Permanently deleted user
    I am such a newbie, I was just trying to use the code example given in this thread. I was wondering if Lg could provide a sample of running workflow on click in the downloads area of this support site. With simple instructions like the right click sample. J
    0
  • Permanently deleted user

    i do not know how to register this module  as you suggested. can you assist me further?

    this.app.commands("RunMyOnClickWorkflow").register(this, (args) => {

        var workflowArgs = {};

        workflowArgs["workflowId"] = "MyClickWorkflowId"; //This is the ID of the workflow.

        workflowArgs["clickedPoint"] = args.mapPoint; //This 'clickedPoint' lines up to the workflow argument and passes in the clicked point.

        this.app.commands("RunWorkflowWithArguments").execute(workflowArgs);

    });

     

    Jeff

    0
  • Kevin Penner

    Hi Jeff,

    I suggest to have a look at the SDK samples which ship with a viewer. The samples can be hosted by putting them in a virtual directory in IIS. They describe in detail how to implement modules and other Geocortex Framework elements. I can answer any questions you have about them!

    Cheers,

    Kevin

    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.