0% found this document useful (0 votes)
26 views

Iflow Check Status

Uploaded by

Alex Rod
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views

Iflow Check Status

Uploaded by

Alex Rod
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

PUBLIC

Partner Enablement for SAP Document


Compliance, outbound invoicing option for Brazil
Sample iFlow: Check Status
TABLE OF CONTENTS
OVERVIEW ................................................................................................................................................. 3
CHECK REQUEST ...................................................................................................................................... 3
Sender HTTPS Connector.......................................................................................................................... 3
Trace Body ................................................................................................................................................. 4
Check HTTP Method .................................................................................................................................. 4
Method not allowed.................................................................................................................................... 5
Process Data Component.......................................................................................................................... 5
PROCESS DATA ........................................................................................................................................ 5
Read NFS.................................................................................................................................................... 6
Set Properties ............................................................................................................................................ 6
Set Header .................................................................................................................................................. 7
Check Error ................................................................................................................................................ 7
PROCESS READ NFS ................................................................................................................................ 7
getUUID ...................................................................................................................................................... 8
Get NFS ...................................................................................................................................................... 8
Exception error message .......................................................................................................................... 8
PROCESS ERROR ..................................................................................................................................... 9
Check Action .............................................................................................................................................. 9
Error messages........................................................................................................................................ 10
PROCESS CHECK STATUS ..................................................................................................................... 10
Check Action ............................................................................................................................................ 10
Authorize Path ......................................................................................................................................... 10
Cancel Path .............................................................................................................................................. 11
Processing / Approved / Rejected ........................................................................................................... 11

www.sap.com/contactsap

© 2020 SAP SE or an SAP affiliate company. All rights reserved.


No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP SE or an SAP affiliate company.

The information contained herein may be changed without prior notice. Some software products marketed by SAP SE and its distr ibutors contain proprietary software components of other sof tware vendors.
National product specifications may vary.

These materials are provided by SAP SE or an SAP affiliate company for informational purposes only, without representation or warranty of any kind, and SAP or its affiliated companies shall not be liable
for errors or omissions with respect to the materials. The only warranties for SAP or SAP affiliate company products and serv ices are those that are set forth in the express warranty statements
accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.

In particular, SAP SE or its affiliated companies have no obligation to pursue any course of business outlined in this docume nt or any related presentation, or to develop or release any functionality
mentioned therein. This document, or any related presentation, and SAP SE’s or its affiliated companies’ strategy and possibl e future developments, products, and/or platform directions and functionality are
all subject to change and may be changed by SAP SE or its affiliated companies at any time for any reason without notice. The information in this document is no t a commitment, promise, or legal obligation
to deliver any material, code, or functionality. All forward-looking statements are subject to various risks and uncertainties that could cause actual results to differ materially from expectations. Readers are
cautioned not to place undue reliance on these forward-looking statements, and they should not be relied upon in making purchasing decisions.

SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trade marks of SAP SE (or an SAP affiliate company) in Germany and other
countries. All other product and service names mentioned are the trademarks of their respective companies. See www.sap.com/copyright for additional trademark information and notices.
The propose of this document is to explain the sample iFlow to check status of NF-es using Partner
Enablement for SAP Document Compliance, outbound invoicing option for Brazil (from now on called
"Partner Enablement"). This document does not cover information regarding Partner Enablement APIs,
because there is a specific documentation regarding the APIs.

This sample does not have a connectivity with city hall services and just simulates the response expected by
Partner Enablement. The sample is composed by 3 different services: Authorize, Cancel, and Check Status.
This document is about the Check Status service.

To handle different scenarios on iFlow, the extension field on JSON request was used to allow the CPI
response to scenarios (like approval, rejection, and some errors), simulating the city hall response.

OVERVIEW
The sample iFlow has five processes:
• Check Request: gets the request and checks if the method is allowed.
• Process Data: gets the values on request and set some properties on iFlow.
• Read NFS: reads the Data Store to get the message sent previously on service Authorize or Cancel
• Process Error and Process Check Status: simulate responses with different status.

Those processes are explained in detail on the following chapters.

CHECK REQUEST
The Check Request process receives an HTTPS request from SAP Document Compliance, outbound
invoicing option for Brazil, attaches the payload on CPI monitor, and checks if the method sent to this HTTPS
is allowed.

Sender HTTPS Connector


SAP Document Compliance, outbound invoicing option for Brazil works with a REST API. So, for CPI to
receive this information, the Sender HTTPS Connector was created with the following configuration:

3
The fields were filled out as follows:
• Address: the suffix endpoint generated by CPI.
• Authorization and User Role: relate to the authorization method. This sample uses a specific user
role created for the sample, but you can configure a client certification. For more information on how
to secure HTTP inbound connection with client certification, see this blog post:
https://blogs.sap.com/2017/06/05/cloud-integration-how-to-setup-secure-http-inbound-connection-
with-client-certificates/.
• CSRF Protected: this field was deselected because the Partner Enablement API does not have this
feature implemented yet.

Trace Body
The Trace Body is a Groovy script to save the payload and the iFlow properties on CPI monitor. It was used
during the test to know the payload requested without activating the Trace in CPI. It is useful during the
development process and should be avoided on production. You can use this approach to analyze the error
when an exception occurs in CPI.

Check HTTP Method


This is a router component in CPI used to check the HTTP Method based on Header Camel properties, as
follows:

4
The condition expression for POST is: ${header.CamelHttpMethod} = 'POST'

Method not allowed


Here we have two components:
• Groovy script Remove Body to remove the body.
• Content modifier 405 - Method not allowed to set the message header HTTP Response Code to
"405 (Method not allowed)".

Process Data Component


This component is used to call a local integration process called Process Data.

PROCESS DATA
The Process Data process gets the values from payload and sets some properties on iFlow to identify, for
instance, the process type. It also sets some values on the message header.

5
Read NFS
This component is used to call a local integration process called Read NFS, responsible to get the message
from data store.

Set Properties
After reading the document from data store, the next step is a Groovy script responsible to get the values
from payload and set the properties used to simulate the city hall service response. Those fields are sent on
the extension header field on API request. See the sample code to get the values for Process Type, Return
Error, Reject and Retry:

6
Set Header
The content modifier Set Header was used to set the Content-Type and Accept attributes on the message
header.

Check Error
This router identifies which process will be called, based on the properties already set on Groovy script.

PROCESS READ NFS


This process reads the Data Store to get the message sent previously on process Authorize or Cancel, if the
message was not found, an error message will be returned.

7
getUUID
This Groovy Script get the UUID on payload message and set the message property to be used in Get NFS
component.

Get NFS
To read the Data Store using the UUID and throw an exception if not found.

Exception error message


Content Modifier with a fixed error message response setting the values as expected by Partner Enablement
API.

8
PROCESS ERROR
This process simulates the error message response before call the city hall service for each case
Authorization, Cancellation and Check Status.

Check Action
This router check the action requested and simulate the error response for each action.

9
Error messages
Those are Content Modifier with a fixed response setting the values as expected by Partner Enablement API.

PROCESS CHECK STATUS


This process simulates the check status response and was used to differentiate the response (Processing,
Approved and Rejected) for each action.

Check Action
This router check the action requested and simulate the response for each action.

If the message was not Cancel or Authorize, an error message from check status will be returned.

Authorize Path
The router “Check Retry” uses the property “retry” already set in Groovy Script, if the value is equal ‘0’ zero,
the flow must response some final status Approved or Rejected, otherwise store the payload again for future
check status and set the response with a Content Modifier with a fixed response “In Processing”.

10
Cancel Path
The router “Check Retry” uses the property “retry” already set in Groovy Script, if the value is equal ‘0’ zero,
the flow must response some final status Approved or Rejected, otherwise store the payload again for future
check status and set the response with a Content Modifier with a fixed response “In Processing”.

Processing / Approved / Rejected


Those are Content Modifier with a fixed response setting the values as expected by Partner Enablement API.

11

You might also like