Comments (5)
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.
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
-
It is not recommended to use same names for states and data fields
-
It is not recommended to use names for states that differ only by case
from scxml-tutorial.
<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 < 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.
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 < 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.
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 < 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 follow the next issue support conditions, please:
- attach full scxml file as zip or txt with all necessary xml tags such as <scxml> element
- 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 - 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
- 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
from scxml-tutorial.
Related Issues (9)
- Software used for designing diagrams in this tutorial ? HOT 6
- Can not compile DiningPhilosophers, StopWatch on Qt 5.9.9, Qt 5.12.6
- What is the way to call the parameters from the XML file in the SCXML ?
- Does SCXML support AND, OR, XOR etc in the boolean expressions? Is it supported in the Editor too?
- reset data src HOT 1
- SkodaBoleroInfotainment example is missing bolero.h HOT 2
- Qt 6 support in examples
- Qt 6 support in Bolero In-Vehicle Infotainment example
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scxml-tutorial.