Thursday, May 21, 2015

#402 BPM - Reusable Processes

So what are reusable processes in BPM?
reusable, you may say and who am I to disagree!

But there must be something more to it, right?

Let's begin with the ORCL docs -

You can invoke a process from another process using call activities. The invoked
process is a child of the process invoking it.
When you run a call activity, the engine does not create a new token for the reusable
process. The token in the parent process passes to the reusable process. When the
token completes the child process, it returns to the parent process to continue running
the activities that follow the call activity.
The child process must be a reusable process. Reusable processes can be invoked from
multiple processes. You can only start a reusable process by invoking it from a call
You cannot access reusable process from other SOA components because they are not
part of the SOA composite.
The start event of a reusable process must always be of type none. The end event can
be a error or a message event.

Here is a simple composite containing a BPM process -

As usual with my examples, it is an order process.
Sure where would we be without such?

Anyway, now I add a new BPM Process, of type
Reusable Process,  to the composite -

Input/Output as follows -

Note - you do not see the reusable process in the composite view -

Edit the Security Process and add a Human Task -

Now call this reusable process from the main order process -

Do the Data Associations, for input and output -

Some takeaways at this stage -

1. The reusable sub process does not have OOTB access to it's calling or parent process variables.
It only can see those passed as arguments. In the above case, the

2. These are not defined at the Start / End nodes of the sub-process, as you may have expected.

3. Reusable sub-processes are not exposed to the outside world. They can only be used
within composite boundaries.

Now let's deploy and test.

I approve the order -

Check out the em audit trail -

Now, I create a another BPM process -

I call it from the order process, as follows -

I deploy and test - here we see, of course, the 2 process instances

Another takeaway - the reusable sub-process runs within the "parent" process instance.
Calling another process via Send/Receive will cause separate instances to be created.

No comments: