Tuesday, September 16, 2008

How to perform manual copy of bpel code for faster development!! With out issues

What forced it?

Well as part of the BPEL development I had used a set of Enterprise Integration Patterns that each particular type of BPEL scope code should follow.

When each of those BPEL processes are created, they follow the same Pattern, a lot of code looked similar. But are not the same.

That where the catch was!!
SIMILAR but not the SAME!!!

What I wanted to do?

Well what I originally planned to do was to copy some of the code from one of the already built BPEL scope onto the new one I was building.
And I would be seamlessly able to reuse the stuff.

What that meant from code perspective was, I would like a scope from another BPEL code into my current BPEL code.
Well originally I though it was a brilliant idea. And finally it did turn up that way.
But it was damn hard till I figured out the trick. Not a trick actually but divide and conquer.

What are the problems I faced?

The first time I did that. I saw ERROR. Actually a brilliant one.
"XML parsing failed"

Nothing else. How the hell is that supposed to help me?

How did I make it work?

Well that is when I put my experimenting hand into the BPEL xml code.

The first thing you need to worry about are the non-declared variables that have come over as part of the copy process.
Resolution : declare them.

The second thing would be the name space that are new or namespaces that already exist.
Resolution : Either create the new namespace or when appropriate use the old namespace.

The third and the best helping hand is. Comment out groups of code. Leave a logical complete unit and compile. Follow the above steps. Fix apparent errors are they come.
Then go on to the next logical unit and repeat till finally you have completed the full Scope.

Just be aware of the Catch, if you have them. I hope you will as part of the scope. Copy them as well.

Why I like this better than drag and drop?

Some people advice not to do that but I prefer this better than the GUI to build.
If you ask me why? I would say this is damn faster to build.
And that is what brings me back into the BPEL xml code.

And the second reason is the way JDeveloper behaves.
Some times it does weired thing. Does not save thing that I have changed.
Some times goes back to the old code after I save.
It catches you by surprise some times as you are damn sure that you made the change that does not exist.

What is it with templates?

Some people recommend templates but they give complete BPEL template.
Not scopes to copy. But templates are good options if the BPEL processes are damn alike.

No comments: