Thursday, June 24, 2010

Apache ODE 1.3.4 released

Apache ODE 1.3.4 has been released recently. You can grab it from here http://ode.apache.org/getting-ode.html. It has a few new features and a lot of bugfixes.

First of new features is Instance Replayer (http://ode.apache.org/instance-replayer). In short, it's able to restore business process instance by reexecuting every step again based on incoming and outgoing instance communication (it mocks up outgoing requests).
The basic use cases for replayer are:
1. migrate existing log running instances to newest process version given their communication (incoming and outgoing requests)
2. reproduce error scenarios between two instances of ODE (eg. production and development)
Instance Replayer extends management api by 2 operations: replay and getCommunication. In order to do 1, you can invoke following request:
      <pmap:replay>
        <replay>
           <ns:upgradeInstance>1234</ns:upgradeInstance>
        </replay>
     </pmap:replay>



You get a new instance in the newest process version. The old one will be deleted.
In order to do 2, you need to retrieve exchanges from existing instance (or instances) by following request:
     <pmap:getCommunication>
        <getCommunication>
           <ns:iid>1234</ns:iid>
        </getCommunication>
     </pmap:getCommunication>



Then, you can execute replay operation on another ODE installation in order to replicate instance:
     <pmap:replay xmlns:ns="http://www.apache.org/ode/pmapi/types/2006/08/02/">
       <replay>
           <ns:restoreInstance>
           <ns:processType
xmlns:p="http://sample.bpel.org/bpel/sample">p:OnEventCorrelation</ns:processType>
           ... exchanges
           </ns:restoreInstance>
       </replay>
     </pmap:replay>



In order to have time control in bpel process, there is introduced special variable $ode:currentEventDateTime. It's equivalent to $fn:current-dateTime() standard XPath function during live session (while no replaying takes place) and it's set to corresponding time in past during replaying.

The next new feature is SMX4 OSGi bundle distibution. Some detailed information on how to configure it is here: http://ode.apache.org/smx4-osgi-deployment.html. In short, it's possible to deploy ODE and processes as OSGi bundles in ServiceMix4. This simplifies project structure compared to ServiceAssembly and ServiceUnit double zipped packages.

Third feature is small, but may be useful. It makes possible to define Spring properties and use them inside business process. All you need to do is to put beans.xml file in process directory (example is here: http://svn.apache.org/repos/asf/ode/tags/APACHE_ODE_1.3.4/jbi/src/test/resources/SpringPropertiesJbiTest/). You need to define bean of name properties, like this:
<beans>
  <util:properties id="properties">
      <prop key="weirdProp">myWeirdPropValue2</prop>
  </util:properties>
</beans>


ODE will instantiate it and you can use it later, like this:
 <bpws:assign>
   <bpws:copy>
     <bpws:from>ode:process-property('weirdProp')</bpws:from>
     <bpws:to>$output.payload</bpws:to>
   </bpws:copy>
 </bpws:assign>


2 comments:

  1. Hello, Rafal.

    Could you tell me Is it possible to replay process with its varibles values?

    When i replay instance of process, it begin from 1 scope, but i want instance continue execution from scope that was active in previous process. Is it possible?

    Regards, Sergio.

    ReplyDelete
  2. If I understand correctly, the only way you can do it is to replay the whole previous process instance again along with the new one. If you know iids for both of them, then this will look like that:

    <pmap:getCommunication>
    <getCommunication>
    <ns:iid>1234</ns:iid>
    <ns:iid>1235</ns:iid>
    </getCommunication>
    </pmap:getCommunication>

    And then replay with the result.
    There's no way to start replaying from the middle of an instance.

    ReplyDelete