Skip to content

SAP-samples/cloud-ariba-partner-flow-extension-ext

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

SAP Ariba India Localization

REUSE status

Content:

India Localization is a sample extension application for SAP Ariba that runs on SAP Cloud Platform. The purpose of the application is to allow a buyer to attach documents to Advance Ship Notices (ASNs).

In India (and in other countries such as Brasil as well), whenever goods travel from the supplier to the buyer across different states, the supplier needs a waybill document. The waybill document is issued to the buyer by the government upon request. The buyer have to send the document to the supplier in some way, so that the supplier can give it to the truck drivers responsible for delivering the goods. This is where the India Localization application comes in use. The extension application intercepts the creation of cross-state Advance Ship Notices in SAP Ariba and displays information about them to the buyer. The buyer can request waybill documents from the government and attach them to the ASNs using the extension application. As a result, the waybill documents are available as an ASN attachment for both the buyer and supplier.

The application uses the Partner Flow Extension API. You can run it either on enterprise, or trial SAP Cloud Platform account in the Neo environment.

These are the SAP Cloud Platform services and features in use:

The India Localization extension is a Java application that calls SAP Ariba's Partner Flow Extension API and fetches all intercepted ASN events. The events are persisted in a database and displayed in a SAPUI5 front-end. The application user can upload document attachments to the intercepted ASN events. Once an attachment is being uploaded, the application resumes the related ASN.

To use this extension application, you need to:

  1. Register an SAP Ariba Open APIs application in SAP Ariba Developer Portal.
  2. Promote your registered application for production access.
  3. Build and deploy the Java extension application on SAP Cloud Platform.
  4. Configure the Java application connectivity.
  5. Start the Java extension application.

You need to:

You already have an account for SAP Ariba Developer Portal. Open the guide and follow the steps to register a new SAP Ariba Open APIs application that will be used against SAP Ariba Open APIs. At the end, you should have an application key related to the SAP Ariba Open APIs application.

As a next step, promote your application for production access. At the end, besides the application key, you will have a set of credentials (Service Provider user and Service Provider password) related to the registered SAP Ariba Open APIs application. You need them in order to call the Partner Flow Extension API production environment.

You will need the following Group Condition to intercept only ASNs with delivery across different states:

<GroupConditions>
		<Condition>ariba:not(ariba:string-compare( $src/cXML/Request/ShipNoticeRequest/ShipNoticeHeader/Contact[@role='shipFrom'][1]/PostalAddress/State, $src/cXML/Request/ShipNoticeRequest/ShipNoticeHeader/Contact[@role='shipTo'][1]/PostalAddress/State) )</Condition>
</GroupConditions>

You have already downloaded or cloned the India Localization extension application. Now you have to build the application and deploy it on the SAP Cloud Platform. There are two paths you can choose from:

  • using the SAP Cloud Platform Cockpit
  • using the Eclipse IDE

Build the Application

  1. Go to the cloud-ariba-partner-flow-extension-ext folder.

  2. Build the project with:

     mvn clean install
    

The produced WAR file ROOT.war under target sub-folder cloud-ariba-partner-flow-extension-ext\target is ready to be deployed.

Deploy the Application Using the Cockpit

You have to deploy the ROOT.war file as a Java application via SAP Cloud Platform Cockpit. Use Java Web Tomcat 8 as a runtime option.

When using the Eclipse IDE you can take a look at the structure and code of the application. You have to import the application as an existing Maven project and build it with Maven using clean install. You also have to choose Java Web Tomcat 8 as a runtime option.

Prerequisites

Build the Application from Eclipse

  1. You have to clone the cloud-ariba-partner-flow-extension-ext project.

    1. Оpen the Git Perspective. Choose Windows > Open Perspective > Other. Select Git and choose OK.
    2. Choose Clone a Git repository.
    3. Enter https://github.com/SAP/cloud-ariba-partner-flow-extension-ext.git in the URI field and choose Next.
    4. Set the Directory field and choose Finish.
  2. You have to import the cloud-ariba-partner-flow-extension-ext project as an existing Maven project and then build it.

    1. In the Java EE perspective, choose File > Import > Maven > Existing Maven Project.
    2. Browse and select the folder where you have cloned the Git repository and choose Finish. Wait for the project to load.
    3. From the project context menu, choose Run As > Maven Build.
    4. Enter clean install in the Goals field and choose Run. The build should pass successfully.

Deploy the Application from Eclipse

To deploy the application from Eclipse IDE, follow these steps:

  1. Set the context path to /
    1. In the Project Explorer view right-click on the project and choose Properties > Web Project Settings.
    2. For Context root enter /
  2. In the Servers view right-click on the white field and choose New > Server.
  3. Select SAP Cloud Platform and choose Next.
  4. Select Java Web Tomcat 8 as a runtime option.
  5. Add the application to the Configured field and choose Finish.

You need to create an HTTP destination on the SAP Cloud Platform.

Use the following required properties:

            Type: HTTP
            Name: ariba-india-localization
            URL: <SAP Ariba OpenAPIs production environment URL>
            Authentication: BasicAuthentication
            User: <SAP Ariba Open APIs Service Provider User>
            Password: <SAP Ariba Open APIs Service Provider Password>

And add four additional properties:

            FlowExtensionId: <The unique flow extension id>
            ApiKey: <SAP Ariba Open APIs application API key>

If you want to configure how often will the Partner Flow Extension API be called, add an additional property:

            JobIntervalInSeconds: <Not mandatory. How often will the Partner Flow Extension API be called>

Note: There is a sample destination in the project's resources folder.

After creating the destination, start (or restart in case the application is already started) the application via the Cloud Cockpit.

Test the Application

Create PO and ASN with delivery across different states. It should be intercepted by the extension application.

Additional Information

Copyright © 2017-2020 SAP SE or an SAP affiliate company. All rights reserved. This project is licensed under the Apache Software License, version 2.0 except as noted otherwise in the LICENSE file.

About

Partner flow extension API sample extension application.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages