<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-concur</artifactId>
<version>x.y.z</version>
<classifier>mule-plugin</classifier>
</dependency>
SAP Concur Connector 4.2 - Mule 4
Anypoint Connector for SAP Concur (Concur Connector) is a SaaS provider from SAP for integrated travel and expense management solutions.
Concur Connector operates as a bidirectional gateway between instances of Concur and Mule runtime engine (Mule). Concur Connector is a closed-source connector that supports SOAP and REST calls to Concur APIs.
Release Notes: SAP Concur Connector Release Notes
Exchange: SAP Concur Connector
Before You Begin
To use this information, you should be familiar with SAP Concur, Mule, Anypoint Connectors, Anypoint Studio, Mule concepts, elements in a Mule flow, and Global Elements.
You need login credentials to test your connection to your target resource.
For software requirements and compatibility information, see the Connector Release Notes.
POM File Information
Replace x.y.z
with the version that corresponds to the connector you are using.
To obtain the most up-to-date pom.xml
file information, access the connector in Anypoint Exchange and click Dependency Snippets.
Add the Connector to a Studio Project
Anypoint Studio provides two ways to add the connector to your Studio project: from the Exchange button in the Studio taskbar or from the Mule Palette view.
Add the Connector Using Exchange
-
In Studio, create a Mule project.
-
Click the Exchange icon (X) in the upper-left of the Studio task bar.
-
In Exchange, click Login and supply your Anypoint Platform username and password.
-
In Exchange, search for "concur".
-
Select the connector and click Add to project.
-
Follow the prompts to install the connector.
Example Use Case
This guide presents two of many use cases you might have for the Concur connector in your organization: getting a list of lists and retrieving quickexpenses. You may jump ahead and paste the code for the flows into the XML Editor in Studio after you download the Concur connector and create a global element to reference your Concur instance credentials.
Get List Items
After creating a new project and a Concur global element:
-
Add a new flow element by dragging it from the palette and give a name to the flow, such as
getlists
. -
Drag an HTTP Listener into your flow from the palette.
-
Double-click the HTTP Listener and click the green plus sign next to the Connector Configuration dropdown and set the Host to localhost, and the Port to 8081.
-
Click OK to close the properties window, then enter getlists as the value in the Path field in this HTTP listener’s Basic Settings section.
-
Add a Concur connector to the new flow, select the connector configuration, and select the Get list items operation.
-
Finally, add a Transform Message transformer to the flow.
-
For reference you may check the particular getlists flow within the example XML code further down.
To execute the flow and check the outcome:
-
Right-click the project in the Package Explorer, and click Run As > Mule Application.
-
Check that the application has started by monitoring the Studio console.
-
Open the browser and go to
http://localhost:8081/getlists
. -
You should receive a JSON response like this:
{ "Items": [ { "ListID": "gWjM8QmJmOqZnW2i9MaJqJgAMhR$sGXQ$seYQ", "Name": "American Express Travel", "ParentID": null, "Level1Code": "American Express Travel", "Level2Code": null, "Level3Code": null, "Level4Code": null, "Level5Code": null, "Level6Code": null, "Level7Code": null, "Level8Code": null, "Level9Code": null, "Level10Code": null, "IsDeleted": false, "ID": "gWgUluaspXXNeeNwsbk6mGsqOlp0pxJyRWQ", "URI": "https://implementation.concursolutions.com/api/v3.0/common/listitems/gWgUluaspXXNeeNwsbk6mGsqOlp0pxJyRWQ" }, …..
-
Click the stop button to halt the server running the application.
Create a Quick Expense
-
Add a new flow element by dragging it from the palette and name it getquickexpenses.
-
Add an HTTP Listener to your flow by dragging it from the palette.
-
Use the configuration from the first demo, or if you did not create that flow, click the green plus sign next to Connector Configuration for the HTTP endpoint and enter localhost as the Host and 8081 for the Port.
-
Click OK to close the properties window, then enter getquickexpenses as the value in the Path field in this HTTP listener’s Basic Settings section.
-
Add the Concur connector to the new flow, referencing a global element from the Connector Configuration and set an Operation to perform and any other properties you require.
-
Finally, add an Transform Message transformer link in the previous example.
To execute the flow and check the outcome, perform the following steps:
-
Right-click the project in the Package Explorer > Run As > Mule Application
-
Check the console to see when the application starts.
-
Open the browser and go to
http://localhost:8081/getquickexpenses
-
You should receive a JSON response like this:
{"items":{"quickExpense":[{"comment":"","currencyCode":"USD","expenseTypeCode":"UNDEF","expenseTypeName":"Undefined","id":"gWr7TiTHdIi5fyWCPBRPtqjeCIWyv2w","locationName":"","ownerLoginID":"","ownerName":"Unknown","paymentTypeCode":"PENDC","receiptImageID":"","transactionAmount":111.0,"transactionDate":"2018-07-21T00:00:00","uri":"https://www.concursolutions.com/api/v3.0/expense/quickexpenses/gWr7TiTHdIi5fyWCPBRPtqjeCIWyv2w","vendorDescription":""}, {"comment":"","currencyCode":"USD","expenseTypeCode":"UNDEF","expenseTypeName":"Undefined","id":"gWr7TiTXbQ47PtJ$pVkr6CzbLeRVRPww","locationName":"","ownerLoginID":"","ownerName":"Unknown","paymentTypeCode":"PENDC","receiptImageID":"","transactionAmount":111.0,"transactionDate":"2018-07-21T00:00:00","uri":"https://www.concursolutions.com/api/v3.0/expense/quickexpenses/gWr7TiTXbQ47PtJ$pVkr6CzbLeRVRPww","vendorDescription":""},
-
Click the stop button to halt the server running the application.