New branch: 'src' attribute for <data> and <template>

6 views
Skip to first unread message

Antonio García Domínguez

unread,
Jan 27, 2012, 4:30:41 PM1/27/12
to bpel...@googlegroups.com
Hi everyone,

I've pushed a few commits to a new branch at my Github repository:


I see Daniel recently added the <xmlFile> element to use an external file to load <data>. That was neat, but I thought adding 'src' to <data> and <template> would be more consistent. In addition, having 'src' for <template> would help users avoid some of the complications behind including Velocity templates (which may not be valid XML documents) inside a BPTS.

These commits add 'src' to <data> and <template> while preserving <xmlFile>. I've also touched up the code in SpecificationLoader so we don't have to change the BPTS' document tree on the fly. It didn't make sense when we loaded a template file as a raw string only to convert it to XML (losing the advantage of being able to use templates that *aren't* valid XML) and then back to a string. For consistency, I did the same for the other cases (regular <data>, <data> with src and <xmlFile>).

Daniel, could you have a look at the branch? It passes all tests, but I still have to try it out tomorrow on the actual .bpts I needed it for. It's going to have the same large template in several places, and I didn't want to copy and paste it all over the place. We've generated the template using our ServiceAnalyzer tool, and we'll feed it random data generated using another tool we have, so we can study its behaviour at certain program points.

Cheers,
Antonio

Daniel Luebke

unread,
Jan 28, 2012, 6:08:49 AM1/28/12
to bpel...@googlegroups.com

Hi Antonio,

in my branch there is also the src attribute :-) We need to merge this. I removed the xmlfile completely. It was only in a dev branch and Not officially in a release. The changes in the SpecificationLoader sound very good.

Regards
Daniel

Antonio García Domínguez

unread,
Jan 28, 2012, 9:09:12 AM1/28/12
to bpel...@googlegroups.com
Hi Daniel,

I see you have a few commits on the master branch and then a few more on the ws-ht branch. Can I merge dluebke/ws-ht or dluebke/master with bpelunit/master? Does it pass all tests?

Once we've merged your work into bpelunit/master, then I'll try and merge bluezio/src-attr-data+templates. Perhaps we can still use the improvements in SpecificationLoader.

Cheers,
Antonio

Antonio García Domínguez

unread,
Jan 28, 2012, 10:18:01 AM1/28/12
to bpel...@googlegroups.com
Hi Daniel,

I've merged dluebke/master with bluezio/master and pushed it to bpelunit/master. All tests pass and everything seems to work.

I'll try merging ws-ht into the new master now, and see if it works.

Cheers,
Antonio

Antonio García Domínguez

unread,
Jan 28, 2012, 11:01:56 AM1/28/12
to bpel...@googlegroups.com
Hi Daniel,

I've merged dluebke/ws-ht into bpelunit/master and pushed it to bluezio/ws-ht. After a few extra commits, all tests pass. I've switched back on 2 tests that you disabled because we were getting false negatives: I've switched those tests to using a proper XML comparison library (XmlUnit) instead of a simple string comparison.

Could you rebase the work you haven't pushed yet into bluezio/ws-ht? I'll have a look at the 'src' attribute for <dataSource> and <template> now: I think I'll probably have to redo the changes in the original src-attrib-data+templates from scratch.

Cheers,
Antonio

Daniel Luebke

unread,
Jan 28, 2012, 12:34:50 PM1/28/12
to bpel...@googlegroups.com

Hi, I had pushed all my changes, so you should have all that I have...
I implemented the src attribute by changing the AnyElement type so that it is possible to use src everywhere instead of embedded XML. But the generic import routine is probably superflicious if your specification loader is merged in...
Sorry for the double work...
XmlUnit is a great idea...

Regards,
Daniel

Antonio García Domínguez

unread,
Jan 28, 2012, 12:55:54 PM1/28/12
to bpel...@googlegroups.com
Hi Daniel,

I've finished reimplementing version 2 of our support for the 'src' attribute in <data> and <template>. It passes all tests, so I've pushed it to bluezio/master and bpelunit/master. I'll use it now for a while and fix any issues that crop up :-).

Hi, I had pushed all my changes, so you should have all that I have...

OK then: I was just making sure we had everything :-). I had to add a null check to some function as it would produce a NullPointerException when there were no condition groups defined. Otherwise, some of the tests would fail.

I implemented the src attribute by changing the AnyElement type so that it is possible to use src everywhere instead of embedded XML. But the generic import routine is probably superflicious if your specification loader is merged in...

Yup, it's not really necessary anymore, so I removed that. Basically, when parsing a <send> attribute we check if <data> or <template> have the src attribute. If they do, we use the loaded file to initialize the activity, instead of modifying the objects produced by XMLBeans. This also allows us to safely load Velocity templates that are not valid XML documents through the 'src' attribute, which wouldn't be possible with the previous method.

Sorry for the double work...

No problem :-). Shouldn't we write some documentation on the new WS-HT support?

XmlUnit is a great idea...

Yup, I've been using it in a few other projects and it's pretty handy. You can also tell it what kind of differences you want to ignore. For instance, we ignore prefixes (t:testSuite should be the same as bpelunit:testCase if they both point to the same namespace URI). It's quite handy.

Regards,
Antonio

Daniel Luebke

unread,
Jan 29, 2012, 3:44:53 AM1/29/12
to bpel...@googlegroups.com

I have not finished the Ui for WS-HT yet :-( Then I will document it. Have you insert the Code for importing Files to <send> only or to the <completeTask>as well? If not, I'll do...

Antonio García Domínguez

unread,
Jan 29, 2012, 9:45:26 AM1/29/12
to bpel...@googlegroups.com
Hi Daniel,

On 29 January 2012 09:44, Daniel Luebke <daniel...@gmail.com> wrote:
> I have not finished the Ui for WS-HT yet :-( Then I will document it. Have
> you insert the Code for importing Files to <send> only or to the
> <completeTask>as well? If not, I'll do...

No, I haven't. I've only added it to <data> and <template> inside
<send>, I'm afraid. <template>'s src needs to be handled differently
from <data>'s src, as we need to be able to import Velocity templates
that are not well-formed XML documents.

Antonio

Reply all
Reply to author
Forward
0 new messages