Video Walk through of this Tutorial

If you would like to see this Adobe sign connector Use Case in action, click this video below.

General Description

This use case demonstrates how ProcessMaker I/O can be used to automate a complex workflow scenario for a loan request. We use the Adobe Sign product integrated with ProcessMaker I/O via a connector in this use case. This use case shows how users can easily enhance the current Adobe Sign software functionality by using it in a business process.

The example in this use case is a general loan contract process request. The customer creates the loan request and reviews the contract, which requires a signature. Optionally, a second person can be added to the case to share the obligation. All signatures used were made in Adobe Sign.

Getting Started With the Use Case

How to Launch an Environment* of ProcessMaker I/O

*ProcessMaker I/O is designed to be installed in the cloud, so in this document an Environment refers to an installation of ProcessMaker in a virtual machine or a container.

If you don't have a ProcessMaker I/O Environment yet, please:

  1. Go to the Environment page.
  2. Click Create an Environment and follow the instructions provided.

If you already have a ProcessMaker I/O Environment, please:

  1. Launch an Environment of ProcessMaker I/O on the Environment page.
  2. Copy/save the Environment URL link. This will be required later.
  3. Click on Examples - "Click to open" link in Environment Info.
  4. Go to the CRM example tab at the left.
  5. Click on Import tab and upload the BPMN file from your PC.
  6. Go to the ProcessMaker I/O SDK to create another user to use in the example later.
  7. Create an Adobe Sign account and upload the template document.

Connectors list

Adobe

Adobe SignConnector

This connector communicates with the ProcessMaker I/O Environment through the Adobe Sign platform. This connector covers the following actions:

Create Agreement, Upload Transient Document, Get Agreement Combined Document, Get Agreement Form Data

Input parameters:

  • action(text):
  • argument1(text):

Output parameters:

  • agreement_id (text):
  • transient_id (text)
  • signed_document_content (text):
  • email (script)

Slack Connectors

There are 2 type of connectors available for integration with Slack services:

Slack\SendMessageConnector

This connector sets up and configures communication between Slack Interactive Messages and your process.

Slack\ SlackAPI

This connector implements integration between your process and the Slack Web API.

Subscription Use case

Process Description

The customer starts the process via Slack messenger by passing the required loan amount and the requester email.

The customer reviews the contract.

The customer potentially signs the document or rejects it.

The customer adds a co-signer in the case he/she wants to share the loan obligation.

The co-signer reviews the resulting document and adds his or her signature, or declines the document.

In this use case, we created a BPMN process scheme in a 3rd party BPMN editor. The process can be initiated using a Slack command, which is depicted in the "Slack Requestor" lane. A new case will start when Slack triggers a start event by passing the user_name of the requestor, the amount of the loan, and the customer email. Then the script task will set up the necessary parameters for further communication with the Slack service. The message will then be sent to another lane, "Approval", which is the main Approval process.

Process Scheme

Alt text here

Processes

Process name Description
Slack Requester The initiator of the application and communication interface.
Approval The main process where the main workflow for creating the agreement is located.
Adobe Callback Technical process for receiving and processing the document status in Adobe Sign

Process Items

The tasks in the process.

Task Type Process Connector Parameters Description
Purchase Request Start Event Slack Requester In this task, the process is initiated using a Slack command. It will start when Slack triggers a start event by passing the user_name of the requestor, the amount for the loan, and the customer email. Then the script task will set up all the necessary parameters for further communication with the Slack service.
Initiate SlackBot Script Task Slack Requester aData.bot_token="xoxb-220902385776-dqYKPkUIsOesKE2w7yBRdN9O";
aData.channel_name="#testprocess";
function explode(div,str)
if (div=='') then return false end
local pos,arr = 0,{}
for st,sp in function() return string.find(str,div,pos,true) end do
table.insert(arr,string.sub(str,pos,st-1))
pos = sp + 1
end
table.insert(arr,string.sub(str,pos))
return arr
end
aTime = explode(" ", aData.text)
aData.amount = aTime[1]
aData.email = aTime[2]
This technical task runs the LUA script. The script task will then set up all the necessary parameters for further communication with the Slack service.
Initiate Signature Intermediate Message The message sent to the Approval lane, which is the main Approval process.
Send Confirmation Request Accepted Service Task Slack Requester SendMessageConnector Input parameters:
webhook_url(text):{response_url}
text(text):"Your loan request for ${amount} has been received. Sending to {email} for a signature."
options(text):{"ignore_exception":true}
A confirmation is sent back to the original requester through the Slack requestor.
Slack Channel Notification* (other messages is described in the Message section) Service Task All ApiConnector Input parameters:
api_url(text):https://slack.com/api/chat.postMessage
text(text):"A loan for the amount of ${amount} has been requested by {user_name} and the agreement has been sent to {email}."
token(text):{bot_token}
channel(text):{channel_name}
This task notifies a private Slack channel that the new request has been received.
This Slack channel now acts as the company audit log of the process status. The Slack receiver process ends since its task has been completed and the main process was started.
Start Start Event Adobe The process is initiated by the Slack Requestor process and starts the Approval process
Generate Agreement Service Task Adobe Adobe/SignConnector Input parameters:
action(text):createAgreement
argument1(text): {"documentCreationInfo":
{"fileInfos":{"libraryDocumentId":
"3AAABLblqZhAanS_vH_yY2uS_hxdkyUuaPmsbGhu11yUvd56m5h3kKTBuDi_ vdimyNdhYjt6KaQ0ZMfISXWjl1WvzQ08VqY7"},
"name":"Purchase Request",
"signatureType":"ESIGN",
"callbackInfo":"privhosting.com?123456",
"recipientSetInfos":{"recipientSetMemberInfos":{"email":"hlorofos@gmail.com"},
"recipientSetRole":["SIGNER"]},"
mergeFieldInfo":[{"fieldName":"Name", "defaultValue":"Alex Doe"}],
"signatureFlow":"SENDER_SIGNATURE_NOT_REQUIRED",
"formFields":[{"displayLabel":"amount", "maxLength":"50", "minLength":"1",
"locations{"height":"20","width":"100","pageNumber":"1","left":"120","top":"300"},
"name":"Purchaseamount",
"inputType":"TEXT_FIELD",
"required":"false", "defaultValue":"100.00", "fontSize":"8.0", "readOnly":"false", "borderWidth":"1.0", "tooltip":"Enter purchase amount"}, {"displayLabel":"email", "maxLength":"50", "minLength":"1","locations":{"height":"20", "width":"100", "pageNumber":"1", "left":"120", "top":"280"}, "name":"Supervisor email", "inputType":"TEXT_FIELD", "required":"false", "fontSize":"8.0","readOnly":"false", "borderWidth":"1.0","tooltip":"Enter email of your supervisor"}]}}
Output parameters:
agreement_id(text): {"Script":{"script":"outputVar = inputVar.agreementId", "language":"LUA"}
This technical task initiates the Adobe Sign connector.
This connector generates an Adobe Sign agreement based on an previously uploaded library document.
After creating an Adobe sign agreement, its ID is received, which is used later to address the agreement as an output parameter.
Status Update Intermediate Message By sending this message, the Adobe callback mechanics are set-up, which were set in the script task earlier and are used whenever an Adobe Sign agreement is created. This allows a callback to this lane to be received whenever the agreement status changes. The document key and its new status will be retrieved as the inputs.
Get Form Data Service Task Adobe Adobe/SignConnector Input parameters:
action(text):getAgreementFormData
argument1(text): {agreement_id}

Output parameters:
email(script, type LUA):
function fromCSV (s)
s = s .. ',' local t = {}
local fieldstart = 1
repeat if string.find(s, '^"', fieldstart) then local a, c
local i = fieldstart
repeat
-- find closing quote
a, i, c = string.find(s, '"("?)', i+1)
until c ~= '"' -- quote not followed by quote?
if not i then error('unmatched "') end
local f = string.sub(s, fieldstart+1, i-1)
table.insert(t, (string.gsub(f, '""', '"')))
fieldstart = string.find(s, ',', i) + 1
else -- unquoted; find next comma
local nexti = string.find(s, ',', fieldstart)
table.insert(t, string.sub(s, fieldstart, nexti-1))
fieldstart = nexti + 1
end
until fieldstart > string.len(s)
return t
end
-- print(inputVar)
secondLine = inputVar:match("+")
table = fromCSV(secondLine)
outputVar = table[9]
When the main lane gets the message that the agreement received a new status, then the status's value is checked here in the exclusive gateway and the flow continues via an "aborted" branch if the agreement was declined. Additionally, the Slack channel is notified about the action and finishes the process.
If the agreement was signed, the form's data will be analyzed to see if the signee added a second person to the contract. As usual, the Slack channel is notified that the first signature is in place.
Get Signed Doc Service Task Adobe Adobe/SignConnector Input parameters:
action(text):getAgreementCombinedDocument
argument1(text): {agreement_id}
Output parameters:
signed_document_content (text): {result_base64}
If an additional email is received, then this branch is continued and the signed document is downloaded from the Adobe service.
Upload Document Service Task Adobe Adobe/SignConnector Input parameters:
action(text):uploadTransientDocument
argument1(text): {signed_document_content}
Output parameters:
transient_id (text):{"Script":{"script":"outputVar = inputVar.transientDocumentId", "language":"LUA"}}
The document is re-uploaded with the signature on it.
Generate Co-Borrower Agreement Service Task Adobe Adobe/SignConnector Input parameters:
action(text):createAgreement
argument1(text): {"documentCreationInfo":{"fileInfos":{"transientDocumentId":"{transient_id}"},"name":"Supervise Purchase Request","signatureType":"ESIGN","callbackInfo":"privhosting.com?123456", "recipientSetInfos":{"recipientSetMemberInfos":{"email":"hlorofos@gmail.com"},"recipientSetRole":["SIGNER"]}, "signatureFlow":"SENDER_SIGNATURE_NOT_REQUIRED"}}
Output parameters:
agreement_id (text):{"Script":{"script":"outputVar = inputVar.agreementId", "language":"LUA"}}
Then this newly created transient document is used (note that here you might want to refer to the Adobe sign documentation again to understand the concept) to generate the agreement for the second signee.
Status Update Intermediate Throw Event Adobe Callback CorrelationKeys Input parameters:
agreement_id(text): {documentKey}
If status is updated, the Slack group is notified here via the Slack connector and the process ends.

Messages

All messages will take place in Slack . Therefore, all messages will be in the form of formatted webhook messages in either a channel or a private message between the ProcessMaker Bot and the user.

Message Task Previous Task Location Content
Slack Channel Notification* Send Confirmation Request Accepted Channel A loan for the amount of ${amount} has been requested by {user_name} and the agreement has been sent to {email}.
Slack Channel Notification* Generate Agreement Channel Loan for the amount of ${amount} has been declined by borrower.
Slack Channel Notification* Get forms data Channel Initial document for the amount of ${amount} has been signed.
Slack Channel Notification* Generate Co-Borrower Agreement Channel Loan for the amount of ${amount} has been declined by co-borrower {email}.
Slack Channel Notification* Generate Co-Borrower Agreement (signed) Channel Additional document for the amount of ${amount} has been signed by co-borrower {email}.