Skip to content

Commit

Permalink
MARP-922 Update document
Browse files Browse the repository at this point in the history
  • Loading branch information
phhung-axonivy committed Jan 2, 2025
1 parent c01926c commit 5d38e35
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 26 deletions.
5 changes: 2 additions & 3 deletions sbb-connector-demo/processes/BookTrip.p.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"signature" : "start",
"case" : {
"customFields" : [
{ "name" : "conversationId", "type" : "STRING", "value" : "java.util.UUID.randomUUID().toString()" }
{ "name" : "requestor", "type" : "STRING", "value" : "ivy.session.getSessionUserName()" }
]
}
},
Expand Down Expand Up @@ -63,8 +63,7 @@
"processCall" : "GetTripsCollection:call(com.axonivy.connector.sbb.tripscollection.GetTripsCollectionDataIn)",
"call" : {
"map" : {
"param.getTripsCollectionDataIn" : "in.getTripsCollectionDataIn",
"param.getTripsCollectionDataIn.headers.requestor" : "ivy.session.getSessionUserName()"
"param.getTripsCollectionDataIn" : "in.getTripsCollectionDataIn"
}
},
"output" : {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@
"processCall" : "GetPlaces:call(com.axonivy.connector.sbb.place.GetPlacesDataIn)",
"call" : {
"map" : {
"param.getPlacesDataIn.headers.requestor" : "ivy.session.getSessionUserName()",
"param.getPlacesDataIn.params.name" : "in.getPlacesDataIn.params.name"
}
},
Expand Down
22 changes: 12 additions & 10 deletions sbb-connector-product/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# SBB Connector

Axon Ivy's SBB Connector integrates the [Swiss Mobility API](https://developer.sbb.ch/apis/b2p/information) provided by SBB. This connector uses a REST client that allows you to retrieve timetables and fare details. Additionally, you can create and manage bookings of Swiss public transport through the API.
Axon Ivy's SBB Connector integrates the [Swiss Mobility API - Journey](https://developer-int.sbb.ch/apis/smapi-osdm-journey/information) provided by SBB. This connector uses a REST client that allows you to retrieve timetables and fare details. Additionally, you can create and manage bookings of Swiss public transport through the API.

Note that credentials are required to gain access to any features of the API. Although they are provided free of charge by SBB, the purpose of their API is to generate sales turnover through it. For more information about access, features and capabilities, visit the info page of the [Swiss Mobility API](https://developer.sbb.ch/apis/b2p/information).
Note that credentials are required to gain access to any features of the API. Although they are provided free of charge by SBB, the purpose of their API is to generate sales turnover through it. For more information about access, features and capabilities, visit the info page of the [Swiss Mobility API - Journey](https://developer-int.sbb.ch/apis/smapi-osdm-journey/information).

## Demo

Expand All @@ -18,18 +18,20 @@ To use the SBB Connector, add the following variables to your Axon Ivy Project:
Variables:
sbbConnector:
# The URI of the API to use. For example: `https://b2p-int.api.sbb.ch` (integration) or `https://b2p.api.sbb.ch` (production)
uri: ''
uri: ""
# The contract id provided to you by SBB. For Example: `ACP1024`
contractId: ''
contractId: ""
# The client id provided to you by SBB. For Example: `01234567-89ab-cdef-0123-456789abcdef`
clientId: ''
clientId: ""
# The client secret provided to you by SBB.
# [password]
clientSecret: ''
#[password]
clientSecret: ***
# The endpoint for acquiring the bearer token using your client id and secret. For Example: `https://login.microsoftonline.com/2cda5d11-f0ac-46b3-967d-af1b2e1bd01a/oauth2/v2.0`
tokenEndpoint: ''
tokenEndpoint: ""
# The scope provided to you by SBB.
scope: ''
scope: ""
# The URI of the Journey SBB Swiss Mobility API to use . For example: `https://smapi-osdm-journey-int.api.sbb.ch` (integration) or `https://smapi-osdm-journey.api.sbb.ch` (production)
journeyUri: ""
```

Any request to the API requires a x-conversation-id header of the current business process. For the already provided subprocesses by the SBB Connector you can either set the customField `conversationId` at the beginning of a process or provide the conversationId as an argument each time you call a subprocess. Take a look at the demo project for an example.
Any request to the Journey SBB Swiss Mobility API requires a `Requestor` header of the current business process. For the already provided subprocesses by the SBB Connector you can either set the customField `requestor` at the beginning of a process or provide the `Requestor` as an argument each time you call a subprocess. Take a look at the demo project for an example.
22 changes: 12 additions & 10 deletions sbb-connector-product/README_DE.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# SBB Konnektor

Axon Ivy's SBB Konnektor integriert die [Swiss Mobility API](https://developer.sbb.ch/apis/b2p/information) der SBB (= Schweizerische Bundesbahnen). Dieser Konnektor nutzt einen REST-Client, der es dir ermöglicht, Fahrpläne und Tarifdetails abzurufen. Zusätzlich kannst du über die API Buchungen für den öffentlichen Verkehr der Schweiz erstellen und verwalten.
Axon Ivy's SBB Konnektor integriert die [Swiss Mobility API - Journey](https://developer-int.sbb.ch/apis/smapi-osdm-journey/information) der SBB (= Schweizerische Bundesbahnen). Dieser Konnektor nutzt einen REST-Client, der es dir ermöglicht, Fahrpläne und Tarifdetails abzurufen. Zusätzlich kannst du über die API Buchungen für den öffentlichen Verkehr der Schweiz erstellen und verwalten.

Beachte, dass Zugangsdaten erforderlich sind, um auf die Funktionen der API zuzugreifen. Obwohl diese von der SBB kostenlos zur Verfügung gestellt werden, dient ihre API dazu, Umsätze zu generieren. Weitere Informationen zu Zugang, Funktionen und Möglichkeiten findest du auf der Infoseite der Swiss Mobility API.
Beachte, dass Zugangsdaten erforderlich sind, um auf die Funktionen der API zuzugreifen. Obwohl diese von der SBB kostenlos zur Verfügung gestellt werden, dient ihre API dazu, Umsätze zu generieren. Weitere Informationen zu Zugang, Funktionen und Möglichkeiten findest du auf der Infoseite der Swiss Mobility API- Journey.

## Demo

Expand All @@ -18,18 +18,20 @@ To use the SBB Connector, add the following variables to your Axon Ivy Project:
Variables:
sbbConnector:
# The URI of the API to use. For example: `https://b2p-int.api.sbb.ch` (integration) or `https://b2p.api.sbb.ch` (production)
uri: ''
uri: ""
# The contract id provided to you by SBB. For Example: `ACP1024`
contractId: ''
contractId: ""
# The client id provided to you by SBB. For Example: `01234567-89ab-cdef-0123-456789abcdef`
clientId: ''
clientId: ""
# The client secret provided to you by SBB.
# [password]
clientSecret: ''
#[password]
clientSecret: ***
# The endpoint for acquiring the bearer token using your client id and secret. For Example: `https://login.microsoftonline.com/2cda5d11-f0ac-46b3-967d-af1b2e1bd01a/oauth2/v2.0`
tokenEndpoint: ''
tokenEndpoint: ""
# The scope provided to you by SBB.
scope: ''
scope: ""
# The URI of the Journey SBB Swiss Mobility API to use . For example: `https://smapi-osdm-journey-int.api.sbb.ch` (integration) or `https://smapi-osdm-journey.api.sbb.ch` (production)
journeyUri: ""
```

Any request to the API requires a x-conversation-id header of the current business process. For the already provided subprocesses by the SBB Connector you can either set the customField `conversationId` at the beginning of a process or provide the conversationId as an argument each time you call a subprocess. Take a look at the demo project for an example.
Any request to the Journey SBB Swiss Mobility API requires a `Requestor` header of the current business process. For the already provided subprocesses by the SBB Connector you can either set the customField `requestor` at the beginning of a process or provide the `Requestor` as an argument each time you call a subprocess. Take a look at the demo project for an example.
Binary file modified sbb-connector-product/images/search-for-trips.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified sbb-connector-product/images/trips.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion sbb-connector/processes/GetPlaces.p.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"clientId" : "13022aee-0653-4076-b253-a87b352403c8",
"path" : "/v1/places",
"headers" : {
"Requestor" : "in.in.headers.requestor",
"Requestor" : "ivy.case.customFields().stringField(\"requestor\").getOrDefault(in.in.headers.requestor)",
"Accept-Language" : "in.in.headers.acceptLanguage",
"traceparent" : "in.in.headers.traceparent",
"tracestate" : "in.in.headers.tracestate"
Expand Down
2 changes: 1 addition & 1 deletion sbb-connector/processes/GetTripsCollection.p.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"clientId" : "13022aee-0653-4076-b253-a87b352403c8",
"path" : "/v1/trips-collection",
"headers" : {
"Requestor" : "in.in.headers.requestor",
"Requestor" : "ivy.case.customFields().stringField(\"requestor\").getOrDefault(in.in.headers.requestor)",
"Accept-Language" : "in.in.headers.acceptLanguage",
"traceparent" : "in.in.headers.traceparent",
"tracestate" : "in.in.headers.tracestate"
Expand Down

0 comments on commit 5d38e35

Please sign in to comment.