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 92420 - Incorrect OutputVariableForOneWayOperation implementation
Summary: Incorrect OutputVariableForOneWayOperation implementation
Status: VERIFIED FIXED
Alias: None
Product: soa
Classification: Unclassified
Component: BPEL Validation (show other bugs)
Version: 5.x
Hardware: All All
: P1 blocker (vote)
Assignee: Michael Frisino
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-12 10:55 UTC by Michael Frisino
Modified: 2007-01-22 11:14 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Frisino 2007-01-12 10:55:25 UTC
The implementation of the validation rule that is supposed to indicate invalid
presence of output variable or fromPart in the case of a one-way Invoke is broken.

Steps to reproduce.
Validate AsynchronousSample.


XML validation started.
C:/Documents and
Settings/Mike/AsynchronousSample/AsynchronousSample/src/AsynchronousSample.bpel:42,6
For <invoke>, one-way invocation requires only the inputVariable (or its
equivalent <toPart>?s) since a response is not expected as part of the
operation. The outputVariable (or its equivalent <fromPart>?s) must be only
specified for request-response invocations.

This is incorrect because the Invoke does not have an output variable or from part.

      <invoke name="end"  
              partnerLink="partnerLinkA"
              portType="wsdlNS:MyCallbackPortType" 
              operation="onResult"
              inputVariable="outputVar"/>


Fix:
The problem is in the class BPELStaticAnalysisHelper 
method BPELStaticAnalysisHelper

The if condition is incorrect, both the 2nd and 3rd conditions I believe are the
inverse of what they should be.

            if ( invoke.getOutputVariable()!= null
                    || invoke.getFromPartContaner()==null || 
                    invoke.getFromPartContaner().sizeOfFromParts() == 0 )
            {
                addError( FIX_OUTPUT_VARIABLE_FOR_ONE_WAY_OP , invoke );
            }


I am changing it to be.

            if ( invoke.getOutputVariable()!= null
                    || (invoke.getFromPartContaner()!=null && 
                    invoke.getFromPartContaner().sizeOfFromParts() > 0) )
            {
                addError( FIX_OUTPUT_VARIABLE_FOR_ONE_WAY_OP , invoke );
            }     

Notice difference in both 2nd and 3rd conditionals.

However, I want Denis to review. I am not sure if we need the 3rd condition at
all. I left it in to be safe. Denis, please review.
Comment 1 Michael Frisino 2007-01-12 11:12:42 UTC
fixed - but want Denis to review.
Comment 2 Denis Anisimov 2007-01-15 12:47:25 UTC
Reviewed.

Original code was written by me and there was stupid mistake.
Current code ( corrected by Mike ) is correct.
Comment 3 Michael Frisino 2007-01-22 11:14:48 UTC
i have verified