runworkflow with arguments on click
I would like to run a workflow with arguments when you click on the feature and invoke map tip. i have a workflow that calculates the extent of an aerial photograph. i would like this "box" drawn instead of highlighting the feature or adding a markup symbol when you click on the feature and invoke map tip. i believe this can be specified in the desktop.json file, but i don't know the syntax. here is the json code from the desktop.json file:
"onClick": [
"InvokeMapTip",
"ClearMarkupQuiet",
"HighlightFeatureDefault"
],
"onLongClick": [],
"onFeatureClick": [
"ShowMapTip",
"HighlightFeatureDefault"
],
if i insert this syntax after "hightlightFeatureDetails" :
{"command":"runworkflowwitharguments",
"commandParameter": "lmf_1_acre"}
I get a json error,
so i need to know the syntax for inserting a runworkflowwitharguments so that i can run a workflow when a user clicks on a feature to get a maptip.
J
-
Hi Jeff,
I think you'll need to wrap the workflow call in a command.
-Kevin
0 -
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 -
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 -
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 -
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 -
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 -
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.
Kommentare
7 Kommentare