{"action":"created","issue":{"url":"https://api.github.com/repos/oxo42/stateless4j/issues/41","labels_url":"https://api.github.com/repos/oxo42/stateless4j/issues/41/labels{/name}","comments_url":"https://api.github.com/repos/oxo42/stateless4j/issues/41/comments","events_url":"https://api.github.com/repos/oxo42/stateless4j/issues/41/events","html_url":"https://github.com/oxo42/stateless4j/issues/41","id":97400838,"number":41,"title":"Guarded Transition for not changing State","user":{"login":"tuncatunc","id":6542344,"avatar_url":"https://avatars.githubusercontent.com/u/6542344?v=3","gravatar_id":"","url":"https://api.github.com/users/tuncatunc","html_url":"https://github.com/tuncatunc","followers_url":"https://api.github.com/users/tuncatunc/followers","following_url":"https://api.github.com/users/tuncatunc/following{/other_user}","gists_url":"https://api.github.com/users/tuncatunc/gists{/gist_id}","starred_url":"https://api.github.com/users/tuncatunc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tuncatunc/subscriptions","organizations_url":"https://api.github.com/users/tuncatunc/orgs","repos_url":"https://api.github.com/users/tuncatunc/repos","events_url":"https://api.github.com/users/tuncatunc/events{/privacy}","received_events_url":"https://api.github.com/users/tuncatunc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-27T07:13:06Z","updated_at":"2016-01-13T16:05:07Z","closed_at":null,"body":"When I configure a state transition with permitIf and the guard function doesn't allow the transition\r\nI'm getting following exception. However I except the state unchanged.\r\n\r\n```java\r\n        smCfg.configure(State.STATE_0)\r\n            .permitIf(Event.TC_setup, State.STATE_1, new FuncBoolean()\r\n            {\r\n                \r\n                @Override\r\n                public boolean call()\r\n                {\r\n                    boolean result = hdlcIo.setup(); \r\n                    return result;\r\n                }\r\n            })\r\n```\r\n\r\n```java\r\njava.lang.IllegalStateException: No valid leaving transitions are permitted from state 'STATE_0' for trigger 'TC_setup'. Consider ignoring the trigger.\r\n\tat com.github.oxo42.stateless4j.StateMachine$1.doIt(StateMachine.java:30)\r\n\tat com.github.oxo42.stateless4j.StateMachine.publicFire(StateMachine.java:196)\r\n\tat com.github.oxo42.stateless4j.StateMachine.fire(StateMachine.java:133)\r\n\tat com.ayes.atmgw.service.ph.fde.FdeStateMachine.setup(FdeStateMachine.java:472)\r\n\tat com.ayes.atmgw.tests.TestFdeStateMachine.test02_STATE0_TC_Setup_fails(TestFdeStateMachine.java:60)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)\r\n\tat java.lang.reflect.Method.invoke(Unknown Source)\r\n\tat org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)\r\n\tat org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)\r\n\tat org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)\r\n\tat org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)\r\n\tat org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)\r\n\tat org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)\r\n\tat org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)\r\n\tat org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)\r\n\tat org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)\r\n\tat org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)\r\n\tat org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)\r\n\tat org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)\r\n\tat org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)\r\n\tat org.junit.runners.ParentRunner.run(ParentRunner.java:309)\r\n\tat org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)\r\n\tat org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)\r\n\tat org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)\r\n\tat org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)\r\n\tat org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)\r\n\tat org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/oxo42/stateless4j/issues/comments/171343603","html_url":"https://github.com/oxo42/stateless4j/issues/41#issuecomment-171343603","issue_url":"https://api.github.com/repos/oxo42/stateless4j/issues/41","id":171343603,"user":{"login":"rv7akro","id":4447839,"avatar_url":"https://avatars.githubusercontent.com/u/4447839?v=3","gravatar_id":"","url":"https://api.github.com/users/rv7akro","html_url":"https://github.com/rv7akro","followers_url":"https://api.github.com/users/rv7akro/followers","following_url":"https://api.github.com/users/rv7akro/following{/other_user}","gists_url":"https://api.github.com/users/rv7akro/gists{/gist_id}","starred_url":"https://api.github.com/users/rv7akro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rv7akro/subscriptions","organizations_url":"https://api.github.com/users/rv7akro/orgs","repos_url":"https://api.github.com/users/rv7akro/repos","events_url":"https://api.github.com/users/rv7akro/events{/privacy}","received_events_url":"https://api.github.com/users/rv7akro/received_events","type":"User","site_admin":false},"created_at":"2016-01-13T16:05:07Z","updated_at":"2016-01-13T16:05:07Z","body":"I am encountering the exact same problem. See below ...\r\n\r\nException in thread \"EventHandler-43680156-e573-48c5-966c-7f8ad087f066\" java.lang.IllegalStateException: No valid leaving transitions are permitted from state 'IDLE' for trigger 'class com.cisco.swag.whisper.events.system.DependenciesReady'. Consider ignoring the trigger.\r\n\tat com.github.oxo42.stateless4j.StateMachine$1.doIt(StateMachine.java:30)\r\n\tat com.github.oxo42.stateless4j.StateMachine.publicFire(StateMachine.java:188)\r\n\tat com.github.oxo42.stateless4j.StateMachine.fire(StateMachine.java:125)\r\n\tat com.cisco.swag.whisper.plugin.AgentPlugin$1.handleEvent(AgentPlugin.java:176)\r\n\tat com.cisco.swag.whisper.events.EventQueue$EventHandler.handleEvent(EventQueue.java:153)\r\n\tat com.cisco.swag.whisper.events.EventQueue$EventHandler.run(EventQueue.java:126)\r\n\tat java.lang.Thread.run(Thread.java:724)\r\n\r\nCan we get some more insight on how to successfully utilize guard functions?"}}