Monday, April 27, 2020

#763 OIC - B2B - EDI Translation support

Another compelling new feature for OIC - EDI X12 support.

For those who never heard of X12 - think of it as a set of standard docs allowing companys to do business with each other, e.g. Company A sends an X12 850(Purchase Order) to Company B.

























You can see the full list of X12 docs here

So nothing like a simple example to illustrate our X12 support -
Let's begin with an Inbound X12 example -

In this case, I receive a PO in EDI 850 format. I need to process this and post it to Netsuite, for example.

Processing X12 PO in OIC


Here is my X12 850 input -


So what does the above mean?


ISA - Interchange Control Header
GS - Functional Group Header
ST - Transaction Set Header
BEG - Beginning Segment for Purchase Order
CUR - Currency
REF - Reference Information
FOB - The acronym FOB, which stands for "Free On Board" or "Freight On Board," is a shipping term used in retail to indicate who is responsible for paying transportation charges. It is the location where ownership of the merchandise transfers from seller to buyer.
The value PC stands for - pre-paid but charged to customer.
ITD - Terms of Sale
DTM - Date/Time Reference
TD5 - Carrier Details
N1 - Party Identification - BT represents the Buying Party
N2 - Additional Name information
N3 -Party Location 
N4 - Party geographic location
PER - Administrative Communications Contact
PO1 - Item data 
PID - Item Description
CTT - Transaction Totals

and so on...


So what do I mean by EDI Translation? Essentially translating the incoming EDI doc into a format OIC can process. As you know, OIC using XML under the hood, all mappings are XSLT. So the newly available EDI Translate action creates an XML representation of the EDI 850 doc.




















So here in the simple example integration -

























The Trigger - Receive-EDI - is a REST Trigger.
Configuration as follows -

























EDI-Translate is configured as follows -


























Document Version is set to 4010 - this refers to EDI Version 4 Release 1

Naturally, other versions are supported -

























Document Definition defaults to Standard

EDI Character Encoding - here I select UTF8.
Other options include -

























Now to the final Mapping - Map to Receive-EDI -

Check out the XML representation of the EDI doc -


























Great stuff!
All I need to do now is map this to my Netsuite PO, but I'll spare you the steps these;
after all, we are focusing on EDI here.

Now to Outbound - here I have a PO that I need to put into EDI 850 format.

Creating an X12 PO in OIC

Stating point is my order.xsd -


created in that tool of tools - JDeveloper.

I then create an XML doc, based on the xsd -

























Now to the OIC Integration - use case is I read in the above xml order and then create an EDI order, based on it.

So I use a REST trigger with XML based payload.
The Response is also XML based -
































Now I add the new EDI-Translate action -




















and configure as follows -

























Now to the Mapping -

The first fields I set are in the interchange-ctrl section -

























Here I specify sender / receiver e.g. customer / supplier.

e.g. sender-id is set to Hare of the Dog Inc.
receiver-id is set to Commiskey Inc.

Nw to the next section - group -










e.g. app-senders-code is set to Hare of the Dog Inc.
app-receivers-code is set to Commiskey Inc.


That's the Headers taken care of, now to the Transaction data -














BEG01 - Transaction Set Purpose Code set to 00

00 = original PO, 01 = cancellation
Here is a list of valid codes

BEG02 - Purchase Order Type Code set to NE
NE= New Order
Here is a list of valid codes

BEG03 - Purchase Order Nr is set to the source PO Nr.

The above 3 fields are mandatory.

I set BEG05 to today's date in the format CCYYMMDD - 20200403.

Now to the mapping of the line items to Baseline Item Data -




















Now to CTT-Transaction Totals

















CTT01 - set to count(lineItems)
CTT02 Hash Total set to totalAmount

Now to mapping the integration response -





















Excellent!

Now all I need to do is Activate and Test.

I test with the order xml shown earlier -

My response in Postman is as follows -









I love errors, the only way to learn, in this case EDI.

ISA05 max 2 characters.
I google and see that ZZ - Mutually defined is a valid value.

I correct and re-test




















Alles Gut!

Finally, a more realistic Use Case... thanks to my colleague Michael M.

B2B Use Case

Company A sends a PO (X12 850) to its supplier, Company B.

Company B responds with a Functional Acknowledgement (X12 997).
The functional ack confirms delivery of the PO and can report any errors etc.

Company B does the business and then sends an Invoice to Company A.
This leverages the X12 810 format.

Company B sends an Advance Ship Notice (X12 856) to Company A.
This describes shipment and packing.

The above can be easily implemented now in OIC.

Documentation is available here
















Tuesday, April 21, 2020

#762 Creating net new apps on top of Netsuite with OIC Visual Builder

I am probably speaking to the converted here, but for all  those still not aware of the rich functionality OIC provides -

OIC is a toolbox containing a set of tools -

1. Integration - to connect apps

2. Process - to extend apps or simply to implement your own custom business workflows

3. Visual Builder - to create net new apps on top of your apis

4. Insight (due soon) - to provide business user dashboards on top of your integrations and processes, e.g. giving HCM professionals insight into an onboarding process - how long it takes, where are the bottlenecks etc.

Today we look at Visual Builder in respect of Netsuite -

For those new to VB, just click here for my posts on what it is and how you use it.

The scenario today is very simple - allow salespeople to update customer contact data outside of Netsuite, either thru a simple web or mobile app.
















User enters customer name - clicks Search.
This triggers an integration to retrieve the customer contact data.
Contact data is displayed and can be updated.
Click Update Netsuite to trigger an integration to do what the button says!

The first integration has been stripped down - no handling of customer not found etc.


























I use the Netsuite adapter - Search functionality.
Mire details on that in this blog post.

The second integration does the contact update -

























Again, the integration is stripped down - no error handling etc.

So, equipped with these 2 REST apis, I can start on the Visual Builder app.

First thing I do in VB is create a new app -












I open the app settings and ensure I can connect to the Integration engine.

















Note, I can also enable transparent access to my Fusion apps apis as well.

Now I open the NetsuiteVBDemo app and create a Service connection to OIC - Integration, enabling me to use the 2 REST based apis.














Now to the UI -


















Ok, it is very basic - I am not a visually creative, but do appreciate art, especially early 20th century Constructivist art.


















Net, net - I built the UI, leveraging the components from the palette.

I also added page variables - these to be used for storing the values from Netsuite.

























I bind these variables to my UI text controls e.g.















So what happens when the user clicks the Search button?














An Action Chain is executed - Visual Builder makes it very easy to design such.
Essentially all I want to do is call the GetNetsuiteCustomer api.

















Note the "success" flow step - Assign Variables.
Here I assign the return payload from Netsuite to the page variables I defined earlier.
















Same modus operandi for the Update Netsuite button functionality -























Assignment as follows -

















Now to a simple test -

Here is my customer in Netsuite -



















Note the contact details.

I run my app -


















I update the email and job title -

















I validate in Netsuite -















OIC - it's so easy!


Saturday, April 18, 2020

#761 OIC - Monitoring API - Getting Activity Stream data

Simple example here -




















The above integration does little, receives a JSON request and maps that to a JSON response.
But it will suffice to show how we can leverage the AI to retrieve activity stream data for an integration flow.

Here is the monitoring view -




















Now to get this data, via the OIC REST API -

The api is documented here

























I start with - /ic/api/integration/v1/monitoring/instances/{id}











I then add the instance id - 27600257 (See monitoring screenshot)

/ic/api/integration/v1/monitoring/instances/27600257

I try this out -

Response -























Ok, so no activity stream data here -

All I need to do is add this to the request URL -

/ic/api/integration/v1/monitoring/instances/27600257/activityStream

I test again -

Response is a list in the format -















interesting here is the Milestone value - e.g. ST

These milestones correspond to the activity stream -
Let's look at that again -













So what's happening here?

1. Instance started
2. Message Received
3. Data Mapping
4. Response sent

In my REST response I see the following milestones -

"ST", "r0", "m0", "y0".

I can add these to my REST request -

e.g. /ic/api/integration/v1/monitoring/instances/27600257/activityStream/r0

I test and view the response -























and there is my payload.

Now, I execute the REST request for the end milestone - y0.

Here I see the response -








A big thank you to my colleague Arya for the pointers.