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: 110
Registered: ‎05-25-2016
Accepted Solution

Save action in workflow

Hi guys, I have yet another problem. This one is strange cause it should be a simple new geometry one, anyway  something is wrong. 

I have a WF with a single form where user captures some data and then digitizes a point in the map. The main id is called gid and defined as "serial NOT NULL" There is another id field I need to fill in order to be able to use the same table in mobile client and is a uuid stored as char(36).

 

In my workflow, since I’m creating a new entry there is no value for none of my id´s so I’m generating gid as ( Sql - SELECT nextval('my_seq') ). As for the gid field I’m generating it with another query ( Sql - SELECT uuid_generate_v4()::text ) this fields are generally "hidden" since the user does not need to know their values. 

 

Other fields are some combo boxes and txt fields but removing them from the form makes no difference here.

 

Now to the problem... Once I fill the form, digitize the point (SC.digitize('MyLayer', {commands: ['NEWPOINT'], startOnLoad: 'NEWPOINT'}) ) I get an error message 

 

WK_error.jpg

 

There is no log report in the server side, but the client gives me a java.lang.NullPointerException . Here is the log entry:

 

15 mar 2019 14:53:59 SEVERE: Error during save! --> [AWT-EventQueue-0] com.intergraph.web.plugin.edit.EditPlugin.save
java.lang.NullPointerException
at com.intergraph.web.plugin.edit.persistence.WorkflowPersitenceProvider.saveChanges(WorkflowPersitenceProvider.java:82)
at com.intergraph.web.plugin.edit.EditPlugin.save(EditPlugin.java:346)
at com.intergraph.web.plugin.edit.EditActions.GE_SAVE(EditActions.java:231)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at com.intergraph.tools.utils.disptach.MiniDispatcher.dispatch2Method(MiniDispatcher.java:93)
at com.intergraph.tools.utils.disptach.MiniDispatcher.dispatch(MiniDispatcher.java:79)
at com.intergraph.tools.utils.disptach.RPAction.dispatch(RPAction.java:577)
at com.intergraph.tools.utils.disptach.RPAction.actionPerformed(RPAction.java:514)
at java.desktop/javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at java.desktop/javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
at java.desktop/java.awt.Component.processMouseEvent(Unknown Source)
at java.desktop/javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.desktop/java.awt.Component.processEvent(Unknown Source)
at java.desktop/java.awt.Container.processEvent(Unknown Source)
at java.desktop/java.awt.Component.dispatchEventImpl(Unknown Source)
at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source)
at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)
at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source)
at java.desktop/java.awt.Window.dispatchEventImpl(Unknown Source)
at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.desktop/java.awt.EventQueue$5.run(Unknown Source)
at java.desktop/java.awt.EventQueue$5.run(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)

Strange enough despite the error in the thin client, the registry gets saved in the database!!. 

 

One thing I can see is that the gid value that is being saved is different than the one that showed in the form. Since the field is defined as serial, I though that I may just not use it in the form and use the uuid instead but then if I set it to required and persisted the client wont send the uuid value and if I set it to required but not persisted the server gives me a “‎Sequence contains no matching element‎” (since there is no id in the sequence)

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

Re: Save action in workflow

hi,

 

the primary key must be persisted="true" and required="false". If you are editing an existing row you must pass the {FORM.pk} to the digitize action. If you are creating a row from the scratch please make the pk defalutvaluemode="onsave" if managed on workflow side (if managed on DB side it is not needed). 

Please check if you have set the follow node property of the current node (this is required in SP2 currently...).

 

Stefano

Stefano Turcato
Presale Engineer
Hexagon Geospatial
Frequent Contributor
Posts: 110
Registered: ‎05-25-2016

Re: Save action in workflow


@sturcato wrote:

hi,

 

the primary key must be persisted="true" and required="false". If you are editing an existing row you must pass the {FORM.pk} to the digitize action. If you are creating a row from the scratch please make the pk defalutvaluemode="onsave" if managed on workflow side (if managed on DB side it is not needed). 

Please check if you have set the follow node property of the current node (this is required in SP2 currently...).

 

Stefano


 

If I understand you correctly, if digitizing is the last step of my work flow I´ll need to add an extra form with something like a "finish" button and close the WF from there?

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

Re: Save action in workflow

please check if setting a following node of the editing one you can save without errors. If this is not the case we have to search for something else.

Typically you may get the user redirected to the list of captured objects or to go back to the form to edit the last one.

Stefano Turcato
Presale Engineer
Hexagon Geospatial
Highlighted
Frequent Contributor
Posts: 110
Registered: ‎05-25-2016

Re: Save action in workflow

@sturcato  Adding a following node does fix the problem... I still think that it makes no sense in my workflow but it solves the problem, THX

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.