Hexagon Geospatial
MENU

GeoMedia Smart Client

GeoMedia Smart Client community discussion board is where you can create, contribute and share information and knowledge in regards to configuring as well as working with GeoMedia Smart Client. Find your answers, share your knowledge and help build a strong GeoMedia Smart Client community.
Showing results for 
Search instead for 
Do you mean 
Reply
Contributor
Posts: 66
Registered: ‎05-02-2016

Issue in Offline Mode - Creating one feature with a different active feature selected

Hi, I am building a couple of offline forms in our Development environment. For this post I'll call one of these Works_Area.

 

For the 'New' action for Works_Area, another feature called Reserves needs to be active and a reserve selected, as the Works_Area is based on the selected reseve. This brings across a foreign key and reserve name into the form.

For some odd reason which I have spent a lot of time trying to figure out, the GMSC Key of the selected reserve populates the GMSC Key of the new form for the Works_Area being created.

When capturing geometry of the new Works_Area, Smart Client starts editing the geometry of an existing Works_Area that happens to have the same GMSC Key that was populated from the selected reserve, rather than creating a new polygon which should have no GMSC Key at this stage. If the GMSC Key that came across doesn't exist in Works_Area, Smart Client doesn't go into Edit Geometry mode.

 

I cannot figure this out. I recently worked on the same setup in production, where the active feature is different to the feature being created in offline mode, and this works. I've cleared the cache, compared the workflows, actions and Javascript which have the same setup, as well as removing the Javascript reference from the workflow but the problem remains.

 

Have you come across this problem on offline mode?


Regards,

 

Josh

Staff
Posts: 927
Registered: ‎10-18-2015

Re: Issue in Offline Mode - Creating one feature with a different active feature selected

Hi Josh,

 

this cannot be achieve by out of the box functionalities in offline data capturing, while it is a common configuration in online workflows. The offline form can only be related to the feature you want to edit, you do not have access to sql queries and you do not have access to session variables.

You would need to restructure your workflows to manage it before to go offline or when back online. In alternative you might extend offline functionalities with a custom Java plugin.

 

Regards,

Stefano

 

 

Stefano Turcato
Presale Engineer
Hexagon Geospatial
Contributor
Posts: 66
Registered: ‎05-02-2016

Re: Issue in Offline Mode - Creating one feature with a different active feature selected

Hi Stefano,

 

It seems Edit Forms are fine in offline, but I can't even add a new feature offline even with the basic workflow - i.e. the same feature is active, or no feature is active to use the New Form. Capture/Edit Geometry refuses to work.

Can new features be added in offline mode? I have been able to add features offline before.

 

Looking at the logs the repeating error is

08/12/2016 4:48:49 PM WARNING: The customValue Map of the primitive doesn't contain a CustomValue for the column 'Reserve_Name'    -->[AWT-EventQueue-2] com.intergraph.web.viewer.map.style.StyleValue.handleCustomValues.

 

even though this field doesn't exist in this form. It was in a form I was trying to use earlier, which I commented out as it is non-persisted online.

I also tried clearing the db's in cache.

 

Josh

Staff
Posts: 927
Registered: ‎10-18-2015

Re: Issue in Offline Mode - Creating one feature with a different active feature selected

Hi Josh,

 

yes for sure you can add new features in offline mode. Please check if your feature is set to be "offline" as loader and which method you are using to generate the primary key (in general the most simple way is to use a guid).

 

HTH,

Stefano

Stefano Turcato
Presale Engineer
Hexagon Geospatial
Contributor
Posts: 66
Registered: ‎05-02-2016

Re: Issue in Offline Mode - Creating one feature with a different active feature selected

Hi Stefano,

 

This is set to offline. I tried setting primary key as guid in the workflow but still no luck.

Is that what you meant by guid?

 

I'll have to keep trying.

 

Regards,

 

Josh

Staff
Posts: 927
Registered: ‎10-18-2015

Re: Issue in Offline Mode - Creating one feature with a different active feature selected

Josh,

 

could you please post your form definition? GUID is the most simple way to generate string to be used as primary key. 

BTW the error you are getting seems to be related to the style applied for that feature: do you have symbology definition with db values used?

 

Regards,

Stefano

Stefano Turcato
Presale Engineer
Hexagon Geospatial
Contributor
Posts: 66
Registered: ‎05-02-2016

Re: Issue in Offline Mode - Creating one feature with a different active feature selected

Hi Stefano,

 

'Reserve Name' isn't in any symbology definition, but is in the query for this feature, although the queries aren't available in offline.

 

Below is the workflow.

 

<OfflineForm name="Add_Offline_Green_Waste_Report" table="Green_Waste_Reports" idfield="GMSC_KEY" customscript="AddOfflineGreenwaste.js">
	
		<FormGeometry name="GEOMETRY_SPA" layer="Green_Waste_Reports">
    		<NewActions>
    			<GeometryAction name="GE_NEWPOINT" isstartonload="true" />				
    		</NewActions>
    		<EditActions>
    			<GeometryAction name="GE_MOVE" isstartonload="true"/>
    		</EditActions>
    	</FormGeometry>
    	<FormTab name="Works_Details" label= "Works Details">
			<FormGroup name="Works_Details_Group" label="Green Waste Report Forms" >
				<FormField name="Reserve_FK" label="Reserve_FK:" type="textfield" required="false" datatype="string" maxlength="11" visible="hidden"/>
				<FormField name="GMSC_KEY" label="GMSC_KEY:" type="textfield" datatype="guidstring" required="false" visible="hidden"/>
				<FormField name="GWR_ID" label="GWR ID:" type="textfield" datatype="string" required="false" editable="false"/>
				<FormField name="Email_Address" label="Email Address:" type="textfield" required="false"  datatype="string" visible="hidden" maxlength="80" defaultvalue="geogjo@mornpen.vic.gov.au"/>
				<FormField name="Volunteer_Works_Report_FK" label="Volunteer Works" type="textfield" required="false" datatype="string" editable="false" visible="hidden[SCRIPT[IG.hasValue({FORM.Volunteer_Works_Report_FK})]]" maxlength="11"/>				
				<FormField name="Date" label="Date" type="datepicker" datatype="date" required="true" maxlength="30"/>
				<!--FormField name="Reserve_Name" label="Reserve Name" type="textfield" datatype="string" maxlength="100" required="false" editable="false"/-->
				<FormField name="Author" label="Author" type="textfield" required="false" datatype="string" maxlength="80"/>									
			</FormGroup>
			<FormGroup name="Material_for_Collection" label="Material for Collection" >
				<FormField name="Chipping" label="Chipping" type="checkbox" datatype="string" required="false" maxlength="10" defaultvalue="0"/>
				<FormField name="M2" label="M2" type="textfield" datatype="string" required="false" maxlength="80"/>
				<FormField name="Weed_Bags" label="Weed Bags" type="checkbox" datatype="string" required="false" maxlength="10" defaultvalue="0"/>
				<FormField name="Bag_Count" label="No. of Bags" type="combobox" required="false" datatype="string" lov="LIST[1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16;17;18;19;20;21;22;23;24;25;26;27;28;29;30;31;32;33;34;35;36;37;38;39;40;41;42;43;44;45;46;47;48;49;50;51;52;53;54;55;56;57;58;59;60;61;62;63;64;65;66;67;68;69;70;71;72;73;74;75;76;77;78;79;80;81;82;83;84;85;86;87;88;89;90;91;92;93;94;95;96;97;98;99;100]" maxlength="5"/>					
				<FormField name="Other" label="Other" type="textarea" datatype="string" required="false" maxlength="250"/>
				<FormField name="Location_Desc" label="Location Description" type="textarea" required="false" datatype="string" maxlength="250" editable="true" defaultvalue="## Autopopulated on Save ##"/>
				<FormField name="Loc_Desc" label="Loc Desc" type="textfield" datatype="number" required="false" defaultvalue="0" visible="hidden"/>							
				<FormField name="Green_Waste_Collected" label="Green Waste Collected" type="checkbox" required="false" datatype="string" maxlength="1" editable="true" defaultvalue="0"/>
			</FormGroup>
		</FormTab>			
		<FormTab name="Material_Collected" label= "Material Collected">
			<FormGroup name="Material_Collected_Group" label="Material Collected" >
				<FormField name="Collected_By" label="Collected By" type="textfield" datatype="string" required="false" maxlength="80"/>
				<FormField name="Date_Collected" label="Date Collected" type="datepicker" required="false" datatype="date" maxlength="30"/>
				<FormField name="Chipping_Material_pickup" label="Chipping" type="checkbox" datatype="string" required="false" maxlength="10" defaultvalue="0"/>
				<FormField name="M2_pickup" label="M2" type="textfield" datatype="string" required="false" maxlength="80"/>
				<FormField name="Weed_Bags_pickup" label="Weed Bags" type="checkbox" datatype="string" required="false" maxlength="10" defaultvalue="0"/>
				<FormField name="Bag_Count_pickup" label="No. of Bags" type="combobox" datatype="string" required="false" lov="LIST[1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16;17;18;19;20;21;22;23;24;25;26;27;28;29;30;31;32;33;34;35;36;37;38;39;40;41;42;43;44;45;46;47;48;49;50;51;52;53;54;55;56;57;58;59;60;61;62;63;64;65;66;67;68;69;70;71;72;73;74;75;76;77;78;79;80;81;82;83;84;85;86;87;88;89;90;91;92;93;94;95;96;97;98;99;100]" maxlength="5"/>			
				<FormField name="Other_pickup" label="Other" type="textarea" datatype="string" required="false" maxlength="250"/>
				<FormField name="Complete" label="Completed" type="checkbox" datatype="string" required="false" />
			</FormGroup>			
		</FormTab>	
		<!--<FormAction name="Save" action="SCRIPT[IG.executeRequest({controller: 'Form',action: 'save'}).done(function (result){IG.closeWebBrowser()})]" />-->
		
		<FormAction name="capture" label="Draw Polygon/Save" action="SCRIPT[IG.captureOfflineGeometry()]" />
		<FormAction action="SCRIPT[IG.clearSelectedElements();IG.closeWebBrowser()]" name="Exit_Form" label="Exit Form" />
		
	</OfflineForm>

 

I have removed the js file reference and commented out all fields and it still doesn't work. I put an alert in the Geometry action to see if the actual button was working, and the alert popped up. It even picks up when required fields aren't populates. It just doesn't go any further and ignores the Geometry action, but works in the EDIT forms.

 

Below is the error log.

 

23/12/2016 2:02:39 PM FINEST:	IDLE->CONTEXTMENU				--> [pool-15-thread-1] com.intergraph.web.viewer.map.MapMouseHandler.setState
23/12/2016 2:02:40 PM FINEST:	CONTEXTMENU->IDLE				--> [AWT-EventQueue-2] com.intergraph.web.viewer.map.MapMouseHandler.setState
23/12/2016 2:02:40 PM FINEST:	Cachefile found: C:\ProgramData\Intergraph\SmartClient\cache\webview\43731545187b5e6531f553690718a18e455bb46c\GMSC\Workflows\SmartClientOffline2d4ad0d802b42cb7d02b1b4dd6e488762aace08f.html				--> [JavaFX Application Thread] com.intergraph.web.plugin.webbrowser.ApplicationCache.getCacheFile
23/12/2016 2:02:40 PM FINEST:	file:///C:/ProgramData/Intergraph/SmartClient/cache/webview/43731545187b5e6531f553690718a18e455bb46c/GMSC/Workflows/SmartClientOffline2d4ad0d802b42cb7d02b1b4dd6e488762aace08f.html				--> [JavaFX Application Thread] com.intergraph.web.plugin.webbrowser.WebBrowser$1$8.changed
23/12/2016 2:02:53 PM FINEST:	WebBrowser with target 'a513c9d1-dbc4-482b-9f6b-a211976e1c28' closed!				--> [AWT-EventQueue-2] com.intergraph.web.plugin.media.MediaSupportPlugin$5.browserClosed
Staff
Posts: 927
Registered: ‎10-18-2015

Re: Issue in Offline Mode - Creating one feature with a different active feature selected

Hi Josh,

 

that is really weird. Do you use the same offline form for both editing and creating new objects? Can you please try to delete your H2 file on the client side 

 

C:\ProgramData\Intergraph\SmartClient\cache\[GMSC_SITE]

 

to check if it is related to some inconsistencies? Then you have to sync back from online...

 

Thanks,

Stefano

Stefano Turcato
Presale Engineer
Hexagon Geospatial
Highlighted
Contributor
Posts: 66
Registered: ‎05-02-2016

Re: Issue in Offline Mode - Creating one feature with a different active feature selected

Seems to be ok now. I made some fields visible but not editable, changed the case of some other fields and the forms work.

It seems that sometimes a field needs to be visible to work. I'll keep an eye on this and let you know if I find a pattern.

 

Josh

Do you need immediate support?
If you encounter a critical issue and need immediate assistance please submit a Service Request through our Support Portal.