commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rahul Akolkar" <>
Subject Re: [SCXML] two scxml questions
Date Wed, 09 Jul 2008 21:46:45 GMT
On 7/9/08, Wolfgang Rabl <> wrote:
> Hello,
>  Yes i will try the custom actions, but i dont think it would be a good idea
> to contribute my solution because I am quite unexperienced and it would not
> be a very good one :/ But i will see...
>  Nevertheless I have one further question regarding custom actions. As
> stated in
> it is possible to declare child Tags within the custom action if one
> implements the ExternalConten Interface. Are there any Examples for that? I
> do not know how to implement the necessary getExternalNodes() function.
> Whats the purpose of it? Is it to define the allowed childtags? and if so
> how are they defined? And how do i get access to the childtags within the
> execute funktion? It would realy be great if you could point me to an
> example implementation.

Its easier to work without child tags, if possible (often, its not, so
see text below :-).

Say you have a custom action like so (the semantics are not important
for the purposes of explaining the parsing):


Then the skeleton of the backing Action class may be implemented as:

  public static class MyAction extends Action implements ExternalContent {

    private List<Node> nodes = new ArrayList<Node>();

    public List<Node> getExternalNodes() {
      // this will be populated at parse time and used at execution time
      return nodes;

    public void execute(...) throws ... {
      // Execute <my:action>, whatever the semantics are given
      // the child nodes.
      for (Node n : nodes) {
        // In this case, above loop executes twice since the "nodes"
        // list contains <my:foo/> and <my:bar/>



>  thanks
>  Wolfgang

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message