javabpelbusiness-process-managementapache-ode

Implementing human input in apache ode


I want to learn how to use Apache ODE and use it in my java aplications. But I can't find a good source to learn from. All the examples on the web that I've found so far are very simple(send a message and get a message). I want to make a simple process where the following happens:

  1. Process stars with some input
  2. A java function runs the input through some algorithm and passes the result to the next function
  3. The next function shows the input to an administrator and he decides whether to approve the process or to discard it. His response is pass to the next function if positive or the whole process is terminated if not.
  4. The next function does something if the operation was approved.

Is this hard to do? Can you give me links to some projects which use apache ode and require human input?


Solution

  • Apache ODE is a BPEL engine. BPEL itself is meant to support two-level programming: A BPEL layer that is more abstract and conforms to actual business processes of an organization that utilizes Web services that are implemented in either BPEL or a "standard" programming language like Java. Thus, BPEL orchestrates Web services.

    So, going through your steps:

    1. BPEL provides a <receive> operation for you to do this. Your Java program (or any other Web service client) will call this operation. Depending on whether the operation is defined as one-way or two-way in the WSDL, you will need an <assign> and a <reply> to prepare the output message and send it to the caller.
    2. The Java function should be exposed as a Web service. You have many options including JAX-WS, Spring WS, and Apache CFX amongst others. This is a classical business rules service as you describe it.
    3. BPEL itself does not offer human activities. This has been added by BPEL4People but unfortunately Apache ODE does not support this. You will need some task manager that you can call via <invoke> and place a task there. For the callback you will need again a <receive>. Because you need to correlate the callback to your process instance you will need to define a correlation set.
    4. Whatever this is, but again, in BPEL it would be an <invoke>.