Yantra Adapters
The Yantra adapters enable use of Yantra functions from within Sterling B2B Integrator.
The following table provides an overview of the Yantra adapters:
Category | Description |
---|---|
System Name | These adapters are dynamically created when Sterling B2B Integrator is started and the names are in the form of Yantra <API group>. For example, Yantra Inventory, Yantra Order. |
Graphical Process Modeler (GPM) categories) | All Services, Applications > IBM® > Yantra Integration |
Description | The Yantra adapters represent the functionality available from a specific Yantra system. The adapters are built by connecting to the Yantra system and querying it for a list of available API groups and creating default adapter configurations comprised of those functional groups. The list is then made available to the GPM. Sterling B2B Integrator does not know what Yantra functionality is available until the connection is made. All adapters take the same parameters during configuration. Any differences in adapter requirements are contained in the documents sent to Yantra using the given adapter. It is therefore the responsibility of the calling process to deliver the appropriate document to the adapter. |
Business usage | Ability to exercise Yantra functionality from within Sterling B2B Integrator. |
Usage example | A user is configuring a business process graphically. The user selects an adapter from the list of available Yantra adapters, and places it into the business process. After configuration, the adapter is ready to use. |
Preconfigured? | No. All adapter configurations are created dynamically at Sterling B2B Integrator startup. Default adapter configurations are created dynamically based on API groups. You can create other configurations of any of the adapter types, but do not need to do so. You can use the dynamically created configurations for any needs. |
Requires third-party files? | Use the install3rdParty script to install yfcbe.jar and yfsclient.jar (for your Yantra version). These files are located in Yantra7x/lib. If the Yantra database is different from the Sterling B2B Integrator database, you may also need to load the appropriate database jar using the install3rdParty script (for example, instance classes12.zip for Oracle). |
Platform availability | Available for:
|
Related services | None |
Application requirements | The requirements are dependent on the API used. See your Yantra documentation for information about the documents passed to each API type. |
Initiates business processes? | No |
Invocation | The adapters can only be used as part of a business process. The adapters can be located at any point in a business process, but must have the proper business process document to work with the specified API call. |
Business process context considerations | These adapters do not initiate a business process. A primary document must always exist for the step that invokes one of the adapters and that is appropriate for the Yantra API call. Any output document received as a result of the API call becomes the new primary document. If any errors occur, the Yantra error code (YFSException.getErrorCode) is put into ProcessData/Yantra/ErrorCode. The error XML document (YFSException.getErrorMessage) is put into ProcessData/Yantra/ErrorDetail. The error description (YFSException.getErrorDescription) is put into the workflow status report. |
Returned status values | Returned status values:
|
Restrictions | None |
Persistence level | System default |
Testing considerations | To test an adapter configuration, create and run a business process that includes it. |
How the Yantra Adapters Work
The Yantra adapters are dynamically built each time Sterling B2B Integrator is started. Yantra functionality is made available in Sterling B2B Integrator through Yantra API groups.
When Sterling B2B Integrator starts, a Yantra Startup process runs that creates an adapter for each API group. These default adapter configurations are available in the GPM for use in business processes.
All adapters take the same parameters during configuration. Any differences in adapter requirements are contained in the documents sent to Yantra using the given adapter. The calling process must deliver the appropriate document to the adapter.
Example
The Yantra system that you are connecting to includes API groups for Inventory Management, Warehouse Layout, Move Requests, Price, and Receipt. When you start your Sterling B2B Integrator server, it queries the Yantra database and creates an adapter for each API group it finds. It would create an Inventory Management adapter, Warehouse Lay out adapter, Move Requests adapter, Price adapter, and Receipt adapter. These would all be visible and available for use in the GPM.
Implementing the Yantra Adapters
- Install the third-party .jar files. See Installing the Third Party .jar Files.
- Edit the sandbox.cfg file. See Installing the Third Party .jar Files.
- In the GPM, select and configure one or more of the dynamic adapters as part of a business process. See Configuring the Yantra Adapters.
Installing the Third-Party .jar Files
- Locate the two Yantra .jar files needed, yfsclient.jar and yfcbe.jar. Ensure that they are the
files for your Yantra version. These files are located in Yantra7x/lib. Note: If the Yantra database is different from the Sterling B2B Integrator database, you may also need to load the appropriate database jar using the install3rdParty script (for example, instance classes12.zip for Oracle).
- Shut down Sterling B2B Integrator.
- From the bin directory where Sterling B2B Integrator is installed, install the
.jar files by running the install3rdParty script included with Sterling B2B Integrator. Use the Yantra server
version number and the path and name of the directory where the files are located in the command,
using the following examples as a guide:
- On a Unix system, the commands would look similar to the following:
install3rdParty.sh yantra 7x -j directory/yfsclient.jar
install3rdParty.sh yantra 7x -j directory/yfcbe.jar
- On a Windows system, the commands would look similar to the following:
install3rdParty.cmd yantra 7x -j directory/yyfsclient.jar
install3rdParty.cmd yantra 7x -j directory/yfcbe.jar
- On a Unix system, the commands would look similar to the following:
- After installing the Yantra .jar files, you must add four lines to the sandbox.cfg file, located
in the properties subfolder under your Sterling B2B Integrator installation folder.
Add the following entries to sandbox.cfg:
- YANTRA_DB_CLASS=oracle.jdbc.driver.OracleDriver
- YANTRA_DB_URL=jdbc:oracle:thin:@<host>:<port>:<sid>
- YANTRA_DB_USER=username
- YANTRA_DB_PASS=userpassword
- Restart Sterling B2B Integrator.
Configuring the Yantra Adapters
In the GPM, use the dynamically created Yantra adapters in your business processes. Each adapter uses the parameters defined in the following table. If one of the adapters requires additional information, you must supply it in the document passed to the adapter in the business process.
Use the field definitions in the following table to set up a Yantra adapter configuration in the GPM. When editing BPML directly (not editing in the GPM), use the names in parentheses to refer to the parameters.
Parameter(BPML value) | Description |
---|---|
Config | Select the name of the adapter configuration from the list. |
ApiName (apiName) | Name of the Yantra API to call. Required. |
ProgId (progId) | Program identifier used for all transactions in the context of the YFSEnvironment. Required. |
Protocol (protocol) | The protocol to use when communicating with the
Yantra system. Optional. Valid values are:
|
URL (url) | URL of the Yantra system if using HTTP or HTTP/S protocol. Optional. |
UserId (userId) | User identifier used for all transaction in the context of the YFSEnvironment. Required. |
Parameters Passed From Adapter to Business Process
The following table contains the parameters passed from the Yantra adapter to the business process:
Parameter | Description |
---|---|
Yantra/ErrorCode | The value returned by YFSException.getErrorCode() if an exception occurs. Only set if YFSException is thrown. |
Yantra/ErrorDetail | The value returned by YFSException.getErrorDescription() if an exception occurs. Only set if YFSException is thrown. |
Parameters Passed From Business Process to Adapter
The parameters passed from the business process to a Yantra adapter are the same as those listed in Configuring the Yantra Adapters.
Business Process Example
The following example illustrates how the Yantra adapter can be used in a business process. In the example, the business process is calling the Yantra Inventory cancelReservation API:
<process name = "YantraTest">
<operation name="Get Inventory Supply">
<participant name="Yantra_Inventory"/>
<output message="toService">
<assign to="." from="*"/>
<assign to="apiName">getInventorySupply</assign>
<assign to="progId">someProgId</assign>
<assign to="userId">someUserId</assign>
<assign to="protocol">HTTP</assign>
<assign to="url">
http://<host>:<port>/yantra/interop/InteropHttpServlet
</assign>
</output>
<input message="fromService">
<assign to="." from="*"/>
</input>
</operation>
</process>
Messages Generated By Yantra Startup Class
The following messages are in noapp.log if the yfsclient.jar is not loaded:
Found startup.class1=
com.sterlingcommerce.woodstock.services.yantra.YantraStartup
Started com.sterlingcommerce.woodstock.services.yantra.YantraStartup
YantraStartup - Checking for existing service definition file.
YantraStartup - No existing service definition file found.
YantraStartup - Reflecting Yantra APIs.
YantraStartup - Zero API's reflected.
YantraStartup - Finished.
This message will always be written to the noapp.log even if you are not using Yantra. Every time Sterling B2B Integrator starts, it will check for Yantra.
Suppressing the Messages
If you stop using Yantra with Sterling B2B Integrator, or do not want the messages to appear in the log, comment out the following line in noapp.properties by placing a pound sign (#) at the beginning of the line as show below and that class will no longer be called at startup:
# startup.class1=com.sterlingcommerce.woodstock.services.yantra.YantraStartup
Example Messages
The following are example messages that might be found in noapp.log if yfsclient.jar is loaded and YANTRA_DB_xxx entries are in sandbox.cfg, which would enable Sterling B2B Integrator to query the Yantra database when starting up:
Found startup.class1=
com.sterlingcommerce.woodstock.services.yantra.YantraStartup
Started com.sterlingcommerce.woodstock.services.yantra.YantraStartup
YantraStartup - Checking for existing service definition file.
YantraStartup - No existing service definition file found.
YantraStartup - Reflecting Yantra APIss.
YantraStartup - Loading API groups from the database.
YantraStartup - Loading service definition.
YantraStartup - Adding main palette.
DynamicService processing: ../lang/en/Palette_en.properties
YantraStartup - Adding palette item: YantraApi1
YantraStartup - Loading service instance: Yantra Inventory
YantraStartup - Adding palette item: YantraApi2
YantraStartup - Loading service instance: Yantra Order
YantraStartup - Adding palette item: YantraApi3
YantraStartup - Loading service instance: Yantra Payment and Pricing
YantraStartup - Adding palette item: YantraApi4
YantraStartup - Loading service instance: Yantra Receipts
YantraStartup - Adding palette item: YantraApi5
YantraStartup - Loading service instance: Yantra Value Added Services
YantraStartup - Adding palette item: YantraApi6
YantraStartup - Loading service instance: Yantra Product Management
YantraStartup - Adding palette item: YantraApi7
YantraStartup - Loading service instance: Yantra Platform
YantraStartup - Adding palette item: YantraApi8
YantraStartup - Loading service instance: Yantra Delivery Management
YantraStartup - Adding palette item: YantraApi9
YantraStartup - Loading service instance: Yantra Task Management
YantraStartup - Adding palette item: YantraApi10
YantraStartup - Loading service instance: Yantra WMS Inventory
YantraStartup - Adding palette item: YantraApi11
YantraStartup - Loading service instance: Yantra Count
YantraStartup - Adding palette item: YantraApi12
YantraStartup - Loading service instance: Yantra Putaway
YantraStartup - Adding palette item: YantraApi13
YantraStartup - Loading service instance: Yantra Outbound Planning
YantraStartup - Adding palette item: YantraApi14
YantraStartup - Loading service instance: Yantra Warehouse Layout
YantraStartup - Adding palette item: YantraApi15
YantraStartup - Loading service instance: Yantra Picking
YantraStartup - Adding palette item: YantraApi16
YantraStartup - Loading service instance: Yantra Shipping
YantraStartup - Adding palette item: YantraApi17
YantraStartup - Loading service instance: Yantra UnGrouped
YantraStartup - Finished.