Package java classes (WSIF calls) in BPEL suitcase

0

Introduction

Is it possible to package java classes which are invoked through WSIF along with the BPEL Suitcase generated by bpelc?

I’ve noticed that when generating and deploying the suitcase using JDeveloper (10.1.3.x) – the class files are compiled to the output directory and packaged in the suitcase, but when I run the same build.xml via Ant (ant deploy-process), the class files are missing in the output directory and thus missing in the suitcase....

So, the question is what causes the difference and how can I achieve packaging the class files using Ant without Jdeveloper.

Apparently, the bpelc tasks can have nested elements of type zipfileset. (See the Ant documentation about this type). In here is the solution. Because there Oracle forgot to document and publish anything about the bpel ant tasks, I’ve decompiled the orabpel.jar package into it’s source files. By browsing through the files (Bpelc.java), you can find out what (command line) options are valid and what they are capable of (sort of).

Here is a how-to

You have to change the jdeveloper generated build.xml.

1st you have to add a "javac" task (if not already there) like below, and add it to build.xml:

&lt;target name=&quot;java-compile&quot; description=&quot;Compile Java source files&quot;&gt;<br />   &lt;echo&gt;<br />--------------------------------------------------------------<br />| Compiling java source files<br />--------------------------------------------------------------<br />   &lt;/echo&gt;<br />   &lt;javac destdir=&quot;${process.dir}/output&quot; encoding=&quot;UTF-8&quot; source=&quot;1.5&quot; target=&quot;1.5&quot;&gt;<br />     &lt;src path=&quot;src&quot;/&gt;<br />   &lt;/javac&gt;<br />&lt;/target&gt;<br />

2. Extend target "process-deploy" to depend it on target "java-compile".

It is important that the java gets compiled before the bpelc is executed. Like so:

&lt;target name=&quot;process-deploy&quot;<br />        depends=&quot;validateTask, java-compile, compile, deployProcess, deployTaskForm, deployDecisionServices&quot; /&gt;

3. Change the bpelc task by including a nested classes element that includes your class files, like so:

&lt;bpelc input=&quot;${process.dir}/bpel/bpel.xml&quot;<br />       out=&quot;${process.dir}/output&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rev=&quot;${rev}&quot;<br />       home=&quot;${bpel.home}&quot;&gt;<br />&nbsp;&nbsp; &lt;classes dir=&quot;${process.dir}/output&quot; includes=&quot;**/*.class&quot;/&gt;<br />&lt;/bpelc&gt;

When you run target "process-deploy", the class files are added to the bpel suitcase.

Further notice

Naturaly, if your class files are so generic that there can be used in other BPEL processes as well, the better option would be to jar the classes separately and put them in the $BPEL_HOME/lib directory where they are usable to all BPEL processes on the instance. This is instead of redundantly packaging the same classes in each BPEL suitcase.

 

Share.

About Author

Comments are closed.