In this video we'll explore how you can use the Mendix connector kit to build
and package extensions that can be reused simply and easily by other less
technical developers. For example you can leverage SDKs to integrate with external
api's, interface with other Java apps, or utilize third-party or open source java
libraries to extend your applications. Here we have a simple page designed by a
business user, which you have been asked to add translation functionality to. So,
let's get started by integrating the IBM Watson Translate API, using a publicly
available Java library. Microflows allow you to visually model logic and these
microflows can be extended with Java actions. First create a Java action and
set up the parameters required by the IBM Watson API to translate text between
the two languages. Type parameters allow you to take any Mendix object and use it to
define your response and input type, so it's generic and easy to reuse. The
expose as a Microflow action checkbox, publishes your connector to the native
microflow editor toolbox making it accessible to all developers. Once you've
copied the Java libraries to the user lib folder or added the jar file using Maven
or Ivy, you can deploy the project folder for use in your favorite IDE, where we add
the custom Java code. Import the Mendix project and you'll see the Java source
folder, which contains a structure based on the module within your Mendix project.
Each module has a folder containing actions, datasets and proxies.
Proxies are generated by the Mendix platform, allowing you to interact with
any constants, microflows or entities. An entity proxy comes with a number of
default methods, including "GET" and "SET" for each attribute and association. Find
the Java action and add the custom code, as well as selecting the parameters
defined earlier in the microflow. And then configure the input parameters to
pass the required data to your connector. Now run the project locally from the
Java IDE or with one-click deployment to the cloud of your choice from the Mendix
modeler. Your custom connector is ready to use and here we can see the
successful language translation. You can share your new connector directly from
your github repository on the Mendix public or private App Store.
Then non-technical developers can begin to use it in their apps and the great
thing is you'll never have to build the same integration twice. Now what will you
build?
Không có nhận xét nào:
Đăng nhận xét