Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 298498 - BPEL Plugin is not correctly initalizing variables
Summary: BPEL Plugin is not correctly initalizing variables
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: BPEL (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: BPEL UI Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-24 02:19 EST by grid.qian CLA
Modified: 2022-10-03 11:11 EDT (History)
0 users

See Also:


Attachments
patch for this issue (4.32 KB, patch)
2009-12-24 02:26 EST, grid.qian CLA
no flags Details | Diff
this is the latest patch for this bug. (3.31 KB, patch)
2009-12-24 02:38 EST, grid.qian CLA
no flags Details | Diff
the offical patch for this bug (674 bytes, patch)
2009-12-24 03:41 EST, grid.qian CLA
bbrodt: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description grid.qian CLA 2009-12-24 02:19:01 EST
Build Identifier: 

The BPEL plugin is not correctly initializing the variables.
1) Create a new Process
2) Add an Assign
3) Go to details
4) Click New
5) Select to copy from variable input/payload/inpuy
6) Select to copy to variable HelloWSPartnerLinkRequest.hello/name
7) Click away, it will prompt you to see if you want to create an Initializer
8) Click Yes

The code generate is this below. Running this process causes ODE to spit out this error: INFO [org.apache.ode.bpel.runtime.ASSIGN] (ODEServer-29) Assignment Fault: {http://docs.oasis-open.org/wsbpel/2.0/process/executable}selectionFailure,lineNo=80,faultExplanation=No results for expression: {OXPath10Expression name}

bpel:copy>
                <bpel:from>
                    <bpel:literal xml:space="preserve"><tns:hello xmlns:tns="http://jboss.com/examples/ws/Hello" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
</tns:hello>
</bpel:literal>
                </bpel:from>
                <bpel:to variable="HelloWSPartnerLinkRequest" part="hello"></bpel:to>
            </bpel:copy>

After days of trying various things, I then began comparing my example to the quick starts. I found the issue is 'name' is not being initialized. I hacked the code and added <name xmlns=""/> and it resolved the issue.

<bpel:assign validate="no" name="Assign-Input2Request">
            <bpel:copy>
                <bpel:from>
                    <bpel:literal xml:space="preserve">
                     <tns:hello xmlns:tns="http://jboss.com/examples/ws/Hello" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<name xmlns=""/>
</tns:hello>
</bpel:literal>
</bpel:from>
                <bpel:to part="hello" variable="HelloWSPartnerLinkRequest"></bpel:to>
            </bpel:copy> 




this bug is same to JBoss jira: https://jira.jboss.org/jira/browse/JBIDE-5394

Reproducible: Always
Comment 1 grid.qian CLA 2009-12-24 02:26:27 EST
Created attachment 155006 [details]
patch for this issue

This patch just change the MyDOMContentBuilderImpl to override it's super-class's visitCMElementDeclaration() method.
Only change a line from:
int min = Math.max(ed.getMinOccur(), forcedMin);
to:
int min = ed.getMinOccur() > 0 ? ed.getMinOccur() : 1

Because when a element has minOccur attribute = 0, the generated literal has not include the xml element.
Comment 2 grid.qian CLA 2009-12-24 02:38:51 EST
Created attachment 155007 [details]
this is the latest patch for this bug.

the first patch maybe some problems. commit a new patch.
Comment 3 grid.qian CLA 2009-12-24 03:41:26 EST
Created attachment 155008 [details]
the offical patch for this bug

Just now, chated with a WTP guy. He give a offical fix for this bug.
Comment 4 grid.qian CLA 2010-07-23 04:37:51 EDT
apply and test the patch
Comment 5 Robert Brodt CLA 2012-04-18 14:59:25 EDT
Comment on attachment 155008 [details]
the offical patch for this bug

Updated iplog flag for v1.0 release review.