activate add new feature html5 tool from workflow
Hi i need to activate or callup for use the "add a new feature" from a workflow in html5. is there a way to do that in a workflow? i know of the "activate tool" in the runextenalcommand activity, but how to i refer to the add a new feature tool?
i also tried activateView and TemplatePickerView as the argument, which worked but lost focus when it went to the next activity, perhaps there is a way to pause the script until a save or cancel has been entered on the tool
jeff
-
Jeff,
May I ask why (with what user story) do you want to start 'Add Feature' from workflow?
With my experience for some custom Editing Tool, you need to have little bit of custom code. Basically, there are several commands like ' StartAddingFeatureGeometry' (takes ESRI Graphic, and esri Feature Layer, which you may start from the workflow) , ' StartEditingFeature' (which takes gcx feature, so you need little bit code to covert from esri feature to gcx Feature) , ' StartEditingNewFeature' (which is similar to StartAddingFeatureGeometry).
Munhwan
0 -
ok, why i want to activate a tool is that i want to be able to update the username and time of addition when a feature is added to the feature layer. this could occur before or after the normal process. But if you had some samples of the commands you mentioned i would check those out as my solution. basically i want to add a feature edit the attributes and behind the scenes gather the username and time and include those elements in the update or create statement. i would need this to be seamless to the users.
J
0 -
Jeff,
If you have only two fields (for example, CreatedBy with the SIte Login username, and CreatedDate by the dateTime when a feature is added), of the feaure, which you want to assign programatically.
First of all, for the 'CreatedDate' field or 'ModifiedDate' field, you can set up 'Enable Editor Tracking' and set up two fields on ArcMap/Catalog.
However, the CreatedBy field can not be set since Site - Login username is not passed to it.
To assign some other field of the feature programatically like 'CreatedBy', and any field value which from any other layer's intersected feature value etc, there is some event published from the Editing module. One of them is "Internal.EditorFormPreSaveEvent" which you may subscribe, by
this.app.eventRegistry.event("Internal.EditorFormPreSaveEvent").subscribe(this, this.OnEditorFormPreSaveEvent);
and inplement 'OnEditorFormPreSaveEvent' where you can access Editing Form with the decoration:
OnEditorFormPreSaveEvent(form: Observable<any>, editDescriptor: any) {
// put your code here to update Field values
}
It is required some code experience and some knowledge of the GVH.
---
If there is not many fields to set up and use your FORM through Workflow to Add/Update Feature using "Add Feature" and "Update Feature", rather than using the GVH product Editing User Interface, you have alot of flexisbility to assign any field values of the feature by youself too, which I may consider first if I were you.
Wish this help you out to clarify.
Munwhan
0 -
yes, we will try the workflow approach.
Jeff
0
Please sign in to leave a comment.
Comments
4 comments