Zum Hauptinhalt gehen

Pass an argument with MapTipActions module

Kommentare

12 Kommentare

  • John Nerge

     

    I haven't run a workflow as a map tip action, but I run reports in the feature description and long description using RunWorkflowWithArguments.

     

    <a href="command:RunWorkflowWithArguments?workflowId=WorkflowName&id={YourField}">Link text</a>
    0
  • Ryan Kelley
    I have a similar question, that I am hoping you can help me with John...

     

    I have a workflow, with arguments, I'd like to execute from a map tip's hyperlink. The argument of interest is the Map Service ID. Eventually I want to be able to pass in the Layer Id and ObjectId as well. The syntax in my Feature Description is:

     

    <div><a href="command:RunWorkflowWithArguments?workflowId=1&msId={MapServiceId}" style="font-size: 13.3333px;">Put in WETS</a></div>

     

    My argument in my workflow to be executed is an object, named msId. The worklfow DOES execute from the map tip, but my msId argument is null. It is supposed to be 7.

     

    Is there anything any one knows about this? Am I missing something like a Property in the workflow?

     

    Thanks!

     

     
    0
  • John Nerge
    I tried running a workflow to pull in the map service ID and present it in an alert, and the alert was blank. When I changed the input argument from the MapServiceId to OBJECTID, the alert was populated.

     

    Base on those results, my guess is that RunWorkflowWithArguments works with Field Tokens but not Map Service Tokens.
    0
  • Ryan Kelley
    Hi John,

     

    I opened up a ticket about this. Apparently passing the Field Tokens is a bug in HTML 2.5.1, and is scheduled for a fix in 2.6.

     

    Also, I did have to change the Look and Feel tab's default of for Map Tips... from Feature Long Description to Feature Description. That is the part that really got me.

     

    Anyway, my issue is solved, but I am having to hard code the MS ID & Lyr ID into my 'a href' url for my RunWorkflowWithArguments. 
    0
  • Permanently deleted user
    Good Afternoon! I am having a similar issue! I would like to run a workflow from a maptipaction. I have configured a simple Alert workflow that uses a features recordID as an input argument and displays the recordID in the Alert. I have configured the desktop.json...

     

                    {

     

                      "text": "@language-menu-complaint",

     

                      "description": "@language-menu-run-report-desc",

     

                      "command": "RunWorkflowWithArguments",

     

                      "commandParameter": {

     

       "workflowId": "Argument",

     

       "WhereClause": "recordID='{recordID}'"

     

      },

     

                      "hideOnDisable": false

     

      },

     

    However, the alert just shows up blank...Is this functionality even possible? Thanks!

     

     
    0
  • Dan Giersz
    Try replacing the field token with an actual value and see if it shows up in the alert. Is recordID a string?
    0
  • Permanently deleted user
    Yes, recordID is a string. When I replace recordID from this...

     

                    {

     

                      "text": "@language-menu-complaint",

     

                      "description": "@language-menu-run-report-desc",

     

                      "command": "RunWorkflowWithArguments",

     

                      "commandParameter": {

     

       "workflowId": "Argument",

     

       "WhereClause": "recordID='{recordID}'"

     

      },

     

                      "hideOnDisable": false

     

      },

     

    To this...

     

                    {

     

                      "text": "@language-menu-complaint",

     

                      "description": "@language-menu-run-report-desc",

     

                      "command": "RunWorkflowWithArguments",

     

                      "commandParameter": {

     

       "workflowId": "Argument",

     

       "WhereClause": "recordID='{Hey}'"

     

      },

     

                      "hideOnDisable": false

     

      },

     

    The Alert still shows up blank.
    0
  • Dan Giersz
    I'm not sure why your Alert is still blank. Does your alert show the right value when you run it in Workflow Simulator?

     

    I am having the same issue as the original poster.  My workflow runs fine from MapTip Actions, but does not pull the field toekn value from the feature. Not sure if it's even possible to pull the feature's attributes into the workflow from the MapTip Actions.
    0
  • Permanently deleted user
    When I enter "Test" in the Default Value in the recordID argument, Test shows up in the Alert in the Simulator. But like you and the original poster, I need to pull the token into the workflow, not a static value...Hopefully we can get some input from LG?
    0
  • Dan Giersz
    It may be by design, since you don't know what feature the MapTip will return and your workflow is probably for a specific feature.  As John mentioned earlier in the post, running workflows from the body of the MapTip works great.
    0
  • Permanently deleted user
    I don't think you can pass the Feature attribute value through the Token from "MapTipActions" menu item.

     

    With only configuration on viewer configuration, I think we are on stuck to achieve what you want to do.

     

    However, you can code the custom command, and configure it on your "MapTipActions". Your command will be received the Feature object, so on the command handhler, execute the command 'RunWorkflowArguments" with the proper inArgument extracted from Feature's attribute. That is what I would like to do,and I did for other service project.

     

    Below is how you can debugging what is going on.

     

    From the context of "MapTipActions" menu, a GVH Feature object is available on the command. So {{contenxt}} is the GVH Feature Object from which you can't extract the attribute value by configuration as far as I know.

     

    You can check what is passed using the Chrome(or IE) Develoepr tool - Open up the GVH mapping.js, and put the breakpoint on the RunWorkflowWithArguments"' commands handler so that you can check what is passed See the screenshot).RunWorkflowWithArguments command on MapTipActions

     

     
    0
  • Permanently deleted user
    Everyone, I found that my tokens were not working and also found how to fix them. I'm not sure if it's the same problem everyone else it having. 

     

    THE FIX: You'll notice that if you go into the GE essentials manager and then into the layer in question there is a tab called "Fields". You can add/remove and provide an alias for the fields. The issue I found was that the hyperlink label became populated for some unknown reason and that is what was causing my problem. Both removing the hyperlink label OR removing the field definition will fix the problem.
    0

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