Here is a typical process for document signing:
This process is slow and tedious, but still works for a single recipient. What if there are multiple recipients who need to sign a single document? Or if there is a hierarchy of signatures required? There can be other complex requirements related to document signing. With a small increase in requirement, the complexity increases exponentially. This is where an automated document signing solution like Adobe Sign comes into play. It can automate the entire process and provides an easy view into the current status of each document.
It is very straightforward to automate the process of sending the documents for signature through Adobe Sign using the available adapter in Oracle Integration Cloud (OIC).
In this article, I will explore one such use case using Oracle CPQ and Oracle Sales Cloud.
Oracle delivers a prebuilt integration between Oracle CPQ (Configure, Price and Quote) Cloud and Oracle Sales Cloud (OSC). This integration provides customers seamless support for the entire selling cycle. This can be enhanced by automating the document signing process using Adobe Sign. E.g., you may add a button on the opportunity screen in OSC, which triggers an OIC integration which fetches and sends the CPQ quote to the primary contact listed in the opportunity.
The high level steps to achieve this will be:
1. Create an application and configure OAuth using your Adobe developer account
2. Create the required connections in OIC
3. Create an OIC integration. This integration exposes a REST endpoint which expects a payload containing a CPQ transaction ID and an email address
4. The OIC integration connects to Oracle CPQ Cloud and retrieves the quote
5. The OIC integration then connects to Adobe Sign and uploads the fetched document and subsequently creates and sends an agreement for signing
6. The OIC integration is triggered by a custom button in OSC. On clicking a button a groovy script is invoked which fetches the associated CPQ transaction Id and the email address of the primary contact. It then invokes the REST endpoint of the OIC integration
In this article, I'll demonstrate steps 1 through 5. I'll simulate step 6 by invoking the REST endpoint using postman. For details on adding a custom button and invoking a REST web service, refer to this article.
Log in to your adobe developer account. If you do not have one you can get one here
Navigate to API Applications and click on the "+" icon to create a new one.
Provide a name of the application and choose "Domain = Partner"
Once the new application is created, click on its name and then click on "Configure OAuth for Application"
Enable the modifiers along with the scope listed in the following table:
Modifier | Scope |
user_login | account |
agreement_read | account |
agreement_write | account |
agreement_send | account |
library_read | account |
Set the value of "Redirect URL" to https://{ICS_HOST}:{ICS_SSL_PORT}/icsapis/agent/oauth/callback
Also note the value of "Client Id" and "Client Secret". These will be needed when creating a connection to your Adobe Application in OIC.
Create a connection to Oracle CPQ Cloud using the Oracle CPQ adapter
Choose "Connection Type = SOAP WSDL URL" and provide the URL to your CPQ instance
Provide the Username and Password for your CPQ instance. Test and Save the connection
Create a connection to your Adobe Sign account using the "Adobe eSign" adapter
In the credentials dialog, enter the Client Id and Client Secret of the OAuth application you created above.
In addition, provide "Scope = user_login:account agreement_read:account agreement_write:account agreement_send:account library_read:account"
Click "Provide Consent"
OIC will connect to Adobe to get your consent. The following screen will pop-up which will allow the OAuth Application access if you allow so. Click "Allow Access". You may be prompted to verify your adobe credentials.
If the previous step is successful, you will be shown the following screen confirming that Integration Cloud now has access using the OAuth application. You can return to OIC and test and save the connection.
Create a REST connection using the provided REST adapter. This will be used to trigger the integration.
Choose "Role = Trigger" and provide a name
Test and Save the connection
Create a new integration using the Orchestration Pattern
Select "Application Event or Business Object" to trigger this application
In the integration designer, drag and drop the REST connection created earlier into the Start circle.
Provide the values for the following fields and click Next:
Endpoint: ReceiveQuoteNumber
Endpoint's relative resource URI: /quote
What action does the endpoint perform: POST
Configure a request payload for this endpoint: Checked
Choose "JSON Sample" as the payload format and Click "inline" to enter the JSON sample:
Enter the sample payload and click OK
{
"TransactionId": "TID",
"AgreementRecepientEmailAddress": "EmailAddress"
}
Back in the configure endpoint wizard, click Next and Done
Now drop the CPQ connection in the Orchestration. This will be used to fetch the quote document.
Provide a name for the endpoint and click Next
Select "Export File Attachments" operation and click Next
Create a mapping for this endpoint's payload. Click on "MapToGetCPQDoc" and then click on the pencil icon:
Map the fields as follows:
Drag and drop the TransactionId field from the request (in Source Pane) to the id field of the Target as shown in the pic.
For the rest of the fields, provide default values for this example as follows:
element0: content
BooleanOrBlank: true
document_number: 1
variable_name: oRCL_OSC_FileAttachment_t
process_var_name: oraclecpqo
Validate and Close the mapping
Drag and Drop the adobe connection created earlier as a next step in the orchestration
Provide a name for the endpoint "Name = UploadDocument" and choose "Operation = Upload a document"
Click Done.
Click on MapToUploadDocument and click on the Pencil icon to enter the mapping editor
Map the File-Name field to filename and File-Data to file_content. Set "Mime-Type = application/pdf"
Once the document is uploaded to Adobe Sign in the previous step, it needs to be sent to recipients for signature.
In the integration editor canvas, drag the Adobe Sign connection to the end of the flow.
Provide "endpoint = SendAgreementForSignature" and select "operation = Send Agreement For Signature"
Click Next and Done to save this endpoint and go back to integration canvas.
Click on MapToSendAgreementForSignature to get to the mapping editor
In the mapping editor, create the following mappings:
signatureType = ESIGN
email = map with AgreementRecipientEmailAddress element of execute
recipientSetRole = SIGNER
signatureFlow = SENDER_SIGNATURE_NOT_REQUIRED
message = Please sign the document
transientDocumentId = map with transientDocumentId from Upload
name = map from filename element of GetCPQDoc
Save and Activate the integration
Once the integration is activated, it shows it metadata URL. The actual REST URL is by replacing metadata with the resource enpoint you provided earlier - "/quote"
So our REST resource URL will be https://POD_URL/integration/flowapi/rest/NN_ADOBEBLOG/v01/quote
You can now register this web service in Oracle Sales Cloud and call it from the action of a button. The payload for the REST API can be constructed in groovy. However, as mentioned earlier, this step is outside the scope of this article. To call a REST service from OSC, please refer to this article.
In this example I will test a call to the following REST URL
https://POD_URL/integration/flowapi/rest/NN_ADOBEBLOG/v01/quote
from POSTMAN using the following payload:
{ "TransactionId": "37813989" "AgreementRecipientEmailAddress": "<TestEmailAddress>" }
Once the call is executed, you can check the status of the instance from the OIC Monitoring Console
You can check the provided email account for an email from Adobe Sign
Once you click on the link in the email, it takes you the document signing page, where you have multiple options to sign the document:
You can actually sign the document
Next Post