Aller au contenu principal

Can WF5 be run from right-click (map coords as input) ?

Commentaires

13 commentaires

  • Permanently deleted user

    Same as 4.x workflow config...

    Site-Manager -> Viewer -> 'Context Menus' -> 'Map Context Menu'

     

    Command is: RunWorkflowByUrl

     

    Command parameter can be just the Url to wherever you're hosting the JSON, or if you need to pass in arguments you put a json string in the command parameter argument. Requiring 'url', and 'inputs'

     

    {

     "url": "http://server_name/virtual_directory/workflow.json",

     "inputs": {

      "workflow_param": "value your workflow needs..."

     }

    }

     

    In the workflow you can request 'workflow_param' by name with the get workflow inputs activity...

     

     

    0
  • Permanently deleted user

    Thanks for that Ryan.

    That works like a charm for a text input.

     

    I can't seem to return anything from {{context}} though, which I used to use in workflow 4 to get the coordinates of the right click. (point was as argument of type Geometry)

     

    Config for workflow 4

     

    Command: RunWorkflowWithArguments

     

    {

     "workflowId": "ImageryDetailsRightClick",

     "point": "{{context}}"

    }

     

    I tried the following in workflow 5 but I don't think it's returning anything.

    {

     "url": "http://server_name/virtual_directory/workflow.json",

     "inputs": {

       "input_param": "{{context}}"

     }

    }

     

    Maybe this isn't available in workflow 5 yet ?

     

    Regards

     

     

    0
  • Permanently deleted user

    Anyone know the magic of the passing 'context' through to Workflow5?

     

    I thought maybe you should just drop the ", but that didn't seem to work for me.

     

    (work-around idea),

    You call a 4.x workflow as before, and parse the context into the same JSON structure we've been talking about and call a 'RunExternalCommand' from 4.x to launch 5.

     

     

     

    0
  • Permanently deleted user

    Well i tried this example, but hit a similar road block...

     

    In 4.x i'm having trouble sending the command parameter JSON... If i pass just a url, its fine, but try the JSON as string and it tries to load a url as the entire JSON text...

     

    Not sure how to set the CommandParameter in 4.x correctly which could be very similar to why "{{context}}" doesn't work in viewer json.

     

    Might need Latitude to enlighten us ...

    0
  • Permanently deleted user

    Hi Ryan,

     

    This actually is possible, but I haven't had any luck using Essentials Manager to create the correct command parameter for this specific menu. It tries to escape all the quotation marks when it writes the command parameter into the configuration file, and the result doesn't work.

     

    So here is the way I have found that does work:

    1. Locate your viewer's configuration file (eg: C:\Program Files (x86)\Latitude Geographics\Geocortex Essentials\Default\REST Elements\Sites\SITENAME\Viewers\VIEWERNAME\VirtualDirectory\Resources\Config\Default\Desktop.json.js)
    2. Make a backup copy and then edit the original in a text editor like Notepad
    3. Search for "id": "MapContextMenu" to find the area with your the entries for that context menu.
    4. Edit the entry that you were working with already in Essentials Manager, or create a new entry at the end of the "items":[] list. Match the format that I pasted below.
    5. Save and test the menu in the viewer. For the initial test, I recommend using a workflow that just uses Get Workflow Inputs, and Log to log the result. If you keep the test simple, you'll know for sure if the menu link is working correctly.

     

            {

             "text": "GetPoint",

             "command": "RunWorkflowByUrl",

             "commandParameter": {

     "url": "http://myworkflowurl",

     "inputs": "{{context}}"

    }

            }

    0
  • Permanently deleted user

    Confirmed, this works...

     

    One note, we were trying to name the parameter,

     "input_param": "{{context}}"

    which doesn't work, even through the back-end.

     

    Use as Amanda supplies: "inputs": "{{context}}",

    which means you only get to pass the one parameter i think...

     

    0
  • Permanently deleted user

    Thanks Ryan and Amanda

    That's just what I wanted.

    Regards?

    0
  • Erik Kuipers

    Only problem with this is that when you change the context menu again, the correct formatting is replaced by the wrong syntax. Will this issue be resolved in the near future within Manager?

    0
  • Permanently deleted user

    Bump... I just tried to use this same logic in a Toolbar 'tool'... and no luck.

     

    What am i missing?

    F12 shows the command being sent is the drawn geometry. Or Is it just that Tools overwrite the command parameters?

     

     

    0
  • Permanently deleted user

    Thought I'd bring up that it's been a while since the initial post here and we have this properly documented now. I'd refer to that instead of my older post-

    https://docs.geocortex.com/workflow/latest/help/Default.htm#wf5/help/run-workflows-in-gvh.htm#Run_Workflows_in_the_Geocortex_Viewer_for_HTML5%3FTocPath%3DRun%2520Workflows%7CRun%2520Workflows%2520in%2520the%2520Geocortex%2520Viewer%2520for%2520HTML5%7C_____0

     

    @Ryan Day?, what is it that you're hoping to pass into the workflow from the toolbar tool?

    0
  • Permanently deleted user

    Agreed that is way nicer documentation than this post...

     

    It doesn't look like it you can call a WF5 via a toolbar tool... correct?

     

    I want to pass the user drawn geometry of the Tool to a specific workflow...

     

     

    0
  • Permanently deleted user

    I'm wondering the same, why there's no option to set Command Parameter in Toolbar Tool like you can in Toolbar Button. @Amanda Frech? or the support team could you please advise whether it is possible at all to call WF5 from Toolbar Tool

    comand params missing

    0
  • Permanently deleted user

    @Jack Zhang? I believe that when using a "Toolbar Tool", the command parameter automatically becomes the shape that the end-user draws after clicking the tool (which is affected by the "Draw Mode" property). That's why it doesn't provide an option for a command parameter on the tool configuration.

    0

Vous devez vous connecter pour laisser un commentaire.