Add workflow to context menu
Hi,
I have built a workflow that basically does
- CaptureGeometry (point)
- DisplayForm (get text input from user)
- Store point+text in a database, using OleDB
This works fine, but I have now been asked to add this workflow to the map's context menu. A user should then right click on the map to start the workflow, skip step 1, and continue immediately with step 2.
Is it possible in a workflow to get the location where the context menu popped up?
Berend
-
Hi to all
I also need to get an answer to this. The user already knows where they want to run the workflow for, how do we pass the right-click location to the workflow?
No doubt it will be obvious ;-)
Thanks
Ralph
0 -
Hi guys,
At this time it is not possible to pass the user's click location to the workflow from a context menu command. The viewer will attach the click location to commands that accept a Geometry input, which workflow doesn't accept.
The closest you can currently do is batch together a PanToPoint command and RunWorkflow command, and then fetch the map center from the workflow after it starts (that's how the Street View Here action works).
Regards,
-Malcolm
0 -
Hi Malcolm
that will work for me for now. I did think along those lines but hadn't quite figured out how the Batch Commands fitted into the picture. Another piece of the puzzle resolved /customer/servlet/servlet.FileDownload?file=00P6000000e87wBEAQ
Thanks
Ralph
0 -
Hi Ralph,
If you have your own custom module, you could set up an event listener for the map's MouseRightButtonDown event. This is called just before the context menu pops up, and will give you the pixel coordinates of the clicked point. Then call Site.Map.ScreenToMap(e.GetPosition(Site.Map)); Store the result in a class variable and you're set.
Berend
0 -
Hi Berend, I know this post is quite old but I was wondering if you could share this workflow? I would also like the user to click on a point, fill out a form, and save that information into SQL. It sounds like your workflow might be a good starting point for me. Thank you! 0 -
These posts were back in 2012, has there been an update to this? Is the PanToPoint command then centroid screen capture the only way to accomplish this still? 0 -
Hi Eric,
Yes, the Pan to Point solution that Malcolm mentions is still the only way to do this. If you're looking for a way to pass the right click location into a workflow, I would encourage you to post that to the ideas section here:
https://support.geocortex.com/GSCIdeas?c=09a6000000008RsAAI&filter=1&categ=all&sub-nav=ideas&main-nav=essentials&page=1
so users can vote on it. If it gains enough traction, it will be included in a future release of GVH.
I hope this helps!
Thanks,
Danny0 -
Can you batch workflows together without modifying the .XML or is that the only way to properly accomplish batching? 0 -
Also, if I make customization to the actual JS files and then complete any changes in Geocortex Essentials Manager, will I be overwritting the customization I added? 0 -
I figured out which JS file to modify (Desktop.jason.js), however, any time I submit changes using the manager, regardless of where those changes are committed, the customization (batching) is overwritten. There has got to be a better way to accomplish the task above WITHOUT having to re-create the customization each time I need to make a small change to the site. 0 -
I think there is also an issue when doing the batching. It seems that I am capturing the centroid of the previous map extent, even though the PanToPoint is getting executed before the actual workflow.
Do we know for sure that a task that is batched and executed first, can affect a workflow within the same batch?0 -
I'm a bit late to the party, but I figured out a way to pass the location of your right click into a workflow using the context menu. In your context menu for html5 2.6, set it up the following way:
_img_ alt="User-added image" src="https://latitudegeo--c.na53.content.force.com/servlet/rtaImage?eid=90760000000TUO3&feoid=Body&refid=0EM60000000Lzw7" _/_img_
change 'zoomToPoint' to whatever your workflowID is
Then my workflow accepts a MapPoint argument ({{context}}), I zoom to a predefined scale (1128). Then I run the external command 'PanToPoint' using inArgs of type MapPoint as the point:
_img_ alt="User-added image" src="https://latitudegeo--c.na53.content.force.com/servlet/rtaImage?eid=90760000000TUO3&feoid=Body&refid=0EM60000000LzwC" _/_img_
You can test it out here if you'd like https://gis.miottawa.org/ottawa/geocortex/propertyMapping. Just right click and 'zoom to neighborhood level'
Then once in the workflow you can do whatever you'd like with that geometry.
Marshall0 -
Thnak you Marshall its work perfectly :) 0 -
Marshall,
Thank you! This worked beautifully! I have used it in several desktop sites and it is perfect. I just tried using it on an iPad and it's not working though. Do I need to change something to make this work on a tablet (specifically an iPad)?
Thanks again!0 -
Thanks for the heads up! It wasn't working for me either, so I checked the tablet.json.js file and realized the code was missing. So I just copied it from the Desktop.json.js to the Tablet.json.js and now it works. I'll have to look at handheld as well... 0
Please sign in to leave a comment.
Comments
15 comments