Technical Specification: SAP_POLineItemFact_2_AribaJobPaging
Version: 4.8
1. Purpose & Scope
This integration flow demonstrates the pattern for authenticating against SAP Ariba's OAuth token endpoint and submitting/paging through an Ariba Open API job (e.g., an Invoice Line Item Fact / analytics-reporting job, based on parameter names such as InvoiceLineItemFactSystemView, job_status_url, and api_url). The flow is invoked via a ProcessDirect sender call, retrieves an OAuth access token from Ariba, uses that token to submit a reporting job to the Ariba Open API, converts the JSON response to XML, extracts the returned Job ID, and constructs a "next page" / job-status polling URL from it. A parallel exception-handling sub-process logs error payloads when the main process fails.
The flow name and description ("...illustrates how to fetch Ariba API Token and communicate with the Ariba Open API") confirm this is a reference/template implementation for the Ariba token-and-job-submission pattern, rather than a full end-to-end business process (e.g., no explicit polling loop or SAP-side data delivery step is present in this flow).
2. Systems & Interfaces
Participants
| Name | ID | Type | Role |
|---|---|---|---|
| Sender1 | Participant_821469 | EndpointSender | Initiates the flow via ProcessDirect |
| getToken | Participant_10 | EndpointReceiver | Ariba OAuth token endpoint |
| SubmitJob | Participant_161 | EndpointReceiver | Ariba Open API job submission endpoint |
| Receiver | Participant_821463 | EndpointReceiver | Downstream receiver reached via ProcessDirect (internal) |
| Integration Process | Participant_Process_1 | Process | The iFlow's main processing pipeline |
Adapters / Message Flows
| Message Flow | Adapter Type | Direction | Source → Target | Purpose |
|---|---|---|---|---|
| MessageFlow_821470 | ProcessDirect | Sender | Sender1 → StartEvent_821467 | Entry point triggering the integration process |
| MessageFlow_11 | HTTP | Receiver | ServiceTask_7 (Get Token) → getToken | Calls Ariba OAuth token endpoint (oauth_address) |
| MessageFlow_162 | HTTP | Receiver | ServiceTask_158 (Submit Job) → SubmitJob | Calls Ariba Open API to submit the reporting job (api_url) |
| MessageFlow_821464 | ProcessDirect | Receiver | ServiceTask_821460 (Request Reply) → Receiver | Internal call to another process/iFlow (endpoint not detailed) |
3. Processing Logic
The flow contains two branches: a main process (starting at StartEvent_821467) and an exception sub-process (starting at StartEvent_177).
Main Process (sequential order)
- StartEvent_821467 — Entry point, triggered via ProcessDirect from Sender1.
- Init Params (
CallActivity_5, Content Modifier) — Sets/initializes header and property values needed downstream (e.g., realm, dates, credentials) — exact fields not detailed in facts, but this precedes query-parameter construction. - Build NextPage FQDN (
CallActivity_821471, Groovy:setQueryParams.groovy) — Parses an input body of pipe-delimited (@) tokens intoInvoiceLineItemFactSystemView,updatedDateFrom,updatedDateTo,pageToken, and builds aqueryParamsproperty combiningrealmandpageToken. - Get Token (
ServiceTask_7, HTTP Request-Reply) — Calls the Ariba OAuth token endpoint (getTokenreceiver, usingoauth_address,grant_type,credential) to obtain an access token. - Access Token Log (
CallActivity_173, Groovy:accessToken_log.groovy) — Conditionally logs the raw token response body as a message attachment for traceability. - JSON to XML Converter (
CallActivity_13) — Converts the JSON token response into XML for downstream processing/property extraction. - Set Token (
CallActivity_16, Content Modifier) — Extracts the access token from the converted XML and stores it (e.g., as header/property) for use in the Authorization header of the next call. - Set Auth (
CallActivity_156, Content Modifier) — Sets theAuthorizationheader (using the retrieved token) for the job submission call. - Submit Job (
ServiceTask_158, HTTP Request-Reply) — Calls the Ariba Open API (api_url) to submit the reporting job, using theSubmitJobreceiver endpoint. - JSON to XML Converter (
CallActivity_163) — Converts the job submission JSON response into XML. - Add Additional Root (
CallActivity_821452, Groovy:addNewRootElement.groovy) — Wraps the XML payload with an additional root node (rootNode) to simplify subsequent element navigation/manipulation. - Set Job ID (
CallActivity_821458, Groovy:CollectJobID.groovy) — Parses the wrapped XML to extractjobIdandstatus, then builds anextURLproperty by concatenatingjob_status_urlwith the extracted job ID (used for later job-status polling, outside this flow's scope). - Set Body (
CallActivity_821465, Content Modifier) — Prepares the outgoing message body for the next internal call. - Request Reply (
ServiceTask_821460, ProcessDirect Request-Reply) — Sends the message to another internal process (Receiverparticipant) for further handling. - EndEvent_821474 — Ends the main process.
Exception Sub-Process
- StartEvent_177 — Triggered on exception within the main process (standard CPI exception sub-process pattern).
- Handle Exception (
CallActivity_180, Content Modifier) — Prepares/enriches the error message content (e.g., extracting exception details into the body/properties). - Handle Exception (
CallActivity_821456, Groovy:handleError.groovy) — Conditionally logs the error body as a message attachment (Error_Body) for diagnostics. - EndEvent_178 — Ends the exception sub-process.
4. Scripts
setQueryParams.groovy
Reads the message body, expecting a @-delimited string in the fixed order: InvoiceLineItemFactSystemView@updatedDateFrom@updatedDateTo@pageToken@. Splits the body on @ and assigns each segment to a variable (note: the loop re-assigns all four variables on every iteration rather than incrementally — effectively only the final iteration's assignment matters, but since the token positions are fixed by index, the result is deterministic regardless of loop count). Builds queryParams by concatenating the realm property with &pageToken=<pageToken>, and sets queryParams, InvoiceLineItemFactSystemView, updatedDateFrom, updatedDateTo as message properties. Includes commented-out logging.
accessToken_log.groovy
Reads the logger property and message body. If a message log is available and logger is "true" (case-insensitive), attaches the full response body as a string attachment named accessToken with MIME type text/xml — used for tracing the token response in Message Processing Logs.
addNewRootElement.groovy
Parses the message body as XML using XmlSlurper, then rebuilds it wrapped inside a new rootNode element using StreamingMarkupBuilder, serializing the result back to a string via XmlUtil.serialize. This normalizes the XML structure so that subsequent scripts (e.g., CollectJobID.groovy) can reliably navigate rootNode.root.... Logging code is present but commented out.
CollectJobID.groovy
Parses the (now root-wrapped) XML body with XmlSlurper. Iterates over rootNode.root elements, capturing status and jobId text values (the loop overwrites jobID on each iteration, so the final matched element's jobId is retained). Builds nextURL by concatenating the job_status_url property with the extracted jobID, and stores it as the nextURL message property — this URL is intended for a subsequent job-status polling call (not shown in this flow). If logging is enabled, attaches nextURL as a text/plain attachment named nextPageURL.
handleError.groovy
Used in the exception sub-process. Reads the logger property and message body; if logging is enabled and a message log exists, attaches the current body as Error_Body (text/plain) — providing visibility into the failing payload at the point of exception.
5. Configuration
The following externalized parameters must be reviewed/set on deployment. Redacted values must be supplied via Secure Parameters/Credentials in the target tenant.
| Parameter | Value (as provided) | Redacted | Notes |
|---|---|---|---|
credential |
— | Yes | Credential alias used for calling Ariba token endpoint |
Inbound_Address |
/Ariba/OpenAPI |
No | ProcessDirect/endpoint address for this iFlow |
method |
POST |
No | HTTP method for outbound call(s) |
grant_type |
grant_type=openapi_2lo |
No | OAuth grant type for Ariba 2-legged OAuth |
oauth_address |
https://api.ariba.com/v2/oauth/token |
No | Ariba OAuth token endpoint URL |
timeout |
60000 |
No | HTTP timeout (ms) |
realm |
realm=cirrusatlanticsuite |
No | Ariba realm identifier, used in query params |
proxyType |
default |
No | Proxy configuration for HTTP adapter |
Authorization |
— | Yes | Authorization header value/token |
FromDate |
2020-05-01T23:55:31Z |
No | Filter start date (sample/default value) |
job_status_url |
https://openapi.ariba.com/api/analytics-reporting-jobresult/v1/prod/jobs/ |
No | Base URL for job status polling; concatenated with jobId in CollectJobID.groovy |
api_url |
https://openapi.ariba.com/api/analytics-reporting-job/v1/prod/jobs |
No | Ariba job submission endpoint |
check_Job_Status_URL |
aa |
No | Placeholder value — appears unconfigured/test value |
Timer |
(schedule XML config) | No | Timer trigger configuration; only relevant if this iFlow is scheduled rather than ProcessDirect-invoked |
api_address |
(empty) | No | Not configured |
Define Filter |
(empty) | No | Not configured |
Realm |
(empty) | No | Not configured — note duplicate/overlap with lowercase realm |
oauth_query |
(empty) | No | Not configured |
ToDate |
` |