Sunday, December 07, 2014

OBPM versus BPEL, That's the Question

Recently I was pointed to the so-called Oracle Learning Streams http://education.oracle.com/streams which provide short presentations on all kind of topics.

While ironing my clothes on a Sunday afternoon, I watched one with the title "Leveraging OBPM vs BPEL" by David Mills. An excellent story where he explains in less than 13 minutes the high-level difference using a practical example.

One reason why I like about this stream is that it is in line with what I preach for years already. Otherwise I would have told you it sucked, obviously.

The main point David makes is that you should use the right tool for the right job. OBPM aims at orchestrating business functions, whereas BPEL aims at orchestrating system functions. The example used is an orchestration of system functions to compose an Update Customer Profile service, which then can be used in a business process, orchestrating business functions where one person is involved to approve some update, while someone else needs to be informed about that. Watch, and you'll see!

For understandable reasons the presentation does not touch the (technical) details. Without any intention to explain those, one should think about differences in the language itself (for example in BPEL you cannot create loops while in BPMN that quite normal to do), and also in the area of configuration and tuning (for example in case of BPEL there are more threads to tune, and you can do in-memory optimization, etc.).

Maybe I find some time to give you a more detailed insight in those more detailed differences. Would help if you would express your interest by leaving a comment!

Wednesday, November 19, 2014

Why You Should Create BPM Suite Business Object Using element (and not complexType)

In this article I describe why you always should base your business object based upon an element, instead of a complexType.

With the Oracle BPM Suite your process data consists of project or process variables. Whenever the variable is based on a component, that component is either defined by some external composite (like a service), or is defined by the BPM composite itself, in which case it will be a Business Object. That Business Object is created directly or is based upon an external schema. Still with me?

When using an external schema you should define the business object based upon an element instead of a complexType. Both will be possible, but when you define it based upon a complexType, you will find that any variable using it, cannot be used in (XSLT) transformations nor can be used as input to Business Rules.

As an example, see the following schema:


The customer variable (that is based on an element) can be used in an XSLT transformation, whereas the order variable cannot:

The reason being that XSLT works on elements, and not complexTypes.

For a similar reason, the customer variable can be used as input to a Business Rule but the order variable cannot:

Of course, if you are a BPEL developer, you probably would already know, as there you can only create variables based on elements ;-)

Thursday, November 13, 2014

Did You Know that You Can Buy OUM?

The Oracle Unified Method (OUM) Customer Program has been changed in that, next to the already existing option to get it by involving Oracle Consulting, you now also can buy it if (for some reason) you don't want to involve Consulting.

Next to that there also is the option to purchase a subscription (initial for 3 years, after which it can be renewed annually) allowing to download updates for OUM.

OUM aims at supporting the entire Enterprise IT lifecycle, including the Cloud.

Thursday, October 30, 2014

Work-around Instance Migration Limits of BPM Suite 11g

The following describes a work-around for 2 situations for which instance patching and migration is not supported, being changing the level of an activity, and removal of an embedded sub-process. In short this work-around consists of re-implementation of the activities to move, and emptying the reusable sub-process.

There are a couple of restrictions for the Oracle BPM Suite that can make that process instances cannot be patched (deployment using same revision number) or migrated (deployment using new revision number, and then move from old to new revision). Two of them are that you cannot change the scope of an activity (like moving it in our out of an embedded sub-process) or removal of an embedded sub-process. For both situations there is a work-around, that I can demonstrate with one case.

More information about instance patching and migration can be found here for BPM 11g (11.1.1.7) and here for BPM 12c (12.1.3).

The Work-Around


Suppose you have a process (A) like this:





And you want to change it to this (in real life you may want to move the activity inside to a totally different location, or even remove the embedded sub-process altogether) to this model (D):
As migration of running instances is not supported:
  1. Because of changing the scope of the activity, and
  2. Because of removal of the embedded sub-process
you will get an error like this when trying to do so:

 However, what you can do, is change the model like this (C):

The trick is that the Say Goodbye activity has not been moved outside, but re-implemented. In this case I created a new activity with the same name, and reused the existing task definition. So I only had to redo the data mappings.

You won't win any prize for most beautiful process model with this but it works. In practice you want to collapse the embedded sub-process and rename it to something like "Empty".

The Proof of the Pudding

To make sure it actually works for running processes I used an extra step between (A) and (C), being this model (B):
 First I started with the first model, created 2 instances with one in Say Hello, and the other in Say Goodbye. I then deployed the last model with "Keep running instances" checked (instance patching). The result was that both instances were automatically migrated (i.e. just kept on running).

Then I created a start situation of 3 instances, each of them being in a different activity. The most interesting is the one in Say Goodbye in the re-usable sub-process, as in this case the token is in an activity that is going to be removed.
 In line with the documentation, when deploying model (C) all instances were put I status Pending Migration. Using Alter Flow I was able to migrate the instances in the first and last activity as-is. After that I could successfully complete them.

The interesting one though, is in the second activity:

I was able to migrate that with Alter Flow by moving the token from the embedded sub-process (not the activity inside the embedded sub-process!) to the last activity:

The engine never knew what hit it ;-)

Monday, November 25, 2013

Browsing the Meta Data Services Repository of the Oracle SOA/BPM Suite 11g

In this article I explain a handy way to browse the MDS on the SOA/BPM server from JDeveloper, as well as how to download its content using Enterprise Manager, and finally an (as far as I know) undocumented feature to look up artifacts using a browser.

This article has been updated on November 26 to include the option regarding downloading the MDS content.

The Meta Data Services (or MDS for short) of Oracle's SOA/BPM Suite is used to manage various types of artifacts like:
  • Process models created with Process Composer,
  • Abstract WSDL's and XSD's,
  • Domain Value Map's (DVM), and even
  • Artifacts  of deployed composites.

Browsing the MDS from JDeveloper

To find out what actually is deployed in the MDS you can setup an MDS connection within JDeveloper to the server. Such a connection can be handy, for example to verify if replacements of variables in the MDS artifacts are properly done when deploying. Using this connection you can open those artifacts in JDeveloper and check the source.

To create an MDS connection go to the Resource Palette -> New Connection -> SOA-MDS. This will pop-up a tab from which you can create a database connection to the MDS for example the dev_mds schema. Having created the database connection you have to choose the partition to use for the SOA-MDS connection. To be able to check-out processes created whith Composer from the MDS or to save them in the MDS, you create a SOA-MDS that uses the obpm partition. As the name already suggests, this is in BPM-specific partition. To browse the other artifacts I mention above, you use the soa-infra partion, which is shared by both SOA and BPM.

In the figure below you can see two types of connections, above to the soa-infra and below to the obpm partition. In the (soa-infra) apps you can find the reusable artifacts that you have deployed explicitly (like abstract WSDL's, XSD's, EDL's).

What you also see is a deployed-composites folder that shows all composites that have been deployed. When expanding a composite, you will find that all artifacts are shown. This is a much easier way to verify that you do not deploy too many artifacts to the server then by introspecting the SAR file, I would say. Except for .bpmn files (that at the time of writing are not yet recognized by this MDS  browser) you can open all plain text files in JDeveloper.


Downloading the MDS from Enterprise Manager

Now let's assume that you have not been given access to the MDS's DB schema on the environment (perhaps because it is Production), but you do have access to the Enterprise Manager. For this situation my dear colleague Subhashini Gumpula pointed me to the possibility to download the content from the MDS as follows:

soa-infra -> Adminstration -> MDS Configuration  -> and then on the right side of the screen: Export.


This will download a soa-infra_metadata.zip file with its content!

Looking up Artifacts in the MDS Using a Browser

Now let's assume that you also have not been given access to Enterprise Manager on the environment, but you can access using the HTTP protocol. Thanks to my dear colleague Luc Gorrisen I recently learned that you can browse it using part of the URL of the composite, as follows:

http://[server]:[port]/soa-infra/services/[partition]/[composite_name]/apps/[artifact_folder]

For example, to look up the abstract WSDL of some ApplicationService that is used by some StudentRegistration business process, I can use the following URL.

http://capebpm-vm:7001/soa-infra/services/default/StudentRegistration/apps/ApplicationService/1/ApplicationServiceStorage.wsdl

Mind you, this is not restricted to only the WSDL's it is using.

Ain't that cool?!

Wednesday, November 20, 2013

How to Make File-Based MDS in JDeveloper Work for both Windows and Linux

In this article I explain how you  can modify the JDeveloper adf-config.xml file to make it work for both Windows, as well as Linux.

If in a JDeveloper application you point to artifacts in a file based MDS residing in a Windows folder for example "d:\projects\MDS", then JDeveloper will create an new entry in the adf-config.xml file (that you can find in Application Resources -> Descriptors -> ADF META-INF) pointing to the absolute location of that folder:



The problem with this is that if you have other colleagues that use Linux instead of Window, it's not possible to make it work for both by defining some relative location (as you could do with ant), like "../../projects/MDS", so now what?

As in most cases, the solution is so simple that I successfully missed it many times: use an environment variable! What worked was creating an environment variable with name MDS_HOME, and after that I could use it like this:

Problem solved! Such an evironment variable you can create in Windows as well as Linux.

I have not yet fully tested if this works for everything, like deploying with ant, but if it doesn't I expect you can easily fix that by modifying the ant-sca-compile.xml file in your JDeveloper installation folder by adding a property "mds_home" in there as well.

Customizing (or rather Hacking) Oracle BPM 11g Business Exceptions

In this article I explain how you can add custom attributes to Oracle BPM 11g business exceptions. Mind that this is not officially supported.

One of the fun things of giving a training like the Advanced BPM Suite 11g course that I'm running now, is that students ask questions to which you don't know the answer. But hey, you are the teacher, and that won't do, so off you go!

One question asked yesterday was if it is possible to have more attributes on a business exception than just "errorInfo". First question should be: "why do you want that?". Well, let's assume that you at some higher level you want to have access to context information that is only available where the exception is thrown, like a local variable. Of course you can concatenate all info in one long semi-colon separated string or something, but then you probably have to have other logic to transfer that back into something readable.

If you look closely at the definition of a business exception, you will notice that it uses a generated WSDL and XSD. What I did was adding an extra element "name" to the XSD of a business exception with name FailProcess (created for the previous blog article) as follows:


I then restarted JDeveloper to see what would happen, and not totally to my surprise: nothing! As in: it works! I also tried it run-time, and no problem there either, as you can see in the following figure:


One warning though. As the generated XSD clearly states, it should not be altered manually, and any change may be overwritten. It obviously is not a supported hack I show you here, and you should expect that any change of the business exception via the UI will break your code. Therefore let's hope that changes like this in some next version are supported by JDeveloper as well.

Tuesday, November 19, 2013

Why you may consider NOT using the Terminate End Event in Oracle BPM Suite

In this article I explain why you should try to avoid using the Terminate End Event in Oracle BPM 11g.

According to the BPMN specification, the Terminate End Event is supposed to terminate a process instance at the level at which it is raised, including any ongoing activity for sub-processes. But is should not terminate any higher level (parent) process.

With OBPM 11g it works differently (at least up to PS6), as raising a Terminate End Event will actually terminate the composite's instance. Except for human tasks, because as clearly stated in the documentation: "Human tasks are independent from BPMN processes. If you terminate a BPMN process while it runs a user task, the associated human tasks keeps running independently". The reason is that the human workflow engine runs separately from the BPM engine.

In the process below this will result in the situation that the Review Data task will still show in Workspace, while the associated process instance is already terminated. That was not the original intention of this model.


This flow shows what actually happens:


Conclusion: before considering using the Terminate End Event be well aware of its behavior. Consider alternate types of modeling, like raising a business exception that is caught by the parent process, which then uses an Update Task activity to withdraw all human tasks before actually ending. In this way you can prevent any human doing accidentally doing work for nothing.

Such a model would look like this: