{"action":"opened","issue":{"url":"https://api.github.com/repos/hekailiang/squirrel/issues/33","labels_url":"https://api.github.com/repos/hekailiang/squirrel/issues/33/labels{/name}","comments_url":"https://api.github.com/repos/hekailiang/squirrel/issues/33/comments","events_url":"https://api.github.com/repos/hekailiang/squirrel/issues/33/events","html_url":"https://github.com/hekailiang/squirrel/issues/33","id":53609918,"number":33,"title":"Deep history","user":{"login":"Voskuijlen","id":10432358,"avatar_url":"https://avatars.githubusercontent.com/u/10432358?v=3","gravatar_id":"","url":"https://api.github.com/users/Voskuijlen","html_url":"https://github.com/Voskuijlen","followers_url":"https://api.github.com/users/Voskuijlen/followers","following_url":"https://api.github.com/users/Voskuijlen/following{/other_user}","gists_url":"https://api.github.com/users/Voskuijlen/gists{/gist_id}","starred_url":"https://api.github.com/users/Voskuijlen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Voskuijlen/subscriptions","organizations_url":"https://api.github.com/users/Voskuijlen/orgs","repos_url":"https://api.github.com/users/Voskuijlen/repos","events_url":"https://api.github.com/users/Voskuijlen/events{/privacy}","received_events_url":"https://api.github.com/users/Voskuijlen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-01-07T08:45:41Z","updated_at":"2015-01-07T08:45:41Z","closed_at":null,"body":"Currently to my experience every child of a state with a deep historytype has to define a historytype, which is kind of strange because that statemachine will return to the last active state on every transition in that statemachine.\r\n\r\nI looked at the code and guess that commenting/removing line 170 and 172 of the fsm.impl.StateImpl.java (if(getParentState().getHistoryType()!=HistoryType.NONE) {}) will solve this problem, because currently the state is only saved if a historytype is defined. Removing this, will to my idea, result in not having to define a historytype in every layer of the statemachine, being a better implementation of the deep history.\r\n\r\nThis comes because not only the direct parentstate, but maybe the parent of the parent of the parentstate might have the deep history defined.\r\n\r\nI would like to know your opinion on this matter.\r\n\r\n\r\nFor example:\r\nGiving these states:\r\n@States({\r\n\t@State(name=\"Ref17_A\", historyType=HistoryType.DEEP),\r\n\t@State(name=\"Ref17_A_A1\", parent=\"Ref17_A\", initialState=true),\r\n\t@State(name=\"Ref17_A_A1_A1_1\", parent=\"Ref17_A_A1\", initialState=true),\r\n\t@State(name=\"Ref17_A_A1_A1_2\", parent=\"Ref17_A_A1\"),\r\n\t@State(name=\"Ref17_B\"),\r\n})\r\n\r\nBy transiting to Ref17_A_A1_A1_2, and after that going to Ref17_B, then returning to Ref17_A will only set the statemachine back to Ref17_A_A1_A1_1 instead of the supposed Ref17_A_A1_A1_2.\r\n"}}