05-19-2015 03:59 AM
Hi all,
i created a sample state machine using jki tool.
here i am controlling flow of state machine using Array index.
.........
I feel that following method is higher benifit for me i simply arrange my state machine using array. and i can control my statme machine by increament or defemanet array index.
and i creaed this method to ease of error handling . by changing the index vlaue . in array .
...
ALL I NEEED TO KNOW IS WHETHER THIS METHOD IS CORRECT OR ELSE GIVE METHOD ??!!!
05-19-2015 05:59 AM - edited 05-19-2015 06:03 AM
@SaranVenkateshS wrote:
[...] ALL I NEEED TO KNOW IS WHETHER THIS METHOD IS CORRECT OR ELSE GIVE METHOD ??!!!
This method is not a correct use of the JKI State Machine; either use macros or String constants in the individual states. Your solution is unmaintainable if you want to insert elements into your array, and unreadable if you don't put related states together other in it.
You don't need to work so hard if all you want to do is execute a series of states:
05-19-2015 02:32 PM
Jim is right, the JKI tool is nice but it doesn't look like you are taking any advantage of it here. You can create an enum instead of a string array with an index, and this will allow you to have numbered states and a description of the state. You can type def your enum so that if you update it in one location, it will update all locations.
The JKI tool is nice if you want to run a couple of different orders of states, you can launch a macro (along with many other cool features). There may be some test where you need to run state 1,2,3,4,5; but another test might require state 1,2,4; which is very easily done with the JKI state machine.