This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 81975 - BPEL Validation does not validate invalid xpath functions
Summary: BPEL Validation does not validate invalid xpath functions
Status: VERIFIED FIXED
Alias: None
Product: soa
Classification: Unclassified
Component: BPEL (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: Denis Anisimov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-05 00:06 UTC by malkit
Modified: 2006-10-05 15:01 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
BPEL File (2.58 KB, text/xml)
2006-08-05 00:08 UTC, malkit
Details
WSDL File (2.06 KB, text/xml)
2006-08-05 00:08 UTC, malkit
Details

Note You need to log in before you can comment on or make changes to this bug.
Description malkit 2006-08-05 00:06:59 UTC
If you have invlalid function in BPEL, Validation does not complain. For example
refer attached BPEL and WSDL file. If you change the contact function to make it
invalid (say make it concat1), the BPEL validation does not complain also the
BPEL  project builds fine only throwing excetion at runtime.
Comment 1 malkit 2006-08-05 00:08:13 UTC
Created attachment 32564 [details]
BPEL File
Comment 2 malkit 2006-08-05 00:08:26 UTC
Created attachment 32565 [details]
WSDL File
Comment 3 Michael Frisino 2006-08-23 04:14:06 UTC
Denis, do you think we can leverage the same XPath helpers that we used in
refactoring to check for xpath validity.
Comment 4 Denis Anisimov 2006-08-23 20:10:19 UTC
I think we can write one more validation for checking function names in xpath.
This should be additional validator (references validation is different feature).
So this could be new validatior.
Comment 5 Michael Frisino 2006-08-23 20:31:05 UTC
What about general "broken syntax" in xpath expression. For instance, if
someoene manually edits the xpath string and creats a invalid expression.

I don't think we need to provvide very detailed xpath validation - though that
would be nice. I think the concern is that invalid expressions be detected
before deployment.
Comment 6 Denis Anisimov 2006-08-24 05:36:41 UTC
I already thought of this also.

The only problem here that could be appear is in determening where such
xpath expression can be found. It seems in all cases where 
xpath can appear is Text Node in some Bpel element.
But sometimes Text can contain not xpath expression and this is not incorrect.
This can be normal case.
So I need algorithm ( that is not obvious for me currently ) : when I should 
consider srting as xpath and check it against xpath and when I shouldn't do this.
Comment 7 malkit 2006-08-24 06:50:08 UTC
I am not sure if this is relevent here, but here is what we do for runtime.

During deployment we parse the expression for the activitiy elements that can 
contain expression such as If, ElseIf, To, RepeatUntil, From, While, When, 
Case, ForEach etc., mailnly to get the list of xpath variables so that during 
runtime the expression can be evaluated by declaring these variables with 
variable data on the context. 

For parsing we have xpathmodel which uses Jxapth's Parser.compileExpression to 
parse the expression. 

I can provide more info if needed.
Comment 8 Denis Anisimov 2006-08-24 06:57:40 UTC
We do the same when we perform validation on broken references in xpath.

BUT as I said expression can be present not XPATH expression sometimes.
This is normal situation. And I don't see easy way to understand 
how to distinguish incorrect xpath expression from correct non-xpath expression.
Comment 9 malkit 2006-08-24 07:26:38 UTC
Can you give some example, i dont seem to understand what you mean by not 
xpath expression.
Comment 10 Denis Anisimov 2006-08-24 10:06:51 UTC
Unfortunately I cannot represent concrete example here.
But this definition for from one of possible :

<from expressionLanguage="anyURI"?>expression</from>

so one can have expression that is not xpath but correct.
Comment 11 Denis Anisimov 2006-08-29 11:30:58 UTC
Fixed with corrected description.
Comment 12 Denis Anisimov 2006-08-29 11:32:32 UTC
Closed by error.
Comment 13 Denis Anisimov 2006-09-06 14:50:07 UTC
It is fixed.
But error message is retrieved from exception that appears while parsing XPath
expression. In the case when function name is invalid method parseExpression()
throw Exception. In this case I create error message based on information in
exception message. This can be is not good. But I don't know another method to
create informational message.
Comment 14 malkit 2006-09-06 16:18:23 UTC
I think it is good. I am doing the same for during deployment.
Comment 15 Andrey Yamkovoy 2006-10-05 15:01:37 UTC
Seems was fixed.