Wednesday, July 29, 2015

#427 Process Cloud Service --> ProcessA calling Process B via Send/Receive

Another simple scenario, leading on from the last post.

I have now added process C to my application -

It does a security check on my order -

Now I call this from ProcessA using Send and Receive activities.

Send configuration -

Receive configuration -

BTW. Here is a list of the valid types -

I do the necessary data associations and then deploy/test -

I then check for completed instances in the Tracking tab.

Here I see 2 instances, one for A and one for C.
Remember, we do not see a separate instance for B as it is being leveraged as a reusable process.

To quote the docs -

The call activity lets you call a reusable process from within the current process. The
process being called becomes a child process of the calling process. When calling a
reusable process, the call activity of the parent process waits until the child process
completes before continuing.

I check the audit trail for ProcessA -

#426 Process Cloud Service - Reusable Subprocesses

Simple scenario here -

Process A calling process B.

B has a human task -

I now validate the application -

Let's look at the implementation of the Call activity -

Note: no processes in the dropdown list -

Reusable Subprocesses

So what's needed here is a reusable sun-process.
This is a process with a "None" start activity.

Here is mine - as you can see, I have added an Approval task.

I have also created data objects -

Now I can define the inputs/outputs for B -

Back in Process A - Call Activity -

Now the Data Associations for the Call -

I also do the data associations in B -

First - Start Activity - Data Associations

Then, End Activity -

I deploy and test -

I see the human task in Workspace -

I approve and then check via Tracking.

Here is the audit trail (tree view) -

Tuesday, July 28, 2015

#425 Process Cloud Service --> REST API -- Initiating a process

Note: Nov 23rd 2015: 
Current active release version for PCS Rest api is bpm/api/3.0

Firstly, a very big thanks you to my colleague Ralf M. for his input here.

Here is my process -

I pick up the wsdl from the management page in Composer -

I use this to create a new project in SOAP-UI.

Here is my request -

Here is the task in Workspace -

Now to the construction of the REST call -

I discussed in a previous post how one can use the REST api

to retrieve processDefId, serviceName and operation.

Now to the payload parameter -

I use the soap-ui request as the basis for the payload value.

Here it is again -

Here is my .json file -

You can download it here

I use ns1 and ns2 instead of nial and _qy

Regarding escape characters - I used this site to validate.

Here is the curl request -

curl -u phillip:welcome1 -H "Content-Type:application/json" -H "Accept:application/json" -X POST -d @NCCreateInstance.json http://YourCloudInstance/bpm/api/1.0/processes

I check in Workspace -

Simple stuff!

Monday, July 27, 2015

#424 Process Cloud Service - REST API - passing parameters Part I

In this post I look at a couple more of the PCS REST APIs -

I am using the following process for demo purposes -

What processes do I have?

This is just to recap -

try GET /process-definitions

curl -u phillip:welcome1 -H "Content-Type:application/json" -H "Accept:application/json" -X GET http://yourCloudInstance/bpm/api/1.0/process-definitions

Here is part of the response I get -


Here I see the processDefId is testing/SimpleOrderApp!1.0*soa_66f7e718-81cb-4a3e-

The serviceName is SimpleOrderProcess.service

The operation is start

Now, I have an instance of this process running -

I can get a user's tasks using the following API -

GET /tasks

curl -u phillip:welcome1 -H "Content-Type:application/json" -H "Accept:application/json" -X GET http://yourCloudInstance/bpm/api/1.0/tasks

Here I get the taskId, in this case, it is 200073.

Using the following REST API, I can add a comment to this task -

POST /tasks/taskId/comments

I try the following on Windows but get an Unexpected character error.
curl -u phillip:welcome1 -H "Content-Type:application/json" -H "Accept: application/json" -X POST -d '{"commentStr":"Good customer"}' http://yourCloudInstance/bpm/api/1.0/tasks/200073/comments

Note how I pass the parameters -
-d '{"commentStr":"Good customer"}'

The syntax is described in detail in the docs here

So how do I get over this error?
I simply do as described in the docs - I put the json snippet into a file.

I then revise the command as follows -

curl -u phillip:welcome1 -H "Content-Type:application/
json" -H "Accept:application/json" -X POST -d @NCaddComment.json http://yourCloudInstance/bpm/api/1.0/tasks/200073/comments

Let's look at the NCaddComment.json file -

I execute the command -

I check in Workspace -

And yes, I did execute the request twice.

Now I will reassign a task from phillip to renate.

Here are phillip's tasks -

Here is my reassign for the SimpleOrderApp (taskid 200079) -

curl -u phillip:welcome1 -H "Content-Type:application/json" -H "Accept:application/json" -X POST -d @NCreassignTask.json http://yourCloudInstance/bpm/api/1.0/tasks/200079/reassign

Here is the .json file -


Here is the execution -

I validate in Workspace - phillip now has only 1 task -

I login as renate -

I check the History -

Monday, July 20, 2015

#423 Process Cloud Service --> Exporting Audit data

I log in to Workspace as my admin user, phillip.

I click on Tracking, and check on completed instances.

 I will now export the completed instances of MyOrderProcess.

I select the application(s) I want to export, in this case, NCOrderApp.

I specify an email address and to delete after export.


Click on Completed link, once it appears -

Zip is downloaded -