Usage of Excel Importer and Database Replication apps from Appstore :

0
Hello, I'm newbie in Mendix, just finished  the Rapid developer Path. I'm now looking for the ways to import and synchronize external data (both Excel Files and As400 DB2 files) in a Mendix application. The current direction is just for the moment Import inside Mendix.   I've found and successfully integrated in my test application 'Excel Importer' and 'Database Replication' apps. I've red the whole documentations linked to each app, but this does not allow me to make the app running.   I'm currently locked with this apps when I'm asked to choose an ObjectType. When I click the arrow at the right of the fields, I can't find what to enter in the parameters to select and object type. Also trying 'new template' by Excelfile' Button, I can import all the column headers, but afterwards, each trial to use a found column leads to the following message "A MetaObject must be selected before a column can be created or changed.".   Can somebody guide me or/and tell me where to find a working example or a detailed documentation explaining how to proceed with at least ObjectType.   Regards.
asked
3 answers
2

Hi Thierry,

 

 Have you seen this documentation yet?

  The missing piece I believe is to run MxModelReflection synchronization.  You have your template imported, but you haven't yet told the importer which Mendix object the data should go into.  First you must synchronize the desired domain models in MxModelReflection.  This will expose your domain model and allow you to pick the relevant entities.  So the first step to make it work is to go to the mxModelReflection admin page (assuming you have added it to your navigation), select the domain models of the object you are interested in, and hit 'synchronize'

In your excel template, you need to then select the Mendix object to relate to your incoming data.

Examples and instructions for this process can be found at the following link:

https://docs.mendix.com/howto/integration/importing-excel-documents

Best,

Rob

answered
1

Hi Rob,

Thx for the very quick reply.

This is the solution for the Excel importer.  Many thx for that.

But for the database replication and AS400 DB2 connection,  creating a new table mapping ,I'm still locked with the database Table selection, and also Import the mapping leads to an error :

"The mapping from XML to Domain throwed an error. Be sure the MxModelReflection and selected DB is synchronized.
LastErrorMessage: Content is not allowed in prolog..
LastErrorStackTraceorg.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.
at DatabaseReplication.ImportXMLFile (Import with mapping : 'Import XML document')
at DatabaseReplication.MB_ImportXMLFile (SubMicroflow : 'ImportXMLFile')

Advanced stacktrace:
at com.mendix.modules.microflowengine.MicroflowUtil.processException(MicroflowUtil.java:144)

Caused by:
org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.
at com.mendix.integration.importer.xml.XmlImporter$$anonfun$importStream$2$$anonfun$apply$1.apply(XmlImporter.scala:78)

Caused by:
Content is not allowed in prolog.
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at com.mendix.integration.importer.xml.XmlImporter$$anonfun$1.apply$mcV$sp(XmlImporter.scala:53)
at com.mendix.integration.importer.xml.XmlImporter$$anonfun$1.apply(XmlImporter.scala:53)
at com.mendix.integration.importer.xml.XmlImporter$$anonfun$1.apply(XmlImporter.scala:53)
at scala.util.Try$.apply(Try.scala:192)
at com.mendix.integration.importer.xml.XmlImporter.importStream(XmlImporter.scala:53)
at com.mendix.integration.importer.xml.XmlImporter.importStream(XmlImporter.scala:32)
at com.mendix.integration.internal.InternalIntegration$class.doImportStream(InternalIntegration.scala:143)
at com.mendix.integration.internal.InternalIntegrationImpl.doImportStream(InternalIntegrationImpl.scala:31)
at com.mendix.integration.actions.microflow.ImportAction.execute(ImportAction.scala:46)
at com.mendix.modules.microflowengine.microflow.impl.MicroflowObject.execute(MicroflowObject.java:47)
at com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAfterBreakingIfNecessary(MicroflowImpl.java:200)
at com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAction(MicroflowImpl.java:157)
at com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:50)
at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.doCall(CoreActionHandlerImpl.scala:76)
at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.call(CoreActionHandlerImpl.scala:55)
at com.mendix.core.actionmanagement.CoreAction.call(CoreAction.java:51)
at com.mendix.basis.actionmanagement.ActionManager$1.execute(ActionManager.java:186)
at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:33)
at com.mendix.basis.actionmanagement.ActionManager.executeSync(ActionManager.java:191)
at com.mendix.basis.component.InternalCore.executeSync(InternalCore.java:651)
at com.mendix.modules.microflowengine.actions.SubMicroflowAction.execute(SubMicroflowAction.scala:43)
at com.mendix.modules.microflowengine.microflow.impl.MicroflowObject.execute(MicroflowObject.java:47)
at com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAfterBreakingIfNecessary(MicroflowImpl.java:200)
at com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAction(MicroflowImpl.java:157)
at com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:50)
at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.doCall(CoreActionHandlerImpl.scala:76)
at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.call(CoreActionHandlerImpl.scala:55)
at com.mendix.core.actionmanagement.CoreAction.call(CoreAction.java:51)
at com.mendix.basis.actionmanagement.DefaultActionMonitor$$anonfun$run$1.apply(CustomMonitoredAction.scala:18)
at com.mendix.basis.actionmanagement.IMonitoredAction$$anon$1.execute(IMonitoredAction.scala:47)
at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:33)
at com.mendix.basis.actionmanagement.IMonitoredAction$class.monitor(IMonitoredAction.scala:49)
at com.mendix.basis.actionmanagement.CustomMonitoredAction.monitor(CustomMonitoredAction.scala:22)
at com.mendix.basis.actionmanagement.DefaultActionMonitor$.run(CustomMonitoredAction.scala:18)
at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.runMonitoredAction(CoreActionHandlerImpl.scala:65)
at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.call(CoreActionHandlerImpl.scala:53)
at com.mendix.core.actionmanagement.CoreAction.call(CoreAction.java:51)
at com.mendix.basis.actionmanagement.AsyncExecution$AsyncCallableWrapper$$anonfun$2.apply(AsyncExecution.scala:33)
at scala.util.Try$.apply(Try.scala:192)
at com.mendix.basis.actionmanagement.AsyncExecution$AsyncCallableWrapper.call(AsyncExecution.scala:32)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

 

Thx.

Thierry

answered
1

Hi Thierry,

In the MxModelReflection module, place the MxObjects_Overview page in navigation and run the app. Now in your browser open the same and you can see Domain Model Reflection Modules on left where you can select all the entities that you want to use for replication. Under Synchronize all entities and microflows of checked modules on the left, click on the click to refresh button so that all the entities and microflows get synchronized.  Hope doing this might fix your error.

Regards,

Sushuma

answered