<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:discourse="http://discourse.org/rss/modules/discourse/"><channel><title>Ana Rita Santos &amp; Diogo Domingues on DevBlog</title><link>https://devblog.criticalmanufacturing.com/author/ana-rita-santos-diogo-domingues/</link><description>Recent content in Ana Rita Santos &amp; Diogo Domingues on DevBlog</description><image><url>https://devblog.criticalmanufacturing.com/uploads/og.webp</url><link>https://devblog.criticalmanufacturing.com/uploads/og.webp</link></image><generator>Hugo -- gohugo.io</generator><language>en-us</language><copyright>A template by [Heksagon](https://www.heksagon.net). Implemented for [Critical Manufacturing](https://www.criticalmanufacturing.com/).</copyright><lastBuildDate>Fri, 24 Oct 2025 00:00:00 +0000</lastBuildDate><atom:link href="https://devblog.criticalmanufacturing.com/author/ana-rita-santos-diogo-domingues/index.xml" rel="self" type="application/rss+xml"/><item><title>External Integration Handler Resolution - post Boomi</title><link>https://devblog.criticalmanufacturing.com/blog/20250923_external_integration_handler_post_boomi/</link><pubDate>Fri, 24 Oct 2025 00:00:00 +0000</pubDate><dc:creator>Ana Rita Santos &amp; Diogo Domingues</dc:creator><guid>https://devblog.criticalmanufacturing.com/blog/20250923_external_integration_handler_post_boomi/</guid><description>External Integration Handler Resolution - post Boomi</description><content:encoded><![CDATA[<p><em>This post is based on Critical Manufacturing MES v11, although the concepts and configuration steps described here also apply to previous versions.</em></p>
<hr>
<p>Integrating <strong>MES with an ERP system</strong> is one of the most common requirements in our projects. Clients often approach us with a familiar goal:</p>
<blockquote>
<p>“We need MES to communicate seamlessly and securely with our ERP.”</p>
</blockquote>
<p>The biggest challenges lie in <strong>authentication</strong> and <strong>scalability</strong> - ensuring that communication is not only functional but also compliant with the customer&rsquo;s security protocols.</p>
<p>So, how do we build a solution that satisfies both simple and high-security authentication requirements, without adding unnecessary complexity?</p>
<p>Find out our solution!</p>
<h2 id="-introduction">🧩 Introduction</h2>
<p>In many projects, MES–ERP integration follows a standard client-server model. MES acts as either the client or the server, sending and receiving information such as production orders, material data, or inventory updates.</p>
<p>While the integration logic itself is usually straightforward, <strong>authentication</strong> often becomes the differentiator between a quick setup and a complex implementation.</p>
<p>➡️ Some customers operate in closed networks or controlled environments where <strong>Basic Authentication</strong> - a simple username and password - meets all needs.</p>
<p>➡️ Others, especially those with stricter corporate security standards or integrations with cloud-based systems, require <strong>OAuth 2.0</strong>, which enables token-based authentication and tighter control over identity and access.</p>
<p>Both scenarios are valid and frequently encountered in real projects.</p>
<p>That&rsquo;s why our solution was designed to <strong>support multiple authentication mechanisms</strong>, allowing each customer to choose what best fits their policies, and once chosen, it can always go back and configure differently without requiring architectural changes or additional complexity.</p>
<p>In the next sections, we will look at the <strong>project requirement</strong>, what was <strong>the challenge</strong> mid its design, and the <strong>final solution</strong>. We will focus on the architecture and also walk through a few examples of <strong>Basic</strong> and <strong>OAuth</strong> Authentication.</p>
<p>We believe sharing this experience can help others structure or improve their integrations solution design, and by hearing your feedback, on what we could have done different, learn new things!</p>
<h2 id="-requirement-and-context">📋 Requirement and Context</h2>
<p>At the beginning of the project, the client requested <strong>multiple ERP integrations</strong> to be handled within our MES system — to receive and send data.</p>
<p>Initially, all integrations were designed to use <strong>Basic Authentication</strong>, a straightforward and widely supported method for secure communication.</p>
<p>However, as the project evolved, the client introduced a new requirement — integration with <strong>Boomi</strong>. Boomi it would <strong>require OAuth 2.0 authentication</strong> to send data, and the current designed solution did not support it.</p>
<h3 id="-authentication-challenge-in-boomi-integrations">❓ Authentication Challenge in Boomi Integrations</h3>
<p>Because Boomi does not support Basic Authentication, this limitation quickly created a roadblock.</p>
<p>The integrations from MES to Boomi/Oracle would not function as expected, revealing how <strong>authentication</strong> plays a critical role when designing ERP integrations.</p>
<p>This challenge drove us to rethink and redesign the solution to seamlessly <strong>support both Basic and OAuth authentication</strong>.</p>
<h3 id="-extending-support-for-oauth-authentication">🚀 Extending Support for OAuth Authentication</h3>
<p>We introduced several enhancements to make the solution more flexible and maintainable:</p>
<ul>
<li><strong>1️⃣ Authentication Lookup Table:</strong> to reference the authentication method.</li>
<li><strong>2️⃣ Integration Handler Resolution Extra Configurations:</strong> to allow the system dynamically know what authentication mechanism to apply.</li>
</ul>
<p>With these improvements, the final solution:</p>
<ul>
<li><strong>✅ Became flexible and scalable:</strong> capable of supporting diverse authentication requirements across different clients and projects.</li>
<li><strong>✅ Ensured future readiness:</strong> for upcoming integrations and evolving security needs.</li>
</ul>
<h2 id="-solution-design-and-architecture">🏗️ Solution Design and Architecture</h2>
<p>To address the authentication requirement, we enhanced our <strong>out of the box (OOB)</strong> functionalities with new <strong>custom artifacts</strong>.</p>
<p>The following elements compose the final solution:</p>
<h3 id="1-smart-table--integrationhandlerresolution-oob">1️⃣ Smart Table — <em>IntegrationHandlerResolution</em> (OOB)</h3>
<p><strong>What it does?</strong></p>
<ul>
<li>When an <strong>Integration Entry</strong> is created, the system resolves this table to determine which <strong>DEE</strong> should be triggered to process the corresponding request.</li>
</ul>
<p><strong>How we use it?</strong></p>
<ul>
<li>In our solution, whenever MES needs to <strong>send</strong> or <strong>receive</strong> data from the ERP, an <strong>integration entry is generated</strong>.
<ul>
<li>When <strong>receiving data</strong>, through the API, a new Integration Entry is created, and for each different context, a new custom DEE was also created to handle it.</li>
<li>But for <strong>sending data</strong>, a exclusive <strong>DEE &ldquo;ReportToERPHandler&rdquo; (Custom)</strong> was created to be always defined in the table.</li>
</ul>
</li>
</ul>
<h3 id="2-mes-configurations-custom">2️⃣ MES Configurations (Custom)</h3>
<p><strong>How we use it?</strong></p>
<ul>
<li>All <strong>sensitive data</strong> such as <strong>credentials</strong> are managed through MES Configurations.</li>
</ul>
<p>
<img src="/blogPosts/posts/20251024_external_integration_handler_post_boomi/AuthenticationConfigurations.png" alt="AuthenticationConfigurations" />

</p>
<p><strong>Why we used configurations?</strong></p>
<ul>
<li><code>✅ Built-in security</code>:
<ul>
<li>Leverage the existing <strong>secure string</strong> mechanism to safely store and manage confidential values like passwords.</li>
</ul>
</li>
<li><code>✅ Simplified maintenance</code>:
<ul>
<li>Reuse the same configuration path (e.g., user or password) across multiple integrations, and <strong>centralize</strong> updates in one place.</li>
<li>Clean or update table entries without losing credentials value.</li>
</ul>
</li>
</ul>
<h3 id="3-lookup-table--authtype-custom">3️⃣ Lookup Table — <em>AuthType</em> (Custom)</h3>
<p>Initialized with the values <code>BASIC</code> and <code>BASIC_APIKEY_AUTH</code> to classify supported authentication methods.</p>
<p>
<img src="/blogPosts/posts/20251024_external_integration_handler_post_boomi/AuthType.png" alt="AuthType" />

</p>
<h3 id="4-smart-table--externalintegrationhandlerresolution-custom">4️⃣ Smart Table — <em>ExternalIntegrationHandlerResolution</em> (Custom)</h3>
<table>
<thead>
<tr>
<th style="text-align:left">Name</th>
<th style="text-align:center">Is Key</th>
<th style="text-align:center">Is Mandatory</th>
<th style="text-align:left">Data Type</th>
<th style="text-align:left">Reference</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">FromSystem</td>
<td style="text-align:center">Yes</td>
<td style="text-align:center">Yes</td>
<td style="text-align:left">NVarChar</td>
<td style="text-align:left">LookupValue (IntegrationSystem)</td>
</tr>
<tr>
<td style="text-align:left">ToSystem</td>
<td style="text-align:center">Yes</td>
<td style="text-align:center">Yes</td>
<td style="text-align:left">NVarChar</td>
<td style="text-align:left">LookupValue (IntegrationSystem)</td>
</tr>
<tr>
<td style="text-align:left">MessageType</td>
<td style="text-align:center">Yes</td>
<td style="text-align:center">No</td>
<td style="text-align:left">NVarChar</td>
<td style="text-align:left">LookupValue (MessageType)</td>
</tr>
<tr>
<td style="text-align:left">Endpoint</td>
<td style="text-align:center">No</td>
<td style="text-align:center">Yes</td>
<td style="text-align:left">NVarChar</td>
<td style="text-align:left">None</td>
</tr>
<tr>
<td style="text-align:left">EndpointUserConfigPath</td>
<td style="text-align:center">No</td>
<td style="text-align:center">Yes</td>
<td style="text-align:left">NVarChar</td>
<td style="text-align:left">None</td>
</tr>
<tr>
<td style="text-align:left">EndpointPasswordConfigPath</td>
<td style="text-align:center">No</td>
<td style="text-align:center">Yes</td>
<td style="text-align:left">NVarChar</td>
<td style="text-align:left">None</td>
</tr>
<tr>
<td style="text-align:left">IsSync</td>
<td style="text-align:center">No</td>
<td style="text-align:center">No</td>
<td style="text-align:left">Bit</td>
<td style="text-align:left">None</td>
</tr>
<tr>
<td style="text-align:left">AuthType</td>
<td style="text-align:center">No</td>
<td style="text-align:center">No</td>
<td style="text-align:left">NVarChar</td>
<td style="text-align:left">LookupValue (CustomAuthType)</td>
</tr>
<tr>
<td style="text-align:left">EndpointAuthConfigPath</td>
<td style="text-align:center">No</td>
<td style="text-align:center">No</td>
<td style="text-align:left">VarChar</td>
<td style="text-align:left">None</td>
</tr>
<tr>
<td style="text-align:left">EndpointAPIKeyConfigPath</td>
<td style="text-align:center">No</td>
<td style="text-align:center">No</td>
<td style="text-align:left">VarChar</td>
<td style="text-align:left">None</td>
</tr>
<tr>
<td style="text-align:left">EndpointAPIVersionConfigPath</td>
<td style="text-align:center">No</td>
<td style="text-align:center">No</td>
<td style="text-align:left">VarChar</td>
<td style="text-align:left">None</td>
</tr>
</tbody>
</table>
<p><strong>Example</strong></p>
<p>
<img src="/blogPosts/posts/20251024_external_integration_handler_post_boomi/ExternalHandlerResolution.png" alt="External Integration Handler Resolution Post Boomi" />

</p>
<p><strong>What it does?</strong></p>
<ul>
<li>The custom smart table provides an <strong>additional configuration layer</strong> when handling integrations to send data, giving us even more flexibility to configure these requests.</li>
</ul>
<p><strong>How we use it?</strong></p>
<ul>
<li>As it was mentioned before, whenever MES needs to <strong>send</strong> data to the ERP, an Integration Entry (IE) is created. Before the IE creation, a new utility was implemented to resolve this table first, allowing the system to determine — based on the <code>IsSync</code> field — whether the IE should be created and executed <strong>synchronously</strong>, or simply created and executed by the system <strong>asynchronously</strong>.</li>
<li>Afterwards, already at the handler of this request, the <strong>DEE &ldquo;ReportToERPHandler&rdquo; (Custom)</strong>, configured in the first table, uses this table again to determine <strong>how to construct and send the request</strong>:
<ul>
<li>The <code>AuthType</code> field defines which authentication protocol to apply: <strong>BASIC</strong> or <strong>BASIC_APIKEY_AUTH</strong>.</li>
<li>The <code>Endpoint</code> field specifies the target endpoint for the request.</li>
</ul>
</li>
</ul>
<p><strong>Note:</strong> We had to extend the Config Paths fields length to 512 characters to support longer configuration paths.</p>
<h4 id="-basic-authentication">🔐 Basic Authentication</h4>
<p>The <strong>BASIC</strong> credentials are stored in the respective configurations, where the path fields are:</p>
<ul>
<li><code>EndpointUserConfigPath:</code> Username.</li>
<li><code>EndpointPasswordConfigPath:</code> Password.</li>
</ul>
<p>The DEE retrieves these values at runtime and applies them directly in the request header.</p>
<h4 id="-api-key-authentication">🔐 API Key Authentication</h4>
<p>For <strong>BASIC_APIKEY_AUTH</strong>, a <strong>Bearer Token</strong> must first be created.</p>
<p><strong>How to generate the token?</strong></p>
<ul>
<li>Call the endpoint specified in <code>EndpointAuthConfigPath</code>.</li>
<li>Use Basic Authentication with credentials from:
<ul>
<li><code>EndpointUserConfigPath</code></li>
<li><code>EndpointPasswordConfigPath</code></li>
</ul>
</li>
<li>Request the token using the client_credentials grant type.</li>
<li>The resulting bearer token is then applied to subsequent API requests.</li>
</ul>
<p>Therefore, additional new configuration paths are necessary because different authentication methods (Basic, API Key, OAuth) require different sets of credentials and parameters:</p>
<ul>
<li><code>EndpointAuthConfigPath:</code> Introduced to store OAuth-specific authentication details (e.g., client ID, client secret, token endpoint).</li>
<li><code>EndpointAPIKeyConfigPath:</code> Added to handle APIs that require an API key instead of username/password or OAuth.</li>
<li><code>EndpointAPIVersionConfigPath:</code> Provided a way to manage API versioning for external systems, ensuring integrations remain stable even if endpoints evolve.</li>
</ul>
<p>The API request includes the <strong>Bearer Token</strong> and the proper headers from the three configuration paths — ensuring secure, versioned, and authenticated communication.</p>
<h2 id="-architectural-overview-summary">🔍 Architectural Overview Summary</h2>
<p>The diagram below illustrates the overall architecture:</p>
<p>
<img src="/blogPosts/posts/20251024_external_integration_handler_post_boomi/ArchitecturalOverview.png" alt="Architectural Overview" />

</p>
<h2 id="authors">Authors</h2>
<h3 id="hi-my-name-is-diogo-domingues-">Hi! My name is Diogo Domingues. ✌️</h3>
<p>I&rsquo;m a Software Engineer at Critical Manufacturing, working in the Solution Delivery area.</p>
<p>You can find me on <a href="https://www.linkedin.com/in/diogo-domingues-875701228/" target="_blank" rel="noopener">LinkedIn</a>.</p>
<p>
<figure class="text-center">
  <img
    src="/blogPosts/contributors/blogger_diogo_domingues.jpg"
    alt="Diogo Domingues"
    title="Software Engineer"
  />
  <figcaption style="text-align: center">Software Engineer</figcaption>
</figure>

</p>
<h3 id="hi-my-name-is-ana-rita-santos-">Hi! My name is Ana Rita Santos. ✌️</h3>
<p>I&rsquo;m a Software Engineer at Critical Manufacturing, working in the Solution Delivery area.</p>
<p>You can find me on <a href="https://www.linkedin.com/in/ana-rita-santos-536660249/" target="_blank" rel="noopener">LinkedIn</a>.</p>
<p>
<figure class="text-center">
  <img
    src="/blogPosts/contributors/blogger_ana_rita_santos.jpg"
    alt="Ana Rita Santos"
    title="Software Engineer"
  />
  <figcaption style="text-align: center">Software Engineer</figcaption>
</figure>

</p>
]]></content:encoded></item></channel></rss>