Git Product home page Git Product logo

Comments (5)

alexzhornyak avatar alexzhornyak commented on June 9, 2024

I do not see any <send> elements with attribute 'delay' or 'delayexpr' in your SCXML source code! If you mean another subject then explain detaily, please.

image

I offer you to use Visual SCXML Editor that supports local debugging and test locally the behaviour of your statemachine.
You may open Issue_5.zip with the editor.

Recommended SCXML Code Standard

  1. It is not recommended to use same names for states and data fields
    image

  2. It is not recommended to use names for states that differ only by case
    image

from scxml-tutorial.

seenivasanmca avatar seenivasanmca commented on June 9, 2024

<datamodel>
<!--<data id="sensordata" src="http://loaclhost:8080/retrive/sensor/data?hk200300,hk1720"-->

<data id="sensorData" src="http://localhost:8080/sensordata.json"/>
    <data id="detectionparam" src="http://localhost:8080/sample.json" />
    <data id="dp1"/>
    <data id="dp2" />
	 <data id="dp3" expr="true"/>
	 <data id="dp4" />


</datamodel>



<state id="No_Fault">



    <!-- <transition cond="true" target="Fault"/> -->
    <onentry>




                
         <assign location="dp1" expr="sensorData.HK_200300 &lt; 25" />
        <assign location="dp2" expr="true" />
		<assign location="dp4" expr="true"/>



        <log label="DP1 Value On Entry" expr="dp1" />
		            <log label="DP3 Value On Entry" expr="dp3" />

		<send  event="ec1" delay="5s"/>
		

    </onentry>


    <transition event="'ec1'" cond="dp1 or dp2 or dp3" target="Fault">
	
        <log label="DP1" expr="dp1" />
        <log label="DP2" expr="dp2" />
        <log label="DP3" expr="dp3" />
    </transition>

    <onexit>
        <log label="DP1 Value On Exit" expr="dp1" />
    </onexit>




</state>



<state id="Fault" initial="Root_Cause">



    <datamodel>
        <data id="rc1" />
        <data id="rc2"/>
        <data id="rc3"/>
		<data id="fm1"/>
    </datamodel>



    <parallel id="Root_Cause">
        <state id="RC1" initial="RC1_Initial">



            <state id="RC1_Initial">
                <transition cond="rc1" target="rc1" />
            </state>



            <final id="rc1">
            <onentry>
            <log label="Fault RC1" expr="rc1" />
            </onentry>
            </final>




        </state>





        <state id="RC2" initial="RC2_Initial">



            <state id="RC2_Initial">
                <transition cond="rc2" target="rc2" />
            </state>



            <final id="rc2">
            <onentry>
            <log label="Fault RC2" expr="rc2" />
            </onentry>
            </final>
            
        </state>



        <state id="RC3" initial="RC3_Initial">



            <state id="RC3_Initial">
                <transition cond="rc3" target="rc3" />
            </state>



            <final id="rc3">
            <onentry>
            <log label="Fault RC3" expr="rc3" />
            </onentry>
            </final>



        </state>



        <transition target="Fault_Mode" />
    </parallel>





    <parallel id="Fault_Mode">
        <state id="FM1" initial="FM1_Check">
            <state id="FM1_Check">
            <transition cond="fm1" target="fm1"/>
            </state>
            
            <final id="fm1">
            <onentry>
            <log label="Fault Mode FM1" expr="fm1" />
            </onentry>
            </final>
        </state>



        <state id="FM2">
            <onentry>
                <log label="FM2" />
            </onentry>
        </state>
    </parallel>



</state>

from scxml-tutorial.

seenivasanmca avatar seenivasanmca commented on June 9, 2024

update scxml with delay attribute

<datamodel>
<!--<data id="sensordata" src="http://loaclhost:8080/retrive/sensor/data?hk200300,hk1720"-->

<data id="sensorData" src="http://localhost:8080/sensordata.json"/>
    <data id="detectionparam" src="http://localhost:8080/sample.json" />
    <data id="dp1"/>
    <data id="dp2" />
	 <data id="dp3" expr="true"/>
	 <data id="dp4" />


</datamodel>



<state id="No_Fault">



    <!-- <transition cond="true" target="Fault"/> -->
    <onentry>




                
         <assign location="dp1" expr="sensorData.HK_200300 &lt; 25" />
        <assign location="dp2" expr="true" />
		<assign location="dp4" expr="true"/>



        <log label="DP1 Value On Entry" expr="dp1" />
		            <log label="DP3 Value On Entry" expr="dp3" />

		<send  event="ec1" delay="5s"/>
		

    </onentry>


    <transition event="'ec1'" cond="dp1 or dp2 or dp3" target="Fault">
	
        <log label="DP1" expr="dp1" />
        <log label="DP2" expr="dp2" />
        <log label="DP3" expr="dp3" />
    </transition>

    <onexit>
        <log label="DP1 Value On Exit" expr="dp1" />
    </onexit>




</state>



<state id="Fault" initial="Root_Cause">



    <datamodel>
        <data id="rc1" />
        <data id="rc2"/>
        <data id="rc3"/>
		<data id="fm1"/>
    </datamodel>



    <parallel id="Root_Cause">
        <state id="RC1" initial="RC1_Initial">



            <state id="RC1_Initial">
                <transition cond="rc1" target="rc1" />
            </state>



            <final id="rc1">
            <onentry>
            <log label="Fault RC1" expr="rc1" />
            </onentry>
            </final>




        </state>





        <state id="RC2" initial="RC2_Initial">



            <state id="RC2_Initial">
                <transition cond="rc2" target="rc2" />
            </state>



            <final id="rc2">
            <onentry>
            <log label="Fault RC2" expr="rc2" />
            </onentry>
            </final>
            
        </state>



        <state id="RC3" initial="RC3_Initial">



            <state id="RC3_Initial">
                <transition cond="rc3" target="rc3" />
            </state>



            <final id="rc3">
            <onentry>
            <log label="Fault RC3" expr="rc3" />
            </onentry>
            </final>



        </state>



        <transition target="Fault_Mode" />
    </parallel>





    <parallel id="Fault_Mode">
        <state id="FM1" initial="FM1_Check">
            <state id="FM1_Check">
            <transition cond="fm1" target="fm1"/>
            </state>
            
            <final id="fm1">
            <onentry>
            <log label="Fault Mode FM1" expr="fm1" />
            </onentry>
            </final>
        </state>



        <state id="FM2">
            <onentry>
                <log label="FM2" />
            </onentry>
        </state>
    </parallel>



</state>

from scxml-tutorial.

seenivasanmca avatar seenivasanmca commented on June 9, 2024

updated scxml with delay attributes

<datamodel>
<!--<data id="sensordata" src="http://loaclhost:8080/retrive/sensor/data?hk200300,hk1720"-->

<data id="sensorData" src="http://localhost:8080/sensordata.json"/>
    <data id="detectionparam" src="http://localhost:8080/sample.json" />
    <data id="dp1"/>
    <data id="dp2" />
	 <data id="dp3" expr="true"/>
	 <data id="dp4" />


</datamodel>



<state id="No_Fault">



    <!-- <transition cond="true" target="Fault"/> -->
    <onentry>




                
         <assign location="dp1" expr="sensorData.HK_200300 &lt; 25" />
        <assign location="dp2" expr="true" />
		<assign location="dp4" expr="true"/>



        <log label="DP1 Value On Entry" expr="dp1" />
		            <log label="DP3 Value On Entry" expr="dp3" />

		<send  event="ec1" delay="5s"/>
		

    </onentry>


    <transition event="'ec1'" cond="dp1 or dp2 or dp3" target="Fault">
	
        <log label="DP1" expr="dp1" />
        <log label="DP2" expr="dp2" />
        <log label="DP3" expr="dp3" />
    </transition>

    <onexit>
        <log label="DP1 Value On Exit" expr="dp1" />
    </onexit>




</state>



<state id="Fault" initial="Root_Cause">



    <datamodel>
        <data id="rc1" />
        <data id="rc2"/>
        <data id="rc3"/>
		<data id="fm1"/>
    </datamodel>



    <parallel id="Root_Cause">
        <state id="RC1" initial="RC1_Initial">



            <state id="RC1_Initial">
                <transition cond="rc1" target="rc1" />
            </state>



            <final id="rc1">
            <onentry>
            <log label="Fault RC1" expr="rc1" />
            </onentry>
            </final>




        </state>





        <state id="RC2" initial="RC2_Initial">



            <state id="RC2_Initial">
                <transition cond="rc2" target="rc2" />
            </state>



            <final id="rc2">
            <onentry>
            <log label="Fault RC2" expr="rc2" />
            </onentry>
            </final>
            
        </state>



        <state id="RC3" initial="RC3_Initial">



            <state id="RC3_Initial">
                <transition cond="rc3" target="rc3" />
            </state>



            <final id="rc3">
            <onentry>
            <log label="Fault RC3" expr="rc3" />
            </onentry>
            </final>



        </state>



        <transition target="Fault_Mode" />
    </parallel>





    <parallel id="Fault_Mode">
        <state id="FM1" initial="FM1_Check">
            <state id="FM1_Check">
            <transition cond="fm1" target="fm1"/>
            </state>
            
            <final id="fm1">
            <onentry>
            <log label="Fault Mode FM1" expr="fm1" />
            </onentry>
            </final>
        </state>



        <state id="FM2">
            <onentry>
                <log label="FM2" />
            </onentry>
        </state>
    </parallel>



</state>

from scxml-tutorial.

alexzhornyak avatar alexzhornyak commented on June 9, 2024

@seenivasanmca follow the next issue support conditions, please:

  1. attach full scxml file as zip or txt with all necessary xml tags such as <scxml> element
  2. try not to send state chart with syntax or non-standard errors such as <transition event="'ec1'" (must be <transition event="ec1") where event ec1 is enclosed with ' character and there is a lot of time wasted to find such error
  3. check in any visual SCXML editor the behaviour of your statemachine first. Is the behaviour as expected or not!? Because I do not know what is expected from your source code, sorry
  4. read the SCXML standard concerning the element you need. For example, attribute 'delayexpr' in <send> element must return something like return 25*45 + 'ms'

Your present code is working something like that now
Issue_5

from scxml-tutorial.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.