[jboss-user] [JBoss jBPM] - Re: BPEL beta2 - switch condition boolean true/false

KVAK_TNT do-not-reply at jboss.com
Mon Oct 9 04:57:02 EDT 2006


It seems to be a problem only related to boolean.
If I change it to INT it works fine.

Here some stuff that you wanted:
partner-wsdl-file (functional):

  | <message name="checkGuardRequest">
  | 	<part name="Ticketnumber" type="xsd:int"></part>
  | 	<part name="SomeStuffIn" type="xsd:string"></part> (Dummypart here)
  | </message>
  | <message name="checkGuardResponse">
  | 	<part name="ValueOUT" type="xsd:int"></part>
  | </message>
  | 
  | <operation name="checkGuard">
  | 	<input message="agi:checkGuardRequest"></input>
  | 	<output message="agi:checkGuardResponse"></output>
  | </operation>
  | 

partner-wsdl-file (non-functional):

  | <message name="checkGuardRequest">
  | 	<part name="Ticketnumber" type="xsd:int"></part>
  | 	<part name="SomeStuffIn" type="xsd:string"></part> (Dummypart here)
  | </message>
  | <message name="checkGuardResponse">
  | 	<part name="ValueOUT" type="xsd:boolean"></part>
  | </message>
  | 
  | <operation name="checkGuard">
  | 	<input message="agi:checkGuardRequest"></input>
  | 	<output message="agi:checkGuardResponse"></output>
  | </operation>
  | 


partner_impl.java (functional):

  | 	public int checkGuard(int ticketnumber, String SomeStuffIn) throws RemoteException {
  | 		//This code is for test purposes only!
  | 		//So I can change my output value without changing code and redeploy.
  | 		boolean bool;
  | 		int returnvalue=-1; //initialize and errorcode
  | 		System.out.println("****    checkGuard    ****");
  | 		System.out.println("\tINPUT:: ticketnumber: "+ticketnumber+"\tSomeStuffIN: "+SomeStuffIN);
  | 		Random random = new Random();
  | 		bool = random.nextBoolean();
  | 		
  | 		if (bool == true)
  | 			returnvalue = 1;
  | 		if (bool == false)
  | 			returnvalue = 2;
  | 		
  | 		System.out.println("\tOUTPUT:: "+ returnvalue);
  | 		return returnvalue;
  | 	}
  | 

partner_impl.java (non-functional):

  | 	public boolean checkGuard(int ticketnumber, String SomeStuffIn) throws RemoteException {
  | 		boolean bool;
  | 		System.out.println("****    checkGuard    ****");
  | 		System.out.println("\tINPUT:: ticketnumber: "+ticketnumber+"\tSomeStuffIN: "+SomeStuffIN);
  | 		Random random = new Random();
  | 		bool = random.nextBoolean();
  | 
  | 		System.out.println("\tYour returnvalue will be:: "+ bool);
  | 
  | 		return bool;
  | 		//Also not functional:
  | 		//return true;
  | 		//return false;
  | 	}
  | 


Part of my.bpel (functional):

  | 		<variable messageType="agi:checkGuardRequest" name="checkGuardReq"/>
  | 		<variable messageType="agi:checkGuardResponse" name="checkGuardRes"/>
  | 				<assign name="checkConditions">
  | 					<copy>
  | 						<from part="Ticketnumber" variable="nReq"/>
  | 						<to part="Ticketnumber" variable="checkGuardReq"/>
  | 					</copy>
  | 					<copy>
  | 						somestuff
  | 					</copy>
  | 				</assign>
  | 				<invoke inputVariable="checkGuardReq" operation="checkGuard" outputVariable="checkGuardRes" partnerLink="agilpro" portType="agi:AgilproIssuer"/>
  | 				<switch name="SplitVertriebschef">
  | 					<case condition="bpel:getVariableData('checkGuardRes', 'ValueOUT')=1">
  | 						<sequence>
  | 							somestuff
  | 						</sequence>
  | 					</case>
  | 					<case condition="bpel:getVariableData('checkGuardRes', 'ValueOUT')=0">
  | 						<empty />
  | 					</case>
  | 					<otherwise>
  | 						<empty />
  | 					</otherwise>
  | 				</switch>
  | 

Part of my.bpel (non-functional):

  | 		<variable messageType="agi:checkGuardRequest" name="checkGuardReq"/>
  | 		<variable messageType="agi:checkGuardResponse" name="checkGuardRes"/>
  | 				<assign name="checkConditions">
  | 					<copy>
  | 						<from part="Ticketnumber" variable="nReq"/>
  | 						<to part="Ticketnumber" variable="checkGuardReq"/>
  | 					</copy>
  | 					<copy>
  | 						somestuff
  | 					</copy>
  | 				</assign>
  | 				<invoke inputVariable="checkGuardReq" operation="checkGuard" outputVariable="checkGuardRes" partnerLink="agilpro" portType="agi:AgilproIssuer"/>
  | 				<switch name="SplitVertriebschef">
  | 					<case condition="bpel:getVariableData('checkGuardRes', 'ValueOUT')=true()">
  | 						<sequence>
  | 							somestuff
  | 						</sequence>
  | 					</case>
  | 					<case condition="bpel:getVariableData('checkGuardRes', 'ValueOUT')=false()">
  | 						<empty />
  | 					</case>
  | 					<otherwise>
  | 						<empty />
  | 					</otherwise>
  | 				</switch>
  | 
  | 
my Variable checkGuardRes with its ValueOUT should have the boolean true or false as value. But It seems that he doesn't really check this value - there seems to be some issue as it allways started the first condition. Maybe only my condition is wrong? But I havent found NOWHERE any example that may fit my case...

I hope this will help you. I have changed my code to int values - so I have more options for returnvalues and it works :-)

Greetings

Claus

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3976914#3976914

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3976914



More information about the jboss-user mailing list