You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by amina mimouni <am...@gmail.com> on 2008/06/30 11:46:59 UTC

state machine creation

hello,

1-i'am newbie in scxml, i would like to have programme example of state
machine creation in Java language (with scxml librairies)
2-the whole of scxml meta model in ecore ou genmodel if it is possible

this is my example but the fireEvents doesn't work , i don't what i did
wrong

        scxmlSM.addChild(init);
        scxmlSM.addChild(trans);
        scxmlSM.addChild(sms);
        scxmlSM.addChild(fin);
        System.out.println();

        //---------------AbstrastStateMachine----------------------------//

        SCXML scxml = new SCXML();

        statemachine sm = new statemachine(scxmlSM);
        sm.fireEvent("translatorwithsms.start");

    }

    public void translator() {

        System.out.println("i'am translating");
    }

    public void sendsms() {
        System.out.println("sending sms");
    }

}

/***related class****/

import org.apache.commons.scxml.model.*;

public class transitiontarget extends TransitionTarget
{
    private static final long serialVersionUID = 1L;

    public transitiontarget (){
        super();
    }

}


thanks

Re: [SCXML] state machine creation

Posted by Rahul Akolkar <ra...@gmail.com>.
Please use the [SCXML] prefix to email subjects (this is a shared
list). I've added it here.

On 6/30/08, amina mimouni <am...@gmail.com> wrote:
> hello,
>
>  1-i'am newbie in scxml,
<snip/>

Reading the following pointers is a decent starting point to get a
feel of the usage patterns when using the library:

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

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

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

  http://commons.apache.org/scxml/0.8/apidocs/index.html


> i would like to have programme example of state
>  machine creation in Java language (with scxml librairies)
<snap/>

For users beginning with the library, using the IO package
(SCXMLParser class etc.) to read SCXML documents (and define state
machines) is generally recommended. It is possible to create state
machines programmatically, but we don't have any ready examples I can
point to.


>  2-the whole of scxml meta model in ecore ou genmodel if it is possible
>
<snip/>

Commons SCXML does not define an Ecore model.


>  this is my example but the fireEvents doesn't work , i don't what i did
>  wrong
>
>         scxmlSM.addChild(init);
>         scxmlSM.addChild(trans);
>         scxmlSM.addChild(sms);
>         scxmlSM.addChild(fin);
>         System.out.println();
>
<snap/>

Could you describe it via an SCXML document instead?


>         //---------------AbstrastStateMachine----------------------------//
>
>         SCXML scxml = new SCXML();
>
>         statemachine sm = new statemachine(scxmlSM);
>         sm.fireEvent("translatorwithsms.start");
>
>     }
>
>     public void translator() {
>
>         System.out.println("i'am translating");
>     }
>
>     public void sendsms() {
>         System.out.println("sending sms");
>     }
>
>  }
>
>  /***related class****/
>
<snip/>

Sorry, I did not understand what this class below is doing in the
context of the rest of your example.

-Rahul


>  import org.apache.commons.scxml.model.*;
>
>  public class transitiontarget extends TransitionTarget
>  {
>     private static final long serialVersionUID = 1L;
>
>     public transitiontarget (){
>         super();
>     }
>
>  }
>
>
>  thanks
>

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