Last modified by Erik Bakker on 2025/03/24 14:43

Hide last authors
Erik Bakker 25.1 1 {{container}}
2 {{container layoutStyle="columns"}}
3 (((
Erik Bakker 29.1 4 In this microlearning, we'll cover configuring the eMagiz Connector for your Mendix application. The eMagiz Connector is a module that facilitates seamless integration between Mendix and eMagiz projects. We’ll walk you through the essential configuration steps, including setting up startup and shutdown processes, configuring the activation key, creating the on-receive microflows, and, if needed, import/export mappings. On top of that, we will provide you with a shortened guide on configuring the various variants of connections between Mendix and eMagiz. In the [[course>>doc:Main.eMagiz Academy.Microlearnings.Intermediate Level.Mendix connectivity.WebHome||target="blank"]] on Intermediate Level, we will further explore the functionality in both eMagiz and Mendix for setting up specific connections (i.e., setting up an asynchronous exit). By the end, you'll be ready to ensure a stable and secure connection between your Mendix application and eMagiz.
Erik Bakker 1.1 5
6 Should you have any questions, please contact academy@emagiz.com.
7
8 == 1. Prerequisites ==
Erik Bakker 25.1 9
Erik Bakker 19.1 10 * Basic knowledge of the eMagiz platform.
11 * Access to a Mendix application.
12 * Access to the Deploy phase of your eMagiz project.
13 * A connection between Mendix and eMagiz Designed and Created.
Erik Bakker 32.1 14 * A Mendix app running on **Java 17** or **Java 21**.
Erik Bakker 19.1 15 ** You can set the Java version of your application in Mendix Studio Pro at App > Settings > Runtime.
Erik Bakker 24.1 16 ** For local development, specify where the JDK is located for the selected Java version. You can do so in Mendix Studio Pro at Edit > Preferences > General.
Erik Bakker 19.1 17 * A Mendix app with a Mx version of 9.24.25 or higher.
Erik Bakker 1.1 18
19 == 2. Key concepts ==
Erik Bakker 25.1 20
Erik Bakker 29.1 21 This microlearning centers around configuring an eMagiz Connector
22 With eMagiz Connector, we mean: A Mendix module developed and maintained by eMagiz that simplifies connecting a Mendix application to an eMagiz project for data traffic between both systems.
Erik Bakker 1.1 23
Erik Bakker 29.1 24 To configure an eMagiz Connector, you need the following:
Erik Bakker 1.1 25
Erik Bakker 24.1 26 * Configure the After Startup and Before shutdown
Erik Bakker 19.1 27 * Configure the activation key
28 * Configure the on-receive microflows
29 * Configure the import/export mapping
Erik Bakker 1.1 30
Erik Bakker 29.1 31 == 3. Configure a eMagiz Connector ==
Erik Bakker 1.1 32
Erik Bakker 29.1 33 To configure the eMagiz Connector in a Mendix app, the following steps must be performed. Before proceeding, please check the following.
Erik Bakker 21.1 34
Erik Bakker 33.1 35 {{info}}* Is your Mendix app running on Java 17 or Java 21?
Erik Bakker 21.1 36 * Is your Mendix version 9.24.25 or above?
Erik Bakker 24.1 37 * Did you receive the **activation key** from the eMagiz developer, or can you retrieve the **activation key** yourself in the eMagiz platform?
38 ** Note that you can run your Mendix application without having an **activation key**. The app will then run in "NOOP" mode and will **not** connect to eMagiz.
39 * Did you receive the relevant **queue** information from the eMagiz developer, or can you retrieve the **queue** information yourself in the eMagiz platform?
Erik Bakker 25.1 40 * In case you want to utilize the import/export mapping functionality, did you receive the relevant **message definition** information from the eMagiz developer, or can you retrieve the **message definition** information yourself in the eMagiz platform?{{/info}}
Erik Bakker 23.1 41
Erik Bakker 25.1 42 === 3.1 Configure the Access rights to the eMagiz Mendix Module ===
43
Erik Bakker 29.1 44 It is recommended that only the administrator user role has access to the eMagiz Connector module.
Erik Bakker 24.1 45 To do this, follow these steps:
Erik Bakker 1.1 46
Erik Bakker 6.1 47 * Navigate to **Project Security**
Erik Bakker 24.1 48 * Validate that the security of your project is set to Production. If not, please select the Production option
Erik Bakker 6.1 49 [[image:Main.Images.Microlearning.WebHome@novice-mendix-connectivity-configure-emagiz-mendix-connector--security-settings.png]]
50 * Navigate to **User Roles**
Erik Bakker 23.1 51 * Edit the User role
Erik Bakker 6.1 52 * Edit the Module roles
Erik Bakker 29.1 53 * Check the box of the eMagiz Connector module and press OK
Erik Bakker 1.1 54
Erik Bakker 6.1 55 The configuration before you press OK should look as follows
Erik Bakker 1.1 56
Erik Bakker 6.1 57 [[image:Main.Images.Microlearning.WebHome@novice-mendix-connectivity-configure-emagiz-mendix-connector--security-admin-result.png]]
Erik Bakker 1.1 58
Erik Bakker 6.1 59 This configuration only needs to happen **once**.
Erik Bakker 2.1 60
Erik Bakker 24.1 61 === 3.2 Configure the after startup and before shutdown ===
Erik Bakker 8.1 62
Erik Bakker 29.1 63 Once the security is in place the first step of configuring your eMagiz Connector is to connect the After Startup (ASU_Connector_Launch) and the Before Shutdown (BSD_Connector_Exit) microflow that eMagiz provides you as part of the connector module to the existing "After Startup" and "Before Shutdown" microflow of the project itself.
Erik Bakker 2.1 64
Erik Bakker 24.1 65 [[image:Main.Images.Microlearning.WebHome@novice-mendix-connectivity-configure-emagiz-mendix-connector--after-startup-before-shutdown-emagiz.png]]
Erik Bakker 2.1 66
Erik Bakker 24.1 67 After you have linked them to the project after startup and the project before shutdown, ensure that these microflows are indeed triggered on the Project level. You can verify this by navigating to Project Settings -> Runtime.
Erik Bakker 2.1 68
Erik Bakker 24.1 69 [[image:Main.Images.Microlearning.WebHome@novice-mendix-connectivity-configure-emagiz-mendix-connector--after-startup-before-shutdown-project.png]]
Erik Bakker 2.1 70
Erik Bakker 6.1 71 This configuration only needs to happen **once**.
Erik Bakker 4.1 72
Erik Bakker 24.1 73 ==== 3.2.1 Expand the after startup with "Start" actions per producer/consumer ====
Erik Bakker 4.1 74
Erik Bakker 24.1 75 For every producing (i.e., sending information to eMagiz) and consuming (i.e., receiving information from eMagiz) action, you need a corresponding {{code}}StartAction{{/code}}.
76
77 The actions come in the variety of {{code}}StartMessage...{{/code}}, {{code}}StartString...{{/code}}, {{code}}StartSyncMessage...{{/code}} and {{code}}StartSyncString...{{/code}}. If you want to connect to a synchronous messaging pattern in eMagiz, use the StartSync... Java action; otherwise, the plain Start... actions should be used. You can use the String or Message variant to send/receive Strings or Mendix Objects in your microflows.
Erik Bakker 4.1 78
Erik Bakker 24.1 79 All of the parameters of the Java actions describe what they mean.
Erik Bakker 4.1 80
Erik Bakker 24.1 81 * Import/Export mappings are mandatory when using message producers/consumers.
82 * When using message consumers, the **importObjectType** must match the input parameter type of the receiving microflow.
83 * In addition to the previous point, synchronous message consumers require the receiving microflow to return data matching the input of the export mapping. Wrong data does not prevent the application from starting but will cause errors.
84 * The **validateMessage** setting of consumers and sync-producers can be used to skip the xml-validation filter in the flow. If left empty, by default, messages coming into Mendix will be validated against the system message definition as defined in eMagiz. Outgoing messages are not validated by the eMagiz connector.
85 * The max-concurrent-consumers parameter when starting consumers defaults to 1 for async consumers and 2 for sync consumers. This decreases the chance of a second request having to wait for the first to finish, which could lead to timeouts. If more concurrency is needed, the number can be increased when starting the (sync) consumer.
Erik Bakker 4.1 86
Erik Bakker 30.1 87 For a detailed description per available connection method please take a look at this [[course>>doc:Main.eMagiz Academy.Microlearnings.Intermediate Level.Mendix connectivity.WebHome||target="blank"]].
88
Erik Bakker 24.1 89 === 3.3 Configure the activation key ===
90
91 This unique activation key identifies your Mendix system with our infrastructure and allows your Mendix application. The eMagizMendixConnector module has a constant called "Activation key." This must be filled in with the correct value to connect your Mendix system to the proper model/environment combination. You can validate this by checking the first part of the activation key that defines the following.
Erik Bakker 25.1 92
Erik Bakker 24.1 93 * Environment to connect to.
94 * Name of the Mendix system as given by the eMagiz developer.
95 * Technical name of the eMagiz model to which your Mendix system will connect.
96 * Technical name of the company to which the eMagiz model belongs that you connect to with your Mendix system.
97
98 An example of this would be "TEST:AWAY:MSGRED:CAPE.{someautogeneratedstring}."
Erik Bakker 4.1 99
Erik Bakker 28.1 100 === 3.4 Sending messages (Optional) ===
Erik Bakker 4.1 101
Erik Bakker 24.1 102 When all of the consumers and producers are started in the after-startup microflow, the Send Java actions in the {{code}}_USE_ME{{/code}} folder can be used in the application. The Send operation should always match the type of the Start action in the after-startup microflow.
Erik Bakker 4.1 103
Erik Bakker 24.1 104 For example, if you start the producer with the {{code}}StartSyncStringProducer{{/code}} Java action, you have to use the {{code}}SendAndReceiveString{{/code}} Java action instead of the {{code}}SendString{{/code}}.
Erik Bakker 4.1 105
Erik Bakker 24.1 106 If sending a message fails, there is no retry behavior by default. This means the data might get lost if no proper error handling is configured. This can be mitigated by using a Task Queue with retry behavior. Further instructions on how to configure this can be found in step 7.1 below.
Erik Bakker 4.1 107
Erik Bakker 24.1 108 Sending a message to a queue that does not have a {{code}}StartProducer{{/code}} Java action call in the after-startup will throw errors.
Erik Bakker 4.1 109
Erik Bakker 28.1 110 ==== 3.4.1 Retry behavior (Optional) ====
Erik Bakker 4.1 111
Erik Bakker 24.1 112 When an error occurs during message sending with the eMagiz Connector, no retry behavior is implemented by default. Depending on the application's structure and error-handling configuration, this could potentially lead to data loss. This problem can be mitigated by executing the send Java action in a Task Queue. This Task Queue can be configured with retry behavior to maximize the chance of delivery.
Erik Bakker 6.1 113
Erik Bakker 31.1 114 You must create a Task Queue to configure retry behavior when sending a message. The [[Mendix Documentation>>https://docs.mendix.com/refguide/task-queue/#create-queue||target="blank"]] provides instructions on how to do this.
Erik Bakker 6.1 115
Erik Bakker 24.1 116 After creating the Task Queue, open the Java action in your microflow, which you are using to send messages. A checkbox at the bottom of this screen says, “Execute this Java action in a Task Queue.” Enable this checkbox and select the Task Queue you just created. After selecting the Task Queue, the option to configure retry behavior will be shown. Depending on your use case, you can choose a fixed delay or an exponential back-off. The difference between these options can be found on Mendix's previously mentioned documentation page.
Erik Bakker 6.1 117
Eva Torken 11.1 118 == 4. Key takeaways ==
Erik Bakker 1.1 119
Erik Bakker 29.1 120 To configure an eMagiz Connector, you need the following:
Erik Bakker 1.1 121
Erik Bakker 24.1 122 * Configure the after startup and before shutdown
123 ** Configure the correct Java actions
124 * Configure the activation key
125 * Configure logic to send messages, including retry behavior (optional)
Erik Bakker 1.1 126
Eva Torken 11.1 127 == 5. Suggested Additional Readings ==
Erik Bakker 1.1 128
Carlijn Kokkeler 13.1 129 * [[Novice (Menu)>>doc:Main.eMagiz Academy.Microlearnings.Novice.WebHome||target="blank"]]
130 ** [[Mendix Connectivity (Navigation)>>doc:Main.eMagiz Academy.Microlearnings.Novice.Mendix Connectivity.WebHome||target="blank"]]
Erik Bakker 29.1 131 *** [[What is an eMagiz Connector (Explanation)>>doc:Main.eMagiz Academy.Microlearnings.Novice.Mendix Connectivity.novice-mendix-connectivity-what-is-an-emagiz-mendix-connector.WebHome||target="blank"]]
132 *** [[Install an eMagiz Connector (Explanation)>>doc:Main.eMagiz Academy.Microlearnings.Novice.Mendix Connectivity.novice-mendix-connectivity-install-emagiz-mendix-connector.WebHome||target="blank"]]
133 *** [[Update an eMagiz Connector (Explanation)>>doc:Main.eMagiz Academy.Microlearnings.Legacy Functionality.novice-mendix-connectivity-update-emagiz-mendix-connector.WebHome||target="blank"]]
Erik Bakker 15.1 134 * [[Mendix (Search Result)>>url:https://docs.emagiz.com/bin/view/Main/Search?sort=score&sortOrder=desc&highlight=true&facet=true&r=1&f_space_facet=0%2FMain.&f_type=DOCUMENT&f_locale=en&f_locale=&f_locale=en&text=%22mendix%22||target="blank"]]
Erik Bakker 25.1 135 )))
Erik Bakker 1.1 136
Erik Bakker 25.1 137 (((
138 {{toc/}}
139 )))
140 {{/container}}
141 {{/container}}