Hexagon Geospatial
MENU

M.App Enterprise

Discuss topics with other M.App Enterprise Product pioneers and experts to get the most out of it.
Showing results for 
Search instead for 
Do you mean 
Reply
Frequent Contributor
Posts: 109
Registered: ‎10-14-2015
Accepted Solution

Workflow - Delete Feature

Dear Community,

 

I'm trying to build a workflow with a GE_DELETE sc.digitize action script. It should be able to select a feature and delete it. Currently I'm having a workflow, gives no Error's but doesn't work.

 

Attached the important settings in the workflow. Can somebody help me?

 

Staff
Posts: 965
Registered: ‎10-19-2015

Re: Workflow - Delete Feature

Hi Wim,

 

the Delete action is normally used in the capturing context together with other edit actions like for instance SplitSurface to remove the additional geometries created.

In order to delete the whole record you can use IG.remove action. Here is a sample action to ask the user for confirmation using IG.confirm:

IG.confirm({message: 'Do you want to delete the current object?', 
		title: 'Confirm', okMessage: 'Yes', cancelMessage: 'No', 
		callback: function() { IG.remove();SC.Map.clearSelectedElements();
		SC.Map.reloadLayers('poi_workflow_4326') } })

If you want to highlight (select) the element beforehands on the map you can add an action with SC.Map.setSelecteElements (it can even be fired on form load event to get the element automatically selected).

 

HTH,

Stefano

Stefano Turcato
Presale Engineer
Hexagon Geospatial
Frequent Contributor
Posts: 109
Registered: ‎10-14-2015

Re: Workflow - Delete Feature

Hey Stafano,

1. It does work, but the vectors on the map are not updated after the record is deleted. If I use the RELOAD button the features are away. How can the vectors on the map be updated after a feature is deleted?

2. In you last post you write "it can even be fired on form load event to get the element automatically selected". Can you explain this? Where is the on form load defined?

Thank you,
Wim
Highlighted
Staff
Posts: 965
Registered: ‎10-19-2015

Re: Workflow - Delete Feature

Hi Wim,

 

  1. SC.Map.reloadLayers('poi_workflow_4326') should do the job. Please check the name (the unique name assigned in Studio while importing the data) is correct.
  2. Let's say you load the form with an element selected dispalying its properties. So you can write something like this in the customscript:
IG.vent.on('form:ready', function () { 

SC.Map.setActiveLayer("catalog_item").then(function(){
	return SC.Map.clearSelectedElements().then(function(){
		return SC.Map.setSelectedElements(IG.getItemById('id').getValue()).then(function(){
			return SC.Map.fitSelectedElements().then(function(){
			});
		});
	});
}).fail(function (error) {
  			alert(error);
  	 });
}

 HTH,

Stefano

Stefano Turcato
Presale Engineer
Hexagon Geospatial
Do you need immediate support?
If you encounter a critical issue and need immediate assistance please submit a Development Ticket through our Development Ticket Portal.