How-to Build Your Own Custom Integration Components

A few years ago, one of our JD Edwards customers asked us to integrate to JD Edwards XE. Those of you familiar with the Magic xpi Integration Platform will know that out-of-the-box Magic xpi has a JD Edwards World component and  a JD Edwards (EnterpriseOne) component. To satisfy the customer requirement, one of our professional services team members created a custom component for JD Edwards XE. That component is still not an official part of the Magic xpi product, but it is usable by anyone who needs it.

The point of this story is not to talk about JD Edwards XE integration, but rather to highlight that there are situations where you can create your own components in Magic xpi.

When working with Magic xpi, there may be occasions in which you need to add your own specific reusable component in order to perform a business process or integration function that will be needed repeatedly in one or more projects and  that is not provided by another component, method, resource or wizard in the Magic xpi Suite.

The Magic xpi Studio’s Component SDK Utility provides this capability. User-defined components may be created with the utility using either Magic xpa or Java logic.

The Magic xpi Component SDK Utility lets users define and modify user-defined components. As with any Magic xpi component, a user-defined component exposes a number of user-defined methods, each with their own parameters, which may be used in a step or trigger in a flow through either Direct Access Method (DAM) or a dynamic XML interface.

Keep in mind that the Component SDK is not used if all you need to is incorporate composited logic from a Java object, EJB, COM object or .NET. Magic xpi already has built-in components and methods for incorporating or compositing business logic from these types of environments. Instead, we’re talking about that very rare instance where you actually want to build your own component for say the “Flatbread CRM” system and be able to drag, drop and configure that component in any Magic xpi integration flow.

The most likely people to do something like this are Independent Software Vendors who want to be able to offer their customers a normalized solution for integration to their specific applications or APIs.

If you select the Component SDK Maintenance option from the Tools menu and click  the New button you will be guided through a series of steps that define your component inside Magic xpi. First, you need to add the general details: name, description, icon file name, class type (Magic xpa or Java), execution mode (step or trigger), and resource type name. Second, you provide the advanced details starting with the ECF Name, which is the program that will be invoked to run the component. From the Methods button, you can define the mnethods that will be used in the Direct Access Method. Each method will need to have a name, display name, and description. Then, for each method within a component, you define its available arguments. A Method Arguments Definition will include the name, type (alpha, numeric, logical, date, time, blob), picture (e.g. field size), direction (in, out or bidirectional), display name, tooltip, value type (expression, variable, combo or fixed value), visibility, mandatory, and default value.  

With the option for Linked Combo Boxes you can create a parent-child relationship between two arguments implemented as combo boxes. A value selected in the parent combo box will result in a dedicated set of values in the child combo box.

Depending on your earlier selections, you will either load a Magic xpa or Java program. The Load Programs Definitions screen allows you to provide the Magic xpa ECI file name or the Java class name. Magic xpi will display the list of all methods defined in the file. You can select all or only part of the available methods. The selected methods will be available in the main Methods screen for additional editing.

In the next stage you can define the errors that the component will provide during its operation. Click the Errors button to open the Error Details dialog box. This dialog allows you to set properties for the error code and its description. When the error is raised, the description will appear in the error repository and in the Magic xpi monitor.

You may also attach an existing resource to your new component. However, if your component needs a resource type that does not exist in Magic xpi, you can define a new resource type that the new component will be attached to. To define the resource types used (either new or existing), you will need to enter properties for the name and description of the resource as well as for its arguments. The arguments definition can include the name, type (alpha, numeric, logical, date, and time), length, tooltip, value type (expression or combo), default value, encryption, and logical name.  

At this point, you are ready to generate your component and its environment. The new components directory will include the following files and directories: the .idd file contains the XML configuration file, the .edp file contains the source file, the .ecf file contains the runtime file, the .eci file contains the component interface file listing the exposed programs, the xsd directory and the source directory.

You can create either step or trigger components. Step components appear within a flow and will execute as each instance of a flow reaches that step in the logic. The step components created are Magic xpa programs that contain the main program, resource type declaration (SetResource), method programs (MethodName), and the VersionOK function to check the version.  

A new trigger component can also be created and it will be based on a polling mechanism you define. The Magic xpa trigger program generated will include the main program, ServiceType declaration, start trigger code, trigger logic, enable logic, disable logic, and a VersionOK check.

With Java components where you specified a Java class, they will also generate Magic xpa logic with either a constructor including a Jcreate statement; an instance including a Jcall statement; or a static including a JcallStatic statement.  

The Magic Component SDK utility allows you to edit the generated components using the Edit button which will basically call Magic xpa Studio to allow you to edit the component.

Keep in mind that the public name of the program in Magic xpa should match the method name you specified in Magic xpi.

Click for the Online version

Featured Articles

Smart Industry
How mid-size manufacturers should consider digitalization case studies
Read More
Supply & Demand Chain Executive
Dear Mid-Sized Manufacturer, Do You Have a Plan for Transitioning to Industry 4.0?
Read More
Manufacturing News
FactoryEye Launches Strategic Partner Program
Read More