Re: [SCXML] Need help returning from substate

2009-02-16 Thread Rahul Akolkar
On Mon, Feb 16, 2009 at 4:01 AM, Ouyang, Landon - ES/RDR -Gil
landon.ouy...@itt.com wrote:
 Where are the JUnit test suites located?  Can you give me a link?

snip/

Follow the link to the source in the overview on the building page:

  http://commons.apache.org/scxml/building.html

I'm traveling and the repository browsing isn't working for me, so
can't provide direct link to the individual tests ATM.

-Rahul



 --
 Landon Ouyang
 Senior Design Engineer
 ITT Electronics Systems, Radar Systems - Gilfillan
 7821 Orion Ave,
 Van Nuys, CA 91406
 (818) 901-2982


 -Original Message-
 From: Rahul Akolkar [mailto:rahul.akol...@gmail.com]
 Sent: Friday, February 13, 2009 3:59 PM
 To: Commons Users List
 Subject: Re: [SCXML] Need help returning from substate

 On Fri, Feb 13, 2009 at 4:48 PM, Ouyang, Landon - ES/RDR -Gil
 landon.ouy...@itt.com wrote:
 Background:  I have several states that need to call the same external 
 substate machine.  Once the substate machine has finished I need it to 
 return to the calling state.

 Question:  How can I get the substate machine to return to the calling state 
 without explicitly naming the calling state in the transition?

 snip/

 Rather than returning to calling state, think about it as waiting for
 the .done event related to the src'ed in state machine. Then the
 troublesome transition moves from the src'ed in state machine to the
 state with the src attribute. In terms of your example ...


 I have found bits and pieces in the archives and online but no good examples 
 or full explanations.
 Any pointers to online documentation for this would also be helpful.  Thanks.

 Code:
 I would like to return from the password.xml substate to the calling state 
 (SaveButton, ReloadButton, etc).  The tag transition event=e_Done
 target=* Back to Calling State*  / specifies a specific state However, 
 that state depends on the calling state.  How do I get it to return to the 
 calling state automatically?

 state id=SaveButton src=Password.xml 
transition event=e_Donetarget=SteadyState /
/state
 state id=ReloadButton src=Password.xml 
transition event=e_Donetarget=SteadyState /
/state

 snap/

 When the submachine in Password.xml runs to completion (which means it
 needs to have one or more final states), the $parentstate.done event
 will be generated (so in the above cases, SaveButton.done and
 ReloadButton.done respectively).

 state id=SaveButton src=Password.xml 
transition event=e_Done target=SteadyState /
!-- Take a transition on SaveButton.done when Password.xml runs
 to completion --
 /state
 state id=ReloadButton src=Password.xml 
transition event=e_Donetarget=SteadyState /
!-- Take a transition on ReloadButton.done when Password.xml runs
 to completion --
 /state

 This assumes that the state ControlGranted in the submachine below
 is changed to a final state (and is reached so the .done internal
 events are generated).

 There are a couple of test cases in the JUnit test suite that use this
 pattern, in case you want to look at a complete example.

 -Rahul



 Password.xml
 scxml xmlns=http://www.w3.org/2005/07/scxml;
   xmlns:my=http://www.ttt.com; version=1.0 
 initialstate=PasswordCheck
state id=PasswordCheck 
onentry
my:StateLog/
my:PasswordCheck/
/onentry
transition event=e_Donetarget=SteadyState /
transition event=e_validatetarget=PasswordValid /
transition event=e_allowtarget=ControlGranted /
/state
state id=PasswordValid 
onentry
my:StateLog/
my:PasswordValid/
/onentry
transition event=e_allowtarget=ControlGranted /
transition event=e_Donetarget= SteadyState  /
/state
state id=ControlGranted 
onentry
my:StateLog/
my:ControlGranted/
/onentry
transition event=e_Donetarget=* Back to Calling State*  
 /
/state
 /scxml


 --
 Landon Ouyang
 Senior Design Engineer
 ITT Electronics Systems, Radar Systems - Gilfillan
 7821 Orion Ave,
 Van Nuys, CA 91406
 (818) 901-2982



 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org


 This e-mail and any files transmitted with it may be proprietary and are 
 intended solely for the use of the individual or entity to whom they are 
 addressed. If you have received this e-mail in error please notify the sender.
 Please note that any views or opinions presented in this e-mail are solely 
 those of the author and do not necessarily represent those of ITT 
 Corporation. The recipient should check this e-mail and any attachments for 
 the presence of viruses. ITT accepts no liability for any damage caused by 
 any virus transmitted by this e-mail.

 

RE: [SCXML] Need help returning from substate

2009-02-16 Thread Ouyang, Landon - ES/RDR -Gil
The link to the source: 
http://svn.apache.org/repos/asf/commons/proper/scxml/trunk/

appears broken.

Any other suggestions of where to find example code??

--
Landon Ouyang
Senior Design Engineer
ITT Electronics Systems, Radar Systems - Gilfillan
7821 Orion Ave,
Van Nuys, CA 91406
(818) 901-2982


-Original Message-
From: Rahul Akolkar [mailto:rahul.akol...@gmail.com] 
Sent: Monday, February 16, 2009 9:32 AM
To: Commons Users List
Subject: Re: [SCXML] Need help returning from substate

On Mon, Feb 16, 2009 at 4:01 AM, Ouyang, Landon - ES/RDR -Gil
landon.ouy...@itt.com wrote:
 Where are the JUnit test suites located?  Can you give me a link?

snip/

Follow the link to the source in the overview on the building page:

  http://commons.apache.org/scxml/building.html

I'm traveling and the repository browsing isn't working for me, so
can't provide direct link to the individual tests ATM.

-Rahul



 --
 Landon Ouyang
 Senior Design Engineer
 ITT Electronics Systems, Radar Systems - Gilfillan
 7821 Orion Ave,
 Van Nuys, CA 91406
 (818) 901-2982


 -Original Message-
 From: Rahul Akolkar [mailto:rahul.akol...@gmail.com]
 Sent: Friday, February 13, 2009 3:59 PM
 To: Commons Users List
 Subject: Re: [SCXML] Need help returning from substate

 On Fri, Feb 13, 2009 at 4:48 PM, Ouyang, Landon - ES/RDR -Gil
 landon.ouy...@itt.com wrote:
 Background:  I have several states that need to call the same external 
 substate machine.  Once the substate machine has finished I need it to 
 return to the calling state.

 Question:  How can I get the substate machine to return to the calling state 
 without explicitly naming the calling state in the transition?

 snip/

 Rather than returning to calling state, think about it as waiting for
 the .done event related to the src'ed in state machine. Then the
 troublesome transition moves from the src'ed in state machine to the
 state with the src attribute. In terms of your example ...


 I have found bits and pieces in the archives and online but no good examples 
 or full explanations.
 Any pointers to online documentation for this would also be helpful.  Thanks.

 Code:
 I would like to return from the password.xml substate to the calling state 
 (SaveButton, ReloadButton, etc).  The tag transition event=e_Done
 target=* Back to Calling State*  / specifies a specific state However, 
 that state depends on the calling state.  How do I get it to return to the 
 calling state automatically?

 state id=SaveButton src=Password.xml 
transition event=e_Donetarget=SteadyState /
/state
 state id=ReloadButton src=Password.xml 
transition event=e_Donetarget=SteadyState /
/state

 snap/

 When the submachine in Password.xml runs to completion (which means it
 needs to have one or more final states), the $parentstate.done event
 will be generated (so in the above cases, SaveButton.done and
 ReloadButton.done respectively).

 state id=SaveButton src=Password.xml 
transition event=e_Done target=SteadyState /
!-- Take a transition on SaveButton.done when Password.xml runs
 to completion --
 /state
 state id=ReloadButton src=Password.xml 
transition event=e_Donetarget=SteadyState /
!-- Take a transition on ReloadButton.done when Password.xml runs
 to completion --
 /state

 This assumes that the state ControlGranted in the submachine below
 is changed to a final state (and is reached so the .done internal
 events are generated).

 There are a couple of test cases in the JUnit test suite that use this
 pattern, in case you want to look at a complete example.

 -Rahul



 Password.xml
 scxml xmlns=http://www.w3.org/2005/07/scxml;
   xmlns:my=http://www.ttt.com; version=1.0 
 initialstate=PasswordCheck
state id=PasswordCheck 
onentry
my:StateLog/
my:PasswordCheck/
/onentry
transition event=e_Donetarget=SteadyState /
transition event=e_validatetarget=PasswordValid /
transition event=e_allowtarget=ControlGranted /
/state
state id=PasswordValid 
onentry
my:StateLog/
my:PasswordValid/
/onentry
transition event=e_allowtarget=ControlGranted /
transition event=e_Donetarget= SteadyState  /
/state
state id=ControlGranted 
onentry
my:StateLog/
my:ControlGranted/
/onentry
transition event=e_Donetarget=* Back to Calling State*  
 /
/state
 /scxml


 --
 Landon Ouyang
 Senior Design Engineer
 ITT Electronics Systems, Radar Systems - Gilfillan
 7821 Orion Ave,
 Van Nuys, CA 91406
 (818) 901-2982



 -
 To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
 For additional commands, e-mail: user-h...@commons.apache.org


 This e-mail and any files transmitted with it may be proprietary and are 
 intended 

DBUTILs Problem with BasicRowProcessor

2009-02-16 Thread Lucy Cameron
I'm having an issue using DBUtils BasicRowProcessor. I'm trying to use the
method  toBeanList(ResultSet rs, Class type). The sybase stored procedure
that provides the resultset uses aliases however it would appear that these
aliases aren't getting picked up in order to be mapped to the java bean.
Withnin the mapColumnsToProperties method
the column names are the actual column names rather than that alias.
Anyone know what i'm doing wrong ?

Thanks,


Re: JXPath over Generic Collection?, How?

2009-02-16 Thread Andrew Hughes
Ping... if anyone can help with this JXPath  DynaBeans problem I'd be
REALLY THANKFUL :)

On Fri, Feb 13, 2009 at 1:55 PM, Andrew Hughes ahhug...@gmail.com wrote:

 Howdy,
 I've taken Matt's suggestion onboard and I have investigated DynaBeans.
 These look pretty good for all intestive purposes and there's a code
 examples below how to build the data structure:

 + root [...@name=ROOT]
 + animal [...@name=ANIMAL]
 + dog [...@name=DOG]
 + boxer [...@name=BOXER]
 + labrador [...@name=LABRADOR]
 + cat [...@name=CAT]
 + tiger [...@name=TIGER-ONE]
 + tiger [...@name=TIGER-TWO]
 + tiger [...@name=TIGER-THREE]
 + lion [...@name=LION]


 And the code looks like...

  LazyDynaBean lazyDynaBean = new LazyDynaBean(); //the transparent root.
  LazyDynaBean root = new LazyDynaBean();
 LazyDynaBean animal = new LazyDynaBean();
  LazyDynaBean dog = new LazyDynaBean();
 LazyDynaBean cat = new LazyDynaBean();
  LazyDynaBean boxer = new LazyDynaBean();
 LazyDynaBean labrador = new LazyDynaBean();
  LazyDynaBean tiger1 = new LazyDynaBean();
 LazyDynaBean tiger2 = new LazyDynaBean();
  LazyDynaBean tiger3 = new LazyDynaBean();
 LazyDynaBean lion = new LazyDynaBean();
  //set the @name property of each bean, user UPPER to make them distinct
 for examples.
 root.set(name,ROOT);
  animal.set(name,ANIMAL);
 dog.set(name,DOG);
  cat.set(name,CAT);
 boxer.set(name,BOXER);
  labrador.set(name,LABRADOR);
 tiger1.set(name,TIGER-ONE);
  tiger2.set(name,TIGER-TWO);
 tiger3.set(name,TIGER-THREE);
  lion.set(name,LION);
 //build the bean hierarchy.
  lazyDynaBean.set(root,0, root);
 root.set(animal,0, animal);
  animal.set(dog,0,dog);
 animal.set(cat,0,cat);
 dog.set(labrador,0,labrador);
  dog.set(boxer,0, boxer);
 cat.set(tiger,0,tiger1);//duplicate
  cat.set(tiger,1,tiger2);//duplicate
 cat.set(tiger,1,tiger3);//duplicate
  cat.set(lion,0,lion);
 JXPathContext context = JXPathContext.newContext(lazyDynaBean);
 String query = /root/animal/cat/tiger;
 Object value = context.getValue(query);


 But there's a problem with JXPath querying this also. Absolute Paths like
  '/root/animal/cat/tiger' or '/root/animal/cat/tiger'[2]' work perfectly.
 But I don't have anyluck doing deep searches. For examples the following
 just won't work.
 '//cat'
 //*...@name='LION']
 /root/animal/cat/tig...@name='TIGER-TWO']

 Things are looking up, but is this behavior to be expected?

 Cheers,
 --AH


 On Thu, Feb 12, 2009 at 6:43 AM, Matt Benson gudnabr...@yahoo.com wrote:





 --- On Wed, 2/11/09, Andrew Hughes ahhug...@gmail.com wrote:

  From: Andrew Hughes ahhug...@gmail.com
  Subject: Re: JXPath over Generic Collection?, How?
  To: Commons Users List user@commons.apache.org
  Date: Wednesday, February 11, 2009, 4:19 AM
  Still No Luck, I have removed recursive generic collections
  and have tried
  the following code... this is becoming a marathon effort
  :'(
 
  public class Thing {
 
  public Thing(String name) {
  this.name = name;
  }
  private String name = ;
 
  public String getName() {
  return name;
  }
  private ArrayListThing children = new
  ArrayListThing();
 
  public ArrayListThing getChildren() {
  return children;
  }
 
  }
 
 
  public static void main(String[] args) {
  //get some same data
  Thing animal = new Thing(Animal);
  //Animal.Dog.*
  Thing dog = new Thing(Dog);
  dog.getChildren().add(new
  Thing(Labrador));
  dog.getChildren().add(new
  Thing(Boxer));
  animal.getChildren().add(dog);
  //Animal.Cat.*
  Thing cat = new Thing(Cat);
  cat.getChildren().add(new Thing(Lion));
  cat.getChildren().add(new
  Thing(Tiger));
  animal.getChildren().add(cat);
 
  //run a query on it
  JXPathContext context =
  JXPathContext.newContext(animal);
  String query = /Animal;
  Thing result = (Thing) context.getValue(query);
  String path = context.getPointer(query).asPath();
  System.out.println(Ran ' + query +
  ' and got ' +
  result.getName() + ' on path ' + path +
  '.);
  }
 

 What would you be trying to select?  If you want to know how to look for a
 given Thing in this graph, I can probably help.  If you want to know what
 graph will allow you to use a preconceived notion of the xpath you want to
 use, that will be harder.  You might use [beanutils] dynabeans in
 conjunction with [jxpath] to try and achieve the latter.

 -Matt

 
 
 
  On Wed, Feb 11, 2009 at 3:08 PM, Andrew Hughes
  ahhug...@gmail.com wrote:
 
   Yeah, that makes sense. The part that was confusing me
  is that if I
   have...
  
   public class Thing {
  
  private ListThing children;
  
   }
  
   I was assuming I would need to prefix all of my
  expressions steps with
   '/children'. From what you said earlier this
  is not the case as 

Re: Commons Monitoring JAR available?

2009-02-16 Thread nicolas de loof
Hi
snapshot jars are available in snapshot repo :
http://people.apache.org/repo/m2-snapshot-repository/org/apache/commons/monitoring/

Cheers,
Nicolas

On Mon, Feb 16, 2009 at 9:38 PM, Ryan VanMiddlesworth ry...@ontko.comwrote:

 I'm interested in using the Commons Monitoring project in Sandbox.  From
 looking at the docs it seems like it's at least well designed.  However, I
 notice that there is no JAR available.  (Or perhaps I just cannot find it.)
 Is it standard practice for Sandbox projects to not have binaries available
 or is it that up to the developers in charge of the project?

 I can certainly do my own compiling, but it would definitely be nice to not
 have to do that, and it would probably boost project popularity to have
 binaries available.

 Thanks for the great work!

 Ryan VanMiddlesworth