C Using Classic XAPI Events

This appendix contains the following topics:

Note:

This chapter is applicable only if you use classic events delivery. Classic event delivery is available when you use JD Edwards EnterpriseOne Tools 8.93 or earlier releases, or if you use JD Edwards EnterpriseOne Tools 8.94 with JD Edwards EnterpriseOne Applications 8.10.

Refer to the Guaranteed Events chapters if you use JD Edwards EnterpriseOne Tools 8.94 with JD Edwards EnterpriseOne Applications 8.11 or JD Edwards EnterpriseOne Tools 8.95 and later tools releases with JD Edwards EnterpriseOne Applications 810 and later Applications releases.

C.1 Understanding XAPI Events - Classic

XAPI is a JD Edwards EnterpriseOne service that captures transactions as the transaction occurs, and then calls third-party software, end-users, and other JD Edwards systems to obtain a return response. A XAPI event is very similar to a real-time event and uses the same infrastructure to send an event. The difference between a real-time event and a XAPI event is that the subscriber to a XAPI event returns a reply to the originator. The XAPI event contains a set of structured data that includes a unique XAPI event name and a business function to be invoked upon return. Like real-time events, XAPI events can be generated on the JD Edwards EnterpriseOne server using any interface, such as HTML, WIN32, and terminal servers.

The XAPI structure sends outbound events and receives a reply from third-party systems. An event is generated in JD Edwards EnterpriseOne and sent to a third-party system for processing. The JD Edwards EnterpriseOne system is called the originator. The third-party system sends a response back to JD Edwards EnterpriseOne. The third-party system is called the executor.

The XAPI structure also provides complete request-reply connectivity between two JD Edwards EnterpriseOne systems. The JD Edwards EnterpriseOne system that generates the event is called the Originator. The JD Edwards EnterpriseOne system that responds to the event is called the Executor.

C.1.1 JD Edwards EnterpriseOne to Third-Party

This diagram shows a logical representation of the XAPI process from JD Edwards EnterpriseOne to a third-party system:

Figure C-1 JD Edwards EnterpriseOne to a third-party system XAPI event

Description of Figure C-1 follows
Description of "Figure C-1 JD Edwards EnterpriseOne to a third-party system XAPI event"

In summary:

  1. JD Edwards EnterpriseOne, (XAPI originator) sends a request.

  2. The request is sent to a third-party system.

  3. The third-party system (XAPI executor) processes the request and sends a response back to the XAPI originator.

C.1.2 Third-Party to JD Edwards EnterpriseOne

This diagram shows a logical representation of the XAPI process from a third-party system to JD Edwards EnterpriseOne:

Figure C-2 Third-party system to JD Edwards EnterpriseOne XAPI event

Description of Figure C-2 follows
Description of "Figure C-2 Third-party system to JD Edwards EnterpriseOne XAPI event"

In summary:

  1. The third-party system (XAPI originator) sends a request using the JD Edwards EnterpriseOne XAPI request form.

  2. The request is sent to JD Edwards EnterpriseOne.

  3. JD Edwards EnterpriseOne (XAPI executor) processes the request and sends a response back to the XAPI originator.

C.1.3 JD Edwards EnterpriseOne-to-JD Edwards EnterpriseOne

This diagram shows a logical representation of the XAPI processing for two different JD Edwards EnterpriseOne systems communicating with each other:

Figure C-3 JD Edwards EnterpriseOne-to-EnterpriseOne XAPI event

Description of Figure C-3 follows
Description of "Figure C-3 JD Edwards EnterpriseOne-to-EnterpriseOne XAPI event"

In summary:

  1. The first JD Edwards EnterpriseOne system (XAPI originator) sends a request.

  2. The request is sent to a second JD Edwards EnterpriseOne system, which may share the same or different environment as the first JD Edwards EnterpriseOne system.

  3. The second JD Edwards EnterpriseOne system (XAPI executor) processes the request and sends a response back to the first JD Edwards EnterpriseOne system (XAPI originator).

  4. The first JD Edwards EnterpriseOne system (XAPI originator) processes the response.

C.1.4 Prerequisites

Before you complete the tasks in this section:

  • Enable security for the JD Edwards EnterpriseOne server.

  • Ensure that the default user has a valid security record under the [SECURITY] section of the JD Edwards EnterpriseOne server jde.ini file (that is, that the user is a valid JD Edwards EnterpriseOne user).

C.2 Defining XAPI Events

You use the Interoperability Event Definition (P90701) program to define XAPI events. When you define XAPI events, the system automatically updates the Event Category field to Container. All XAPI events use the data structure option. The system automatically adds the DXAPIROUTE data structure, which is required for XAPI events. The DXAPIROUTE data structure contains the routing information that is to be returned to the originating system. The jdeXAPI_Finalize API appends DXAPIROUTE data execution. After you define your XAPI event, be sure to activate the event by changing the status.

See Defining Events.

C.3 Subscribing to XAPI Events

If you generate XAPI events, you must define a logical subscriber and set up XAPI event subscriber information. The logical subscriber must exist before you can add XAPI event subscriber information. If subscriber information is missing, the system generates the XAPI event but does not deliver it. You use the Interoperability Event Subscription program (P90702) to define the logical subscriber and to set up XAPI subscriber information. After you set up the XAPI subscriber, be sure to activate the subscriber by changing the status.

See Subscribing to Events.

C.4 Setting Up the OCM for XAPI Events

If your interface to JD Edwards EnterpriseOne is not a JD Edwards EnterpriseOne client, you must configure the OCM so that the system call can find the IEO kernel. When you configure the OCM, include a specific environment and ensure that no two duplicate mappings are in active status at the same time.

To configure the OCM, access the Object Mapping Revisions form and enter XAPI in the Object Type field. Configuring the OCM with the XAPI entry enables the system call to find the IEO kernel. If the OCM is not properly configured, the system generates an error message. OCM error messages for XAPI events are the same as the OCM error messages for real-time events.

See Understanding the OCM for Real-Time Events.

C.5 Working with JD Edwards EnterpriseOne and Third-Party XAPI Events

This section provides an overview of the XAPI event generation and response and discusses:

  • XAPI outbound request process flow.

  • XAPI outbound request APIs.

  • XAPI outbound request API usage sample code.

  • XAPI outbound request XML sample code.

  • XAPI outbound request jde.ini file configuration.

  • XAPI inbound response process flow.

  • XAPI inbound response parsing APIs.

  • XAPI inbound response parsing API usage sample code.

  • XAPI inbound response sample code.

  • XAPI inbound response jde.ini file configuration.

  • XAPI client jde.ini file configuration.

C.5.1 Understanding XAPI Event Generation and Third-Party Response

The XAPI structure supports XAPI outbound event generation. XAPI outbound events are generated by the XAPI originator exactly the same as real-time events.

The XAPI structure also provides for an inbound response. The XAPI inbound response happens after a XAPI event is generated. The XAPI inbound response is handled by the third-party system. The third-party system, the XAPI executor, processes the request (event) and returns a reply to the XAPI originator.

When the return XML document is received, it is routed to the XML Service kernel. The XML Service kernel saves the XML document to disk, creates a unique handle, and then calls the callback business function that is provided in the DXAPIROUTE XAPI method ID element in the XML document.

C.5.2 XAPI Outbound Request Process Flow

This diagram illustrates the flow for a XAPI outbound request that is sent to a third-party system:

Figure C-4 XAPI request to a third-party system

Description of Figure C-4 follows
Description of "Figure C-4 XAPI request to a third-party system"

In summary:

  1. When a XAPI event is generated from a JD Edwards EnterpriseOne client, the client business function calls the appropriate API.

    This API does an OCM lookup to determine where the IEO kernel is located. The API validates, filters, and formats the data. When a XAPI event is generated from a JD Edwards EnterpriseOne server, the business function calls the interoperability event interface within the CallObject kernel. The data is sent as a partial event to the IEO kernel.

  2. The IEO kernel creates the XAPI event and produces an XML document when the XAPI event is finalized.

  3. The IEO kernel packages the XML document and passes the document to the EVN kernel.

  4. The EVN kernel determines the transport driver that should handle the event, and JDENET distributes the information to the subscribers.

    Note:

    XAPI currently does not use IBM WebSphere MQ or MSMQ. All events that are defined in the F90701 table are sent to you if you configure your system to receive events using IBM WebSphere MQ and MSMQ transport drivers.

C.5.3 XAPI Outbound Request APIs

These APIs are available for you to generate a XAPI call:

  • jdeXAPI_Init

  • jdeXAPI_Add

  • jdeXAPI_Finalize

  • jdeXAPI_Free

  • jdeXAPI_SimpleSend

  • jdeXAPI_ISCallTypeEnabled

  • jdeXAPI_CALLS_ENABLED

C.5.4 XAPI Outbound Request API Usage Sample Code

This code sample illustrates how to create a XAPI outbound request:

/* Header files required */

#include <B4205010.h>

/*************************/ 
 BOOL bXAPIInUse, bExit;
#ifdef jdeXAPI_CALLS_ENABLED
 XAPI_CALL_ID ulXAPICallID = 0;
 XAPI_CALL_RETURN eXAPICallReturn = eEventCallSuccess;
#endif
 DSD4205010A dsD4205010A = {0}; /*Query Header*/
 DSD4205010B dsD4205010B = {0}; /*Query Detail*/
#ifdef jdeXAPI_CALLS_ENABLED
 if(jdeXAPI_IsCallTypeEnabled("XAPIOPOUT") && jdeXAPI_IsCallTypeEnabled⇒
("XAPIOPIN") )
 {
  bXAPIInUse = TRUE;
 }
#endif
 /*-----------------------------------------------------*/
 /* Call XAPIInit */
#ifdef jdeXAPI_CALLS_ENABLED
 if(bXAPIInUse == TRUE)
 {
  ulXAPICallID = jdeXAPI_Init( lpBhvrCom, "SendOrderPromiseRequest", 
"XAPIOPOUT", NULL, &eXAPICallReturn);
  if (eXAPICallReturn != eEventCallSuccess)
  {
   bExit = TRUE;
  }
 }
#endif
 /*-------------------------------------------------*/
 /* Adding Header Information */
#ifdef jdeXAPI_CALLS_ENABLED
 if(bXAPIInUse == TRUE)
 {
  eXAPICallReturn = jdeXAPI_Add( lpBhvrCom, ulXAPICallID, 
"SendOrderPromiseRequest", "D4205010A", &dsD4205010A, sizeof(DSD4205010A));
  if (eXAPICallReturn != eEventCallSuccess)
  {
   bExit = TRUE;
  }
 }
#endif
 /*-------------------------------------------------*/
 /* Loading Detail Information */
#ifdef jdeXAPI_CALLS_ENABLED
 if(bXAPIInUse == TRUE)
 {
  eXAPICallReturn = jdeXAPI_Add( lpBhvrCom, ulXAPICallID, 
"SendOrderPromiseRequest", "D4205010B", &dsD4205010B, sizeof(DSD4205010B));
  if (eXAPICallReturn != eEventCallSuccess)
  {
   bExit = TRUE;
  }
 }
#endif
#ifdef jdeXAPI_CALLS_ENABLED
 if(bXAPIInUse == TRUE)
 /*-------------------------------------------------*/
 /* Finalize */
 {
  eXAPICallReturn = jdeXAPI_Finalize( lpBhvrCom, ulXAPICallID, 
"SendOrderPromiseRequest", "OrderPromiseCallback");
  if (eXAPICallReturn != eEventCallSuccess)
  {
   bExit = TRUE;
  }
 }
#endif
#ifdef jdeXAPI_CALLS_ENABLED
 if (eXAPICallReturn != eEventCallSuccess)
 {
 /*-------------------------------------------------*/
 /* CleanUp */
  if(bXAPIInUse == TRUE)
  {
   jdeXAPI_Free( lpBhvrCom, ulXAPICallID, "SendOrderPromiseRequest");
  }
 }
#endif

C.5.5 XAPI Outbound Request XML Sample Code

This code example shows the XML template for a XAPI outbound request:

xml version=1.0 encoding="utf-8" ?>
<jdeResponse type="realTimeEvent" user="KL5449350" role='*ALL' 
session="22558100.1004460662" subtype="XAPICall" environment="DV7333">
<event>
<header>
<eventVersion>1.0</eventVersion>
<type>XAPIOPOUT</type>
<user>KL5449350</user>
<application>APIDRV</application>
<version />
<sessionID>22558100.1004460662</sessionID>
<environment>DV7333</environment>
<host>DEN-PP6954083</host>
<sequenceID>DEN-PP6954083_1540_10302001095648_KL5449350_1</sequenceID>
<date>10302001</date>
<time>095649</time>
<scope />
<codepage>utf-8</codepage>
</header>
<body elementCount="3">
<detail date="10302001" name="APIDRVFunction" time="9:56:48" type= "" 
DSTMPL="D4205010A" executionOrder="1" parameterCount="23">
<szRequestId type="String">1234567</szRequestId>
<szUserId type="String">TestUser</szUserId>
<szQueryMode type="String">Test</szQueryMode>
<szCustomerName type="String">John Doe</szCustomerName>
<mnCustomerId type="Double">12345</mnCustomerId>
<szCustomerGroup type="String">Group 1</szCustomerGroup>
<szAddress1 type="String">Line 1</szAddress1>
<szAddress2 type="String">Suite 1</szAddress2>
<szAddress3 type="String">123 E. Main</szAddress3>
<szPostalCode type="String">50001</szPostalCode>
<szCity type="String">Centennial</szCity>
<szCounty type="String">Arap</szCounty>
<szStateProvince type="String">CO</szStateProvince>
<szCountry type="String">US</szCountry>
<szBusinessObjective type="String" />
<mnTraceDepth type="Double">0</mnTraceDepth>
<mnPenaltyCostAdjustment type="Double">0</mnPenaltyCostAdjustment>
<szOrderNumber type="String">1000</szOrderNumber>
<nAllowBackorders type="Int">49</nAllowBackorders>
<nAllowSubstitution type="Int">48</nAllowSubstitution>
<nAllowPartialLineShip type="Int">49</nAllowPartialLineShip>
<nAllowPartialOrderShip type="Int">49</nAllowPartialOrderShip>
<nAllowMultisource type="Int">49</nAllowMultisource>
</detail>
<detail date="10302001" name="APIDRVFunction" time="9:56:49" type= "" 
DSTMPL="D4205010B" executionOrder="2" parameterCount="17">
<mnLineNumber type="Double">1</mnLineNumber>
<mnCacheLineNumber type="Double">1</mnCacheLineNumber>
<mnItemNumber type="Double">2222</mnItemNumber>
<sz2ndItemNumber type="String">1234567</sz2ndItemNumber>
<sz3rdItemNumber type="String">2234567</sz3rdItemNumber>
<szOrderUnit type="String">123</szOrderUnit>
<mnOrderQuantity type="Double">12</mnOrderQuantity>
<szPlanningUnit type="String">ECL</szPlanningUnit>
<mnPlanningQuantity type="Double">12</mnPlanningQuantity>
<mnPlanningMultiple type="Double">1</mnPlanningMultiple>
<mnPlanningUnitPrice type="Double">1234</mnPlanningUnitPrice>
<jdRequestDate type="Date">10302001</jdRequestDate>
<szShippingGroup type="String">Ship Group</szShippingGroup>
<szMultiSource type="String">MS</szMultiSource>
<nAllowPartialLineShip type="Int">49</nAllowPartialLineShip>
<nAllowBackorders type="Int">49</nAllowBackorders>
<nAllowSubstitution type="Int">48</nAllowSubstitution>
</detail>

/* DXAPIROUTE Routing Information */
<detail date="10302001" name="XAPICall time="09:56:49" type="" 
DSTMPL="DXAPIROUTE"
executionOrder="3" parameterCount="4">
<ClientPort type="Int">6009</ClientPort>
<ClientIP type="Int">167810863</ClientIP>
<ClientMagicNumber type="Int">32781408</ClientMagicNumber>
<XAPIMethodID type="String">GetComputerID</XAPIMethodID>
</detail>
/* End of DXAPIROUT Routing Information */

</body>
</event>
</jdeResponse>

C.5.5.1 Routing Information

All XAPI events must include DXAPIROUTE in the XML file, as noted near the end of the XML code sample. DXAPIROUTE contains the routing information that is to be returned to the originating client. The jdeXAPI_Finalize API appends DXAPIROUTE data execution.

C.5.6 XAPI Outbound Request jde.ini File Configuration

To generate XAPI events, these sections of the JD Edwards EnterpriseOne server jde.ini file must be configured:

  • [JDENET_KERNEL_DEF19]

  • [JDENET_KERNEL_DEF20]

  • [JDEITDRV]

If the jde.ini file is not properly configured for XAPI events, this error message is written to the jde.log file:

XAPI Event [Event Name] cannot be subscribed. Must have XAPI Definition in the
INI file.

Make sure the XAPI event is defined in the F90701 table and that XAPI Executor information is defined in the jde.ini file.

You can ignore this error message because XAPI subscription is persisted and cannot be unsubscribed:

Cannot unsubscribe XAPI event.

See Configuring the jde.ini file for Events.

C.5.7 XAPI Inbound Response Process Flow

This diagram illustrates the flow for a XAPI inbound response from a third-party system to the JD Edwards EnterpriseOne originating system:

Figure C-5 XAPI response from a third-party system

Description of Figure C-5 follows
Description of "Figure C-5 XAPI response from a third-party system"

In summary:

  1. An inbound XML document is passed from a third-party system to the XML Service kernel.

  2. The XML Service kernel creates a unique XML handle and stores the document on disk.

  3. The XML Service kernel reads the XAPICallMethod attribute from the XML document and passes the XML handle as the parameter to the specified business function.

  4. The business function (XAPICallMethod) uses XML service APIs to read and parse the XML data into JD Edwards EnterpriseOne data.

  5. The business function (XAPICallMethod) uses XML CallObject to send the reply to the originator.

  6. A JD Edwards EnterpriseOne client can poll for the XAPI response from the JD Edwards EnterpriseOne server.

C.5.8 XAPI Inbound Response Parsing APIs

These APIs are available for you to generate an inbound XAPI response:

  • jdeXML_GetDSCount

  • jdeXML_GetDSName

  • jdeXML_ParseDS

  • jdeXML_DeleteXML

C.5.9 XAPI Inbound Response Parsing API Usage Sample Code

This code example illustrates how the business function uses the XML service APIs to read and parse the XML data:

#include <B4205030.h>

 int iCurrentRecord;
 int iHeaderCount;
 int iRecordCount;
 NID nidDSName;
 DSD4205030A dsD4205030A = {0};
 DSD4205030B dsD4205030B = {0};
#ifdef jdeXAPI_CALLS_ENABLED
 if(jdeXAPI_IsCallTypeEnabled("XAPIOPOUT") && jdeXAPI_IsCallTypeEnabled
("XAPIOPIN") )
 {
  iRecordCount = jdeXML_GetDSCount(lpDS->szXMLHandle);
  if (iRecordCount > 0)
  {
   for (iCurrentRecord = 0; iCurrentRecord < iRecordCount; iCurrentRecord++)
   {
    jdeXML_GetDSName(lpDS->szXMLHandle,iCurrentRecord,nidDSName);
    if (jdestrcmp(nidDSName,(const char*)"D4205030A") == 0)//mod
    {
     jdeXML_ParseDS( lpDS->szXMLHandle,iCurrentRecord,&dsD4205030A,
sizeof(DSD4205030A));

    }
    else
    {
     jdeXML_ParseDS( lpDS->szXMLHandle,iCurrentRecord,&dsD4205030B,
sizeof(DSD4205030B));
    }
   }
  }
  if (iCurrentRecord == iRecordCount)
  {
   jdeXML_DeleteXML(lpDS->szXMLHandle);
  }
 }
#endif

C.5.10 XAPI Inbound Response Sample Code

This sample code shows an inbound XAPI response:

<?xml version="1.0" encoding="utf-8" ?>
<jdeRequest pwd="JDE" type="xapicallmethod" user="JDE" role='*ALL' 
session= "" ⇒
environment="DV7333" sessionidle="">
<header>
<eventVersion>1.0</eventVersion>
<type>XAPIOPIN</type>
<user>JDE</user>
<application>XPI</application>
<version />
<sessionID />
<environment>DEVXPINT</environment>
<host>denxpi7</host>
<sequenceID />
<date>09122001</date>
<time>094951</time>
<scope />
<codepage>utf-8</codepage>
</header>
<body elementCount="3">
<params type="D4205030A" executionOrder="1" parameterCount="24">
<param name="type" />
<param name="dateStamp" />
<param name="timeStamp" />
<param name="szRequestId">1|ZJDE0001</param>
<param name="szBusinessObjective">Maximize_Service</param>
<param name="mnResultNumber">0.0</param>
<param name="mnTotalCost">0.0</param>
<param name="mnTotalDeliveryCost">0.0</param>
<param name="mnTotalPrice">0.0</param>
<param name="mnTotalProfit">0.0</param>
<param name="mnTotalMargin">0.0</param>
<param name="mnTotalValue">0.0</param>
<param name="mnLatestLineDate">0.0</param>
<param name="mnNumberOfBackorders">0.0</param>
<param name="mnNumberOfSubstitutions">0.0</param>
<param name="mnOrderFillRate">0.0</param>
<param name="szErrorCode" />
<param name="szErrorDescription" />
<param name="szOrderNumber">3115|SO|00200</param>
<param name="nAllowPartialOrderShip">0</param>
<param name="nAllowMultisource">0</param>
<param name="nAllowBackorders">0</param>
<param name="nAllowSubstitution">0</param>
<param name="nAllowPartialLineShip">0</param>
</params>
<params type="D4205030B" executionOrder="2" parameterCount="28">
<param name="type" />
<param name="dateStamp" />
<param name="timeStamp" />
<param name="mnLineNumber">1.0</param>
<param name="mnOriginalLineNumber">1.0</param>
<param name="mnCacheLineNumber">1.0</param>
<param name="mnRequestedItem">60011.0</param>
<param name="mnAvailableItem">60011.0</param>
<param name="mnAvailableAmount">25.0</param>
<param name="jdAvailableDate">09/12/2001 00:00:00</param>
<param name="jdRequestedDate">09/10/2001 00:00:00</param>
<param name="jdPickDate">09/11/2001 00:00:00</param>
<param name="jdShipDate">09/11/2001 00:00:00</param>
<param name="szShipLocation" />
<param name="mnCost">0.0</param>
<param name="mnDeliveryCost">0.0</param>
<param name="mnPrice">0.0</param>
<param name="mnProfit">0.0</param>
<param name="mnMargin">0.0</param>
<param name="mnValue">0.0</param>
<param name="mnSubstitutionRatio">0.0</param>
<param name="szShippingGroup" />
<param name="szMultiSource" />
<param name="szErrorCode" />
<param name="szSuspectedCause" />
<param name="nAllowPartialOrderShip">0</param>
<param name="nAllowBackorders">0</param>
<param name="nAllowSubstitution">0</param>
</params>
<params type="DXAPIROUTE" executionOrder="3" parameterCount="7">
<param name="type" />
<param name="dateStamp">09/05/2001 00:00:00</param> 
<param name="timeStamp">13:54:04</param>
<param name="ClientPort">6009</param>
<param name="ClientIP">168045665</param>
<param name="ClientMagicNumber">3</param>
<param name="XAPIMethodID">OrderPromiseCallback</param>
</params>
</body>
</jdeRequest>

C.5.11 XAPI Inbound Response jde.ini File Configuration

These sections of the JD Edwards EnterpriseOne server jde.ini file must be configured for the XAPI response portion of the XAPI structure:

  • [JDENET_KERNEL_DEF22]

  • [JDENET_KERNEL_DEF24]

  • [XAPI]

  • [XMLLookupInfo]

C.5.11.1 [XAPI]

Configure this setting:

XMLDirectory=c:\builds\bdev\log\

Note:

The XML document directory (XMLDirectory) must be registered in the jde.ini file on the server under the [XAPI] section in the XMLDirectory key. The key contains the directory on the server where XML documents are to be stored.

Caution:

For data privacy, be sure to remove the global read access rights for the specified directory.

C.5.11.2 [XMLLookupInfo]

Configure these settings:

XMLRequestType5=realTimeEvent
XMLKernelMessageRange5=14251
XMLKernelHostName5=local
XMLKernelPort5=0
XMLKernelReply5=0

See Understanding the OCM for Real-Time Events.

C.5.12 XAPI Client jde.ini File Configuration

If you are using a JD Edwards EnterpriseOne client to generate XAPI events, you must define the Client Dispatch kernel and [JDENET] sections of the client jde.ini file. If your interface to the JD Edwards EnterpriseOne server is other than a JD Edwards EnterpriseOne client, these two settings are not required. The settings enable the JD Edwards EnterpriseOne client to poll for the XAPI response message from the JD Edwards EnterpriseOne server.

Use these settings to configure your JD Edwards EnterpriseOne client jde.ini file.

C.5.12.1 [JDENET_KERNEL_DEF27]

Configure these settings:

krnlName=CLIENT DISPATCH KERNEL
dispatchDLLName=jdeuser.dll
dispatchDLLFunction=_JDENET_ClientDispatch
maxNumberOfProcesses=0
numberOfAutoStartProcesses=0

C.5.12.2 [JDENET]

Configure these settings

serviceNameListen=6004
serviceNameConnect=6004
maxKernelRanges=27
netTrace=0

Note:

The serviceNameListen and serviceNameConnect settings must be the same as the server's settings. For example, if your server jde.ini file has serviceNameListen=6005 and serviceNameConnect=6005, then your JD Edwards EnterpriseOne client jde.ini file must be serviceNameListen=6005 and serviceNameConnect=6005.

The value for maxKernelRanges setting should be the same value as the server.

C.6 Working with JD Edwards EnterpriseOne-to-EnterpriseOne XAPI Events

This section provides an overview of the JD Edwards EnterpriseOne-to-EnterpriseOne XAPI events and discusses:

  • XAPI JD Edwards EnterpriseOne-to-EnterpriseOne process flow.

  • XAPI outbound request generation APIs.

  • XAPI outbound request handling APIs.

  • XAPI outbound request parsing API usage sample code.

  • XAPI JD Edwards EnterpriseOne originator XML sample code.

  • XAPI inbound response generation APIs.

  • XAPI inbound response parsing API usage sample code.

  • XAPI response from originator system sample code.

  • XAPI inbound response handling APIs.

  • XAPI error handling APIs.

  • XAPI JD Edwards EnterpriseOne-to-EnterpriseOne jde.ini file configuration.

C.6.1 Understanding JD Edwards EnterpriseOne-to-EnterpriseOne XAPI Events

The XAPI structure provides the capability for two different JD Edwards EnterpriseOne systems to communicate with each other. The first JD Edwards EnterpriseOne system (XAPI originator system) generates a XAPI request (event). Instead of the request being distributed to a third-party system, JDENET sends the request to a second JD Edwards EnterpriseOne system.

You can use the reliable event delivery feature to process XAPI events.

C.6.1.1 Modifying Element Name for XML Documents

Before XAPI event processing, any document that was sent from JD Edwards EnterpriseOne was considered to be a response document, and any document coming in to JD Edwards EnterpriseOne was considered to be a request document. However, with XAPI, request documents are generated by the JD Edwards EnterpriseOne originating system and can be sent to a JD Edwards EnterpriseOne executor system. Response documents are generated and sent by the JD Edwards EnterpriseOne executor system and received by the JD Edwards EnterpriseOne originating system. To support XAPI and to enable the XML dispatch kernel to distinguish between a response and reply, JD Edwards created these type attributes to be used with the jdeResponse element:

Attribute Type Explanation
jdeResponse=RealTimeEvent Use this element and attribute to identify a XAPI request from the JD Edwards EnterpriseOne originating system and sent to the JD Edwards EnterpriseOne executor system.
jdeResponse=xapicallmethod Use this element and attribute to identify a XAPI response from the JD Edwards EnterpriseOne executor system and sent to the JD Edwards EnterpriseOne originating system.

When the XMLDispatch kernel receives a document with the jdeResponse element and a RealTimeEvent or xapicallmethod type attribute, XMLDispatch sends the document to the XML Service kernel. XML Service can distinguish a response or a reply based on the type attribute that is associated with the jdeResponse element and then processes the document appropriately.

C.6.1.2 Security for Originator and Executor

Access to the JD Edwards EnterpriseOne originator and JD Edwards EnterpriseOne executor systems is based on:

  • User ID

  • Password

  • Environment

  • Role

The JD Edwards EnterpriseOne originating system verifies that the security information is valid and creates an hUser object with an encrypted password to send to the JD Edwards EnterpriseOne executor. Encryption APIs (jdeEnchyper and jdeDecypher) are used to encrypt and decode the password. The security information is sent in the XAPI request XML document.

Note:

The user ID, password, environment, and role must be the same on both JD Edwards EnterpriseOne systems (originator and executor).

C.6.1.3 Error Processing for Originator and Executor

You might encounter these two types of errors during XAPI error processing between two JD Edwards EnterpriseOne systems:

Type of Error Explanation
Business-related errors The business function or the business function specifications cannot be found.
System errors These errors occur in other parts of the system (for example, message delivery failure).

The system handles XAPI error processing for business-related errors in this manner:

  • XAPI logs the business-related errors in the JD Edwards EnterpriseOne server log and these errors are delivered as part of the XAPI reply.

  • XAPI APIs parse business errors from the response document.

  • XAPI logs all information available about the error in the JD Edwards EnterpriseOne server log.

C.6.2 XAPI EnterpriseOne-to-EnterpriseOne Process Flow

This illustration shows a logical representation of the JD Edwards EnterpriseOne-to-EnterpriseOne XAPI process flow:

Figure C-6 JD Edwards EnterpriseOne-to-EnterpriseOne process flow

Description of Figure C-6 follows
Description of "Figure C-6 JD Edwards EnterpriseOne-to-EnterpriseOne process flow"

In summary:

  1. For the XAPI Originator System in the illustration, a business function calls the Interoperability Event Interface within the CallObject kernel to send a request.

  2. The business function uses XAPI APIs to create the XAPI request.

    XAPI adds the callback function and sends the request to the events structure.

  3. The IEO kernel creates the XAPI event in XML format and sends the XML document to the EVN kernel.

    The EVN kernel ships the XML document to the XML Dispatch kernel of the second JD Edwards EnterpriseOne system. The XML document is shipped through JDENET using persistent subscription information. A routing token that contains the sender's server and port information is added. The message type for the event must be RealTimeEvent.

  4. For the XAPI Executor System in the illustration, the XML Dispatch kernel receives the XML package and sends the event request and routing information to the XML Service kernel.

  5. The XML Service kernel stores the XAPI request and creates a file handle for the XAPI request.

    The XML kernel also creates XML based routing information, stores the routing information, and creates a file handle for the routing information. The XML Service kernel uses the F907012 table to find the business function that processes the request.

  6. The XML Service kernel invokes the business function (in CallObject) with the XML request handle and the routing information handle.

  7. The business function uses XAPI APIs to parse and process the request. XAPI APIs load the XML request into memory.

  8. The business function processes the XAPI event request.

    The business function also creates a XAPI response. The message type for the response must be xapicallmethod. The XAPI response is in XML format. The business function also passes the routing information handle.

  9. The XAPI response originator sends the response and the routing information to the events structure.

  10. The IEO kernel formats the XAPI response in XML format and sends the XML document to the EVN kernel.

    The EVN kernel uses direct routing to send the response and routing information to the XML Dispatch kernel of the first JD Edwards EnterpriseOne system (XAPI originator system). Direct routing means sending the XAPI reply to the same request-originating server.

  11. For the XAPI Originator System in the illustration, the XML Dispatch kernel receives the response XML document and sends the response to the XML Service kernel.

  12. The XML Service kernel stores the response document, creates a file handle, and invokes the callback business function with the file handle.

  13. The business function parses the response document using XAPI APIs (XAPI response handler).

    XAPI APIs use the XML Service kernel to load the document into memory.

  14. The business function uses XAPI APIs (CallObject kernel) to process the response.

  15. The business function can poll for the XAPI response from the JD Edwards EnterpriseOne server.

Note:

You can send a request from one JD Edwards EnterpriseOne system to another JD Edwards EnterpriseOne system for processing with no return reply. If you do not want a response, use the steps through step 8 without processing the request. No response is generated.

C.6.3 XAPI Outbound Request Generation APIs

You use APIs to generate a XAPI request from the originator system. These APIs are the same as the APIs that are identified in the XAPI Outbound Events section.

  • jdeXAPI_SimpleSend

  • jdeXAPI_Init

  • jdeXAPI_Add

  • jdeXAPI_Finalize

  • jdeXAPI_Free

C.6.4 XAPI Outbound Request Handling APIs

The mapped business function uses these APIs in the JD Edwards EnterpriseOne executor system to retrieve XML data from the outbound XAPI request document:

  • jdeXMLRequest_GetDSCount

  • jdeXMLRequest_GetDSName

  • jdeXMLRequest_ParseDS

  • jdeXMLRequest_DeleteXML

  • jdeXMLRequest_ParseNextDSByName

  • jdeXMLRequest_PrepareDSListForIterationByName

C.6.5 XAPI Outbound Request Parsing API Usage Sample Code

This code example shows the API usage for generating a outbound request from the JD Edwards EnterpriseOne originator to the JD Edwards EnterpriseOne executor:

#include <jde.h>

#define b0000310_c


/*****************************************************************************
*    Source File:  b0000310
*
*    Description:  Company Real Time Notification Outbound Wrapper Source File
*
*****************************************************************************/

#include <b0000310.h>
#include <B4206030.h>
#include <B4206000.h>
/**************************************************************************
*  Business Function:  CompanyRealTimeWrapper
*
*        Description:  Company Real Time Notification Outbound Wrapper
*
*         Parameters:
*           LPBHVRCOM           lpBhvrCom    Business Function Communications
*           LPVOID              lpVoid       Void Parameter - DO NOT USE!
*           LPDSD0000310A        lpDS         Parameter Data Structure Pointer  
*
*************************************************************************/

 int iXMLRecordCount = 0;
 int iCurrentRecord = 0;
 NID nidDSName;
 ID idReturnValue = ER_SUCCESS;
 ID idSORecordCount = ER_ERROR; /*Return Code*/
 LPDSD4206000A lpDS;
 int lpmnJobNumber;

 MATH_NUMERIC mnBatchNumber = {0};
 unsigned long lBatchNumber = {0};
 DSD4206030A dsD4206030A = {0};
 /* CacheProcessInboundDemandRequest B4206030.c */
 DSD4206000I dsD4206000I = {0};
 /* Demand scheduling inbound DSTR */
 iXMLRecordCount = jdeXMLRequest_GetDSCount(lpDS->szXMLHandle);
 if( iXMLRecordCount > 0)
 {
  for ( iCurrentRecord = 0; iCurrentRecord < iXMLRecordCount; iCurrentRecord++)
  {
   memset((void *)(&dsD4206000I), (int)(_J('\0')), sizeof(DSD4206000I));
   memset((void *)(nidDSName), (int)(_J('\0')), sizeof(NID));
   if(jdeXMLRequest_GetDSName(lpDS->szXMLHandle,iCurrentRecord,nidDSName))
   {
    /* Retrieving data*/
    if (jdeStricmp(nidDSName, (const JCHAR *)_J("D40R0180B")) == 0)
    {
     if (jdeXMLRequest_ParseDS(lpDS->szXMLHandle,iCurrentRecord,
&dsD4206000I,sizeof(DSD4206000I)))
     {
      /* Get next number for the batch number of the inbound INVRPT 
record*/
      if ( dsD4206000I.cInventoryAdvisement == _J('1'))
      {
       lBatchNumber = JDB_GetInternalNextNumber();
       LongToMathNumeric(lBatchNumber, &mnBatchNumber);
       FormatMathNumeric(dsD4206000I.szBatch,&mnBatchNumber);
      }
      /* Setup cancel flag for pending delete record */
      if ( dsD4206000I.cPendingDelete == _J('1'))
      {
       /* Flag set as 1 for any cancel demand record */
       dsD4206000I.cCancelFlag = _J('1');
      }
      else
      { /* Flag set as 9 for any non cancel demand record */
       dsD4206000I.cCancelFlag = _J('9');
      }
      /* Load parms for cache */
      //memset((void *)(&dsD4206030A), (int)(_J('\0')), 
sizeof(DSD4206030A));
      I4206000_LoadParmsToCache(&dsD4206000I, &dsD4206030A);
      MathCopy(&dsD4206030A.mnJobnumberA, lpmnJobNumber);
      /* Add the DSTR to cache */
      idReturnValue = jdeCallObject( _J("CacheProcessInboundDemand
Request") ,(LPFNBHVR)NULL ,lpBhvrCom ,lpVoid ,(LPVOID)&dsD4206030A,(CALLMAP *)
NULL, (int)0,(JCHAR*)NULL ,(JCHAR*)NULL ,(int)0 );
      /* Write XML DSTR to cache fail */
      if (idReturnValue == ER_ERROR)
      {
       jdeErrorSet(lpBhvrCom, lpVoid, (ID)0, _J("032E"), (LPVOID)NULL);
      }
     }
     else
     { /* warning XML parse fail */
      jdeErrorSet(lpBhvrCom, lpVoid, (ID)0, _J("40R46"), (LPVOID) NULL);
     }
    } /* end if */
   }/* end if DS name */
  }/* end for - looping all matching XML DSTR */
  /* Ensure there is at least one record */
  idSORecordCount = ER_SUCCESS;
 }/*if( iXMLRecordCount > 0) */
 return idSORecordCount;

C.6.6 XAPI EnterpriseOne Originator XML Sample Code

This sample code illustrates the XAPI request document from the JD Edwards EnterpriseOne originator system to the JD Edwards EnterpriseOne executor system:

<?xml version="1.0" encoding="UTF-16F" ?>
<jdeRequest pwd="4f3e65076f446c5d20666f4172536518435c" role="*ALL" 
type="xapicallmethod" user="PP6954083" session="" environment="DV9NIS2" 
responseCreator="XAPI">
   <header>
      <eventVersion>1.0</eventVersion>
       <type>XAPIDEMO</type>
       <user>PP6954083</user>
       <role>*ALL</role>
       <application />
       <version />
       <sessionID>35087181.1050101193</sessionID>
       <environment>DV9NIS2</environment>
       <host>DEN-PP6954083B</host>
       <sequenceID>DEN-PP6954083B_3112_041120031647161</sequenceID>
       <date>04112003</date>
       <time>164716</time>
       <scope />
       <codepage>utf-8</codepage>
       <instanceInfo>
          <host>DEN-PP6954083B</host>
          <port>6025</port>
          <type>JDENET</type>
       </instanceInfo>
   </header>
   <body elementCount="3">
      <errors errorCount="4">
         <error code="041H" type="BSFN ERROR" />
         <error code="041I" type="BSFN ERROR" />
         <error code="2597" type="BSFN ERROR" />
         <error code="4136" type="BSFN ERROR" />
      </errors>
      <params type="D907001A" executionOrder="0" parameterCount="14">
         <param name="szXMLHandle">DEN-PP6954083B_||_C:\builds\B9_SP0\log\
J3E9745EE032D-00000C28-00000001-00000000000000000000FFFF0A0396A3.xml</param>
         <param name="mnAddressNumber">55617</param>
         <param name="szNameAlpha">Pradip Pandey</param>
         <param name="szNameMailing">Pradip K Pandey</param>
         <param name="szAddressLine1" />
         <param name="szAddressLine2" />
         <param name="szZipCodePostal">80237</param>
         <param name="szCity>Denver"</param>
         <param name="szState">CO</param>
         <param name="szCountry" />
         <param name="mnAmountGross">100.00</param>
         <param name="mnUnits">100.00</param>
         <param name="jdDtForGLAndVouch1">2001/01/01</param>
         <param name="cDefaultAddressLine1">9</param>
      </params>
      <params type="DXAPIROUTE" executionOrder="1" parameterCount="4">
         <param name="ClientPort">6024</param>
         <param name="ClientIP">168007331</param>
         <param name="ClientMagicNumber">1</param>
         <param name="XAPIMethodID">XAPITestResponse</param>
      </params>
   </body>
</jdeRequest>

C.6.7 XAPI Inbound Response Generation APIs

The JD Edwards EnterpriseOne executor system uses these APIs to generate a response:

  • jdeXAPIResponse_SimpleSend

  • jdeXAPIResponse_Init

  • jdeXAPIResponse_Add

  • jdeXAPIResponse_Finalize

  • jdeXAPIResponse_Free

C.6.8 XAPI Inbound Response Parsing API Usage Sample Code

This code example shows the API usage for generating an inbound reply from the JD Edwards EnterpriseOne executor to the JD Edwards EnterpriseOne originator:

JDEBFRTN (ID) JDEBFWINAPI SendOrderPromiseRequest (LPBHVRCOM lpBhvrCom, 
LPVOID lpVoid, LPDSD4205010 lpDS)
{
/****************************************************************
Variable declarations
****************************************************************/
  char    cPromisableLine          = ' ';
  int    nHeaderBackOrderAllowed   = ' ';
  HUSER   hUser    ;
  ID     JDEDBResult               = JDEDB_PASSED;
  BOOL    bExit                    = FALSE;   
  BOOL    bB4001040Called          = FALSE;
  BOOL    bXAPIInUse               = FALSE;
  BOOL    bAtLeastOneDetail        = FALSE;
  
  #ifdef jdeXAPI_CALLS_ENABLED
  XAPI_CALL_ID     ulXAPICallID   = 0;
  XAPI_CALL_RETURN   eXAPICallReturn  = eEventCallSuccess;
  #endif
/****************************************************************
* Declare structures
****************************************************************/
  DSD4001040   dsD4001040     = {0};
  DSD4205020   dsD4205020     = {0};
  DSD4205040   dsD4205040     = {0}; /* Header Info */
  DSD4205050   dsD4205050     = {0}; /* Detail Info */
  DSD4205010A   dsD4205010A   = {0}; /* Query Header */
  DSD4205010B   dsD4205010B   = {0} /* Query Detail */
  DSD0100042   dsD0100042     = {0};
  LPDSD4205040H  lpDSD4205040H    = (LPDSD4205040H) NULL;
  LPDSD4205050D  lpDSD4205050D    = (LPDSD4205050D) NULL;
  
/****************************************************************
** Declare pointers
****************************************************************/
/****************************************************************
* Check for NULL pointers
****************************************************************/
if ((lpBhvrCom == (LPBHVRCOM) NULL) ||
 (lpVoid  == (LPVOID)  NULL) ||
 (lpDS   == (LPDSD4205010) NULL))
{
jdeErrorSet (lpBhvrCom, lpVoid, (ID) 0, "4363", (LPVOID) NULL);
return ER_ERROR;
}

/* Retrieving hUser */
JDEDBResult = JDB_InitBhvr (lpBhvrCom, &hUser, (char *)NULL, 
JDEDB_COMMIT_AUTO ) ;

if ( JDEDBResult == JDEDB_FAILED )
{
jdeSetGBRError ( lpBhvrCom, lpVoid, (ID) 0, "4363" ) ;
return ER_ERROR ;
}
/****************************************************************
* Set pointers
****************************************************************/
/****************************************************************
* Main Processing
****************************************************************/
 /*-----------------------------------------------------*/
 /* Setting Up ErrorCode
      */
 lpDS->cErrorCode = '0';

 /*-----------------------------------------------------*/
 /* Determining if XAPI is ready to be used        */ 
               
 bXAPIInUse = FALSE;          
    
 #ifdef jdeXAPI_CALLS_ENABLED
 if(jdeXAPI_IsCallTypeEnabled("XAPIOPOUT") &&
     jdeXAPI_IsCallTypeEnabled("XAPIOPIN") )
 {          
     bXAPIInUse = TRUE;
 }
 #endif

 /*-----------------------------------------------------*/
 /* Data validation and default values.           */
 /* When Display Before Accept Mode is on, validate Key */
 /* Information. Otherwise retrieve it from Header Record*/

 if((lpDS->cDisplayBeforeAcceptMode == '1')   &&
      ((MathZeroTest(&lpDS->mnOrderNumber) == 0) ||
       (IsStringBlank(lpDS->szOrderType))   ||
       (IsStringBlank(lpDS->szOrderCompany))))
 {  
      bExit = TRUE;
 }
 else
 {
     MathCopy(&dsD4205040.mnOrderNumber,&lpDS->mnOrderNumber);
     strncpy(dsD4205040.szOrderType,
       lpDS->szOrderType,
        sizeof(dsD4205040.szOrderType));
     strncpy(dsD4205040.szComputerID,
       lpDS->szOrderCompany,
        sizeof(dsD4205040.szOrderCompany));
     dsD4205040.cUseCacheOrWF = lpDS->cUseCacheOrWF;
     strncpy(dsD4205040.szComputerID,
       lpDS->szComputerID,
        sizeof(dsD4205040.szComputerID));
     MathCopy(&dsD4205040.mnJobNumber,&lpDS->mnJobNumber);
     jdeCallObject( "GetSalesOrderHeaderRecord",
          NULL,
          lpBhvrCom, lpVoid,
          (LPVOID)&dsD4205040,
          (CALLMAP *) NULL,
          (int) 0,
          (char *) NULL,
          (char *) NULL,
          (int) 0 ) ;

     lpDSD4205040H = (LPDSD4205040H)jdeRemoveDataPtr(hUser,
(ulong)dsD4205040.idHeaderRecord);

     if (lpDSD4205040H == NULL)
     {
          bExit = TRUE;
     }
 }

 /*-----------------------------------------------------*/
 /* Set error if we're exiting at this point      */  
 if (bExit == TRUE)
 {
     lpDS->cErrorCode = '1';
     /* Sales Order Header Not Found */
     strncpy(lpDS->szErrorMessageID,
        "072T",
          sizeof(lpDS->szErrorMessageID));
     if (lpDS->cSuppressError != '1')
     {
        jdeErrorSet (lpBhvrCom, lpVoid, (ID) 0, "072T", (LPVOID) NULL);
     }
 }

 /*-----------------------------------------------------*/
 /* Default Promising Flag is always 1      */
 lpDS->cDefaultPromisingFlags = 1;
 if (bExit == FALSE)
 {

  /*-----------------------------------------------------*/
  /* Call XAPIInit   */
  #ifdef jdeXAPI_CALLS_ENABLED
  if(bXAPIInUse == TRUE)
  {
     ulXAPICallID = jdeXAPI_Init( lpBhvrCom,
                   SendOrderPromiseRequest,
                "XAPIOPOUT",
                NULL,
                &eXAPICallReturn);
     if (eXAPICallReturn != eEventCallSuccess)
     {
          bExit = TRUE;
     }
  }
  #endif
  if (bExit == FALSE)
  {

     /*------------------------------------------------*/
     /* Loading Header Information           */
     I4205010_PopulateQueryHeader(lpDS,&dsD4205010A
       lpDSD4205040H,&dsD0100042,hUser,lpVoid,lpBhvrCom);
     nHeaderBackOrderAllowed = dsD4205010A.nAllowBackorders;

     /*-------------------------------------------------*/
     /* Adding Header Information     */
     #ifdef jdeXAPI_CALLS_ENABLED
     if(bXAPIInUse == TRUE)
     {
        eXAPICallReturn = jdeXAPI_Add( lpBhvrCom,
                   ulXAPICallID,
                   "SendOrderPromiseRequest",
                   "D4205010A",
                   &dsD4205010A,
                   sizeof(DSD4205010A));
        if (eXAPICallReturn != eEventCallSuccess)
        {
           bExit = TRUE;
        }
     }
     #endif
  }
 }
 if (bExit == FALSE)
 {

  /*-----------------------------------------------------*/
  /* Loading Detail Information   */ 
  MathCopy(&dsD4205050.mnOrderNumber,&lpDS->mnOrderNumber);
  strncpy(dsD4205050.szOrderType,lpDS->szOrderType,
              sizeof(dsD4205050.szOrderType));
  strncpy(dsD4205050.szOrderCompany,lpDS->szOrderCompany,
              sizeof(dsD4205050.szOrderCompany));
  dsD4205050.cUseCacheOrWF = lpDS->cUseCacheOrWF;
  strncpy(dsD4205050.szComputerID,lpDS->szComputerID,
              sizeof(dsD4205050.szComputerID));
  MathCopy(&dsD4205050.mnJobNumber,&lpDS->mnJobNumber);
  if (lpDSD4205040H->cActionCode != 'A')
  {
     dsD4205050.cCheckTableAfterCache = '1';
  }
  else
  {
     dsD4205050.cCheckTableAfterCache = '0';
  }
  jdeCallObject( "GetSalesOrderDetailRecordOP",
     NULL,
     lpBhvrCom, lpVoid,
     (LPVOID)&dsD4205050,
     (CALLMAP *) NULL,
     (int) 0, (char *) NULL,
     (char *) NULL, (int) 0 ) ;

  if (dsD4205050.cRecordFound != '1')
  {
     bExit = TRUE;
     lpDS->cErrorCode = '1';
     /* Sales Order Detail Not Found */
     strncpy(lpDS->szErrorMessageID,"4162",
              sizeof(lpDS->szErrorMessageID));
     if (lpDS->cSuppressError != '1')
     {
        jdeErrorSet (lpBhvrCom, lpVoid, (ID) 0, "4162", (LPVOID) NULL);
     }
  }
  while ((dsD4205050.cRecordFound == '1') && (bExit == FALSE))
  {
     lpDSD4205050D = (LPDSD4205050D)jdeRemoveDataPtr( hUser, 
(ulong)dsD4205050.idDetailRecord);
     /* Reset flags */
     cPromisableLine = '0';     
     bB4001040Called = FALSE;

     /*-------------------------------------------------*/
     /* Evaluate the Record from F4211 (cDataSource = 2)*/   
     /*  to find out if we should promise the line */
     /*  else find out from Order Promising Detail.*/

     if(dsD4205050.cDataSource == '1')
     {
        if (lpDSD4205050D->cOPPromiseLineYN == 'Y')
        {
           cPromisableLine = '1';
        }
     }
     else if(dsD4205050.cDataSource == '2')
     {     
        MathCopy ( &dsD4001040.mnShortItemNumber,
             &lpDSD4205050D->mnShortItemNumber);
        strncpy ( dsD4001040.szBranchPlant,
           lpDSD4205050D->szBusinessUnit,
              sizeof(dsD4001040.szBranchPlant));
                
        jdeCallObject  ( "GetItemMasterDescUOM",
                 NULL,
                 lpBhvrCom, lpVoid,
                  (LPVOID)&dsD4001040,
                  (CALLMAP *) NULL,
                  (int) 0, (char *) NULL,
                  (char *) NULL, (int) 0 ) ;
       
        bB4001040Called = TRUE;
       
        cPromisableLine = I4205010_IsLinePromisable(lpBhvrCom,lpVoid,
                   hUser,lpDS,lpDSD4205050D, dsD4001040.cStockingType);
     }
     if (cPromisableLine == '1')
     {

       /* Set this flag if at least one promisable */
       /*   detail record exists. */
       bAtLeastOneDetail = TRUE;

       if (bB4001040Called == FALSE)
       {
         MathCopy (&dsD4001040.mnShortItemNumber,
              &lpDSD4205050D->mnShortItemNumber);
         strncpy ( dsD4001040.szBranchPlant,
              lpDSD4205050D->szBusinessUnit,
              sizeof(dsD4001040.szBranchPlant));
                
       jdeCallObject  ( "GetItemMasterDescUOM",
                NULL,
                lpBhvrCom, lpVoid,
                (LPVOID)&dsD4001040,
                (CALLMAP *) NULL,
                (int) 0, (char *) NULL,
                (char *) NULL, (int) 0 ) ;
       }

       I4205010_PopulateQueryDetail( lpDS,&dsD4205010B,
                   lpDSD4205050D,
                &dsD4001040,
                &dsD4205010A,
                   &dsD0100042,
                cPromisableLine,
                   hUser,
                   lpVoid,
                lpBhvrCom);

       #ifdef jdeXAPI_CALLS_ENABLED
       if(bXAPIInUse == TRUE)
       {
         eXAPICallReturn = jdeXAPI_Add( lpBhvrCom,
                   ulXAPICallID,
                   "SendOrderPromiseRequest",
                   "D4205010B",
                   &dsD4205010B,
                   sizeof(DSD4205010B));
         if (eXAPICallReturn != eEventCallSuccess)
         {
              bExit = TRUE;
         } 
       }
       #endif
     }
   
     /*-------------------------------------------------*/
     /* Fetching the next Detail Record         */
     MathCopy(&dsD4205050.mnOrderNumber,&lpDS->mnOrderNumber);
     strncpy(dsD4205050.szOrderType,lpDS->szOrderType,
               sizeof(dsD4205050.szOrderType));
     strncpy(dsD4205050.szOrderCompany,lpDS->szOrderCompany,
              sizeof(dsD4205050.szOrderCompany));
     dsD4205050.cUseCacheOrWF = lpDS->cUseCacheOrWF;
     strncpy(dsD4205050.szComputerID,lpDS->szComputerID,
              sizeof(dsD4205050.szComputerID));
     MathCopy(&dsD4205050.mnJobNumber,&lpDS->mnJobNumber);
     if (lpDSD4205040H->cActionCode != 'A')
     {
        dsD4205050.cCheckTableAfterCache = '1';
        }
        else
        {
            dsD4205050.cCheckTableAfterCache = '0';
        }
        jdeCallObject( "GetSalesOrderDetailRecordOP",
                NULL,
                lpBhvrCom, lpVoid,
                (LPVOID)&dsD4205050,
                (CALLMAP *) NULL,
                (int) 0, (char *) NULL,
                (char *) NULL, (int) 0 ) ;
     }
     if (!bAtLeastOneDetail)
     {
        bExit = TRUE;
        lpDS->cErrorCode = '1';
        /* Sales Order Detail Not Found */
        strncpy(lpDS->szErrorMessageID,"4162",
                sizeof(lpDS->szErrorMessageID));
        if (lpDS->cSuppressError != '1')
        {
           jdeErrorSet (lpBhvrCom, lpVoid, (ID) 0, "4162", (LPVOID) NULL);
        }
     }
     if (bExit == FALSE)
     {
        #ifdef jdeXAPI_CALLS_ENABLED
        if(bXAPIInUse == TRUE)
        {
           eXAPICallReturn = jdeXAPI_Finalize( lpBhvrCom,
                   ulXAPICallID,
                   "SendOrderPromiseRequest",
                   "OrderPromiseCallback)";
           if (eXAPICallReturn != eEventCallSuccess)
           {
              bExit = TRUE;
           }
        }
        #endif
     }

     /*-------------------------------------------------*/
     /* Call B4205020 in Add Mode   */     
     if((bExit == FALSE) &&
         (lpDS->cDisplayBeforeAcceptMode != '1') &&
         (lpDS->cUseCacheOrWF == '2'))
     {
         MathCopy(&dsD4205020.mnOrderNumber,&lpDS->mnOrderNumber);
         strncpy(dsD4205020.szOrderType,lpDS->szOrderType,
              sizeof(dsD4205020.szOrderType));
         strncpy(dsD4205020.szOrderCompany,lpDS->szOrderCompany,
              sizeof(dsD4205020.szOrderCompany));
        strncpy(dsD4205020.szComputerID,lpDS->szComputerID,
              sizeof(dsD4205020.szComputerID));
        MathCopy(&dsD4205020.mnJobNumber,&lpDS->mnJobNumber);
    
        jdeCallObject( MaintainOPWorkFile,
            NULL,
            lpBhvrCom, lpVoid,
            (LPVOID)&dsD4205020,
            (CALLMAP *) NULL,
            (int) 0, (char *) NULL,
            (char *) NULL, (int) 0 ) ;
     }
  }

/***************************************************************
Function Clean Up
****************************************************************/
  #ifdef jdeXAPI_CALLS_ENABLED
  if (eXAPICallReturn != eEventCallSuccess)
  {
   /*-----------------------------------------------------*/
   /* CleanUp */
   if(bXAPIInUse == TRUE)
   {   
    jdeXAPI_Free( lpBhvrCom,
        ulXAPICallID,
        "SendOrderPromiseRequest");
   }

   lpDS->cErrorCode = '1';
   /* System Error - no reasonable error messages exist. */
   strncpy(lpDS->szErrorMessageID,"018Y",
                sizeof(lpDS->szErrorMessageID));
   if (lpDS->cSuppressError != '1')
   {
       jdeErrorSet (lpBhvrCom, lpVoid, (ID) 0, "018Y", (LPVOID) NULL);
   }
  }
  #endif
  if(lpDSD4205040H != (LPDSD4205040H)NULL)
  {
     jdeFree((void *)lpDSD4205040H);
  }
  if(lpDSD4205050D != (LPDSD4205050D)NULL)
  {
     jdeFree((void *)lpDSD4205050D);
  }
 return (ER_SUCCESS);
}

C.6.9 XAPI Inbound Response from Originator System Sample Code

The sample code illustrates the XAPI response document from the JD Edwards EnterpriseOne executor system to the JD Edwards EnterpriseOne originator system:

<?xml version="1.0" encoding="UTF-16" ?>
<jdeResponse pwd="4f3e65076f446c5d20666f4172536518435c" role="*ALL" 
type="realTimeEvent" user="PP6954083" session="35087181.1050101193" 
environment="DV9NIS2" responseCreator="XAPI">
   <event>
      <header>
         <eventVersion>1.0</eventVersion>
         <type>XAPIDEMO</type>
         <user>PP6954083</user>
         <role>*ALL</role>
         <application>P90701XT</application>
         <version />
         <sessionID>35087181.1050101193</sessionID>
         <environment>DV9NIS2</environment>
         <host>DEN-PP6954083B</host>
         <sequenceID>DEN-PP6954083B_2864_041120031636402</sequenceID>
         <date>04112003</date>
         <time>164646</time>
         <scope />
         <codepage>utf-8</codepage>
         <instanceInfo>
            <host>DEN-PP6954083B</host>
            <port>6025</port>
            <type>JDENET</type>
         </instanceInfo>
      </header>
      <body elementCount="2">
         <detail date="04112003" name="XAPITestFunctionInitiateRequest" 
time="16:39:54" type="" DSTMPL="D907001A" executionOrder="0" 
parameterCount="14">
         <szXMLHandle type="String" />
         <szNameAlpha type="String">Pradip Pandey</szNameAlpha>
         <szNameMailing type="String">Pradip K Pandey</szNameMailing>
         <szAddressLine1 type="String" />
         <szAddressLine2 type="String" />
         <szZipCodePostal type="String">80237</szZipCodePostal>
         <szCity type="String">Denver</szCity>
         <szState type="String">CO</szState>
         <szCountry type="String" />
         <mnAmountGross type="Double">100.00</mnAmountGross>
         <mnUnits type="Double">100.00</mnUnits>
         <jdDtForGLAndVouch1 type="Date">2001/01/01</jdDtForGLAndVouch1>
         <cDefaultAddressLine1 type="Character" />
      </detail>
      <detail date="04112003" name="XAPITestFunctionInitiateRequest" 
time="16:39:54" type="" DSTMPL="DXAPIROUTE" executionOrder="1" 
parameterCount="4">
         <ClientPort type="Int">6024</ClientPort>
         <ClientIP type="Int">168007331</ClientIP>
         <ClientMagicNumber type="Int">1</ClientMagicNumber>
         <XAPIMethodID type="String">XAPITestResponse</XAPIMethodID>
      </detail>
   </body>
  </event>
</jdeResponse>

C.6.10 XAPI Inbound Response Handling APIs

The JD Edwards EnterpriseOne originator system uses these APIs to retrieve XML data from the inbound XAPI document and generate an inbound XAPI response:

  • jdeXML_GetDSCount

  • jdeXML_GetDSName

  • jdeXML_ParseDS

  • jdeXML_DeleteXML

  • jdeXML_ParseNextDSByName

  • jdeXML_PrepareDSListForIterationByName

C.6.11 XAPI Error Handling APIs

The JD Edwards EnterpriseOne executor system uses these error handling APIs:

  • jdeXML_CheckSystemError

    The check system error API is for system errors. It tells the JD Edwards EnterpriseOne originator system that a system error happened in the JD Edwards EnterpriseOne executor system.

  • jdeXML_GetErrorCount

  • jdeXML_SetErrors

    The get error count and set errors APIs are for business errors. These two APIs, when used together, find the number of business errors and then send the errors to the BHVRCOM structure for you to resolve.

C.6.12 XAPI EnterpriseOne-to-EnterpriseOne jde.ini File Configuration

To generate XAPI events, these sections of the JD Edwards EnterpriseOne server jde.ini file must be configured:

  • [JDENET_KERNEL_DEF19]

  • [JDENET_KERNEL_DEF20]

  • [JDENET_KERNEL_DEF22]

  • [JDENET_KERNEL_DEF24]

  • [JDEITDRV]

  • [XAPI] - XMLDirectory setting

  • [XMLLookupInfo]

  • [INTEROPERABILITY] - LEVEL setting

C.6.12.1 [XAPI]

Configure this setting:

XMLDirectory=c:\builds\bdev\log\

C.6.12.2 [XMLLookupInfo]

Configure these settings:

XMLRequestType5=XAPICallMethod
XMLKernelMessageRange5=14251
XMLKernelHostName5=local
XMLKernelPort5=0
XMLKernelReply5=0
XMLRequestType6=realTimeEvent
XMLKernelMessageRange6=14251
XMLKernelHostName6=local
XMLKernelPort6=0
XMLKernelReply6=0

C.6.12.3 [INTEROPERABILITY]

Configure this setting:

LEVEL=DOC

Note:

The LEVEL setting is for logging the Event XML document in the JD Edwards EnterpriseOne server for debugging purposes.

Setting the LEVEL=DOC key causes all real-time events to be written to the disk, which can cause a significant performance impact on the host server. JD Edwards suggests that you not use the LEVEL=DOC setting in a production environment or for stress testing of the QA environment.

If you are using a JD Edwards EnterpriseOne client to generate XAPI events, you must define the Client Dispatch kernel and [JDENET] sections of the client jde.ini file.

C.7 Mapping the Business Function

This section provides an overview about mapping business functions and APIs for JD Edwards EnterpriseOne-to-EnterpriseOne XAPI events, and discusses how to enter the mapping information.

C.7.1 Understanding Business Function Mapping

When the JD Edwards EnterpriseOne executor system receives an event from the JD Edwards EnterpriseOne originator, it needs to know what business function or system API to invoke to process the request. You must map the business function or system API to the XAPI event name. You map business functions and system APIs in the F907012 table. You use the Event Request Definition program (P907012) to map business functions and APIs.

If you are mapping business functions, you enter the name of the business function. If you map APIs, you must enter the name of the API and the library where it is defined. In addition, the signature of the API must be made common, similar to the business function.

Mapping business functions enables you to point a XAPI event to a business function or system API that you wrote. You do not need to modify source code of a business function that JD Edwards delivered to you.

C.7.2 Forms Used to Map a Business Function or API

Form Name FormID Navigation Usage
Work With Definition W907012A Enter P907012 in the Fast Path Command Line. Locate and review existing mappings.
Request Definition W907012B On Work With Definition, click Add. Add or change business function or API mapping for a XAPI event.

C.7.3 Mapping a business function or API

Access the Request Definition form.

Figure C-7 Request Definition form

Description of Figure C-7 follows
Description of "Figure C-7 Request Definition form"

Event Name

The name of the event (for example, JDERTSOOUT). Single events are part of other events.

BSFN Definition

An option that specifies the type of processing for an event.

API Definition

An option that specifies the type of processing for an event.

When you select the API definition option, the DLL Name field appears on the form.

Function Name

The actual name of the function. It must follow standard ANSI C naming conventions (for example, no space between words).

DLL Name

Specifies the name of the database driver file. This file is specified in the [DB SYSTEM SETTINGS] section of the enterprise server jde.ini file. The file that you specify depends upon the platform and the database. Values for specific machines and databases are:

DBDR: IBM i to DB2 for IBM i

JDBNET: IBM i to any other server DBMS

ibjdbnet.sl: HP9000 to DB2 for IBM i

libjdbnet.sl: HP9000 to Microsoft SQL Server

libora80.sl: HP9000 to Oracle (Version 8.0) UNIX

libjdbnet.so: RS6000 to DB2 for IBM i

libjdbnet.so: RS6000 to Microsoft SQL Server

libora73.so: RS6000 to Oracle (Version 7.3) UNIX

libora80.so: RS6000 to Oracle (Version 8.0) UNIX

jdbodbc.dll: Intel to IBM i

jdboci32.dll: Intel to Oracle (Version 7.2) NT

jdboci73.dll: Intel to Oracle (Version 7.3) NT

jdboci80.dll: Intel to Oracle (Version 8.0) NT

dbodbc.dll: Intel to SQL Server NT

jdbnet.dll: Digital Alpha to IBM i

jdboci32.dll: Digital Alpha to Oracle (Version 7.2) NT

jdboci73.dll: Digital Alpha to Oracle (Version 7.3) NT

jdboci80.dll: Digital Alpha to Oracle (Version 8.0) NT

dbodbc.dll: Digital Alpha to SQL Server NT