{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet-state-machine/stateless/issues/112","repository_url":"https://api.github.com/repos/dotnet-state-machine/stateless","labels_url":"https://api.github.com/repos/dotnet-state-machine/stateless/issues/112/labels{/name}","comments_url":"https://api.github.com/repos/dotnet-state-machine/stateless/issues/112/comments","events_url":"https://api.github.com/repos/dotnet-state-machine/stateless/issues/112/events","html_url":"https://github.com/dotnet-state-machine/stateless/pull/112","id":193274156,"number":112,"title":"Multiple guards support","user":{"login":"edgars-pivovarenoks","id":19811309,"avatar_url":"https://avatars.githubusercontent.com/u/19811309?v=3","gravatar_id":"","url":"https://api.github.com/users/edgars-pivovarenoks","html_url":"https://github.com/edgars-pivovarenoks","followers_url":"https://api.github.com/users/edgars-pivovarenoks/followers","following_url":"https://api.github.com/users/edgars-pivovarenoks/following{/other_user}","gists_url":"https://api.github.com/users/edgars-pivovarenoks/gists{/gist_id}","starred_url":"https://api.github.com/users/edgars-pivovarenoks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edgars-pivovarenoks/subscriptions","organizations_url":"https://api.github.com/users/edgars-pivovarenoks/orgs","repos_url":"https://api.github.com/users/edgars-pivovarenoks/repos","events_url":"https://api.github.com/users/edgars-pivovarenoks/events{/privacy}","received_events_url":"https://api.github.com/users/edgars-pivovarenoks/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-12-03T08:15:13Z","updated_at":"2016-12-07T04:57:20Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/dotnet-state-machine/stateless/pulls/112","html_url":"https://github.com/dotnet-state-machine/stateless/pull/112","diff_url":"https://github.com/dotnet-state-machine/stateless/pull/112.diff","patch_url":"https://github.com/dotnet-state-machine/stateless/pull/112.patch"},"body":"Hi, I propose to support multiple transition guards as I had this requirement in real-world project. \r\n\r\nMy idea is to replace pair of guard and description parameters with TransitionGuard class and use TransitionGuards class internally to hold guard functions and return aggregate results. Below is configuration code fragment : \r\n\r\n```\r\n .PermitIf(Trigger.Close, State.Closed, g => g\r\n     .And(() => true, \"my guard 1\")\r\n     .And(() => true, \"my guard 2\"))\r\n```\r\nCurrent implementation requires all conditions to be true to allow transition.\r\n\r\nWill be glad to hear feedback about this idea and input about better implementation."},"comment":{"url":"https://api.github.com/repos/dotnet-state-machine/stateless/issues/comments/265356056","html_url":"https://github.com/dotnet-state-machine/stateless/pull/112#issuecomment-265356056","issue_url":"https://api.github.com/repos/dotnet-state-machine/stateless/issues/112","id":265356056,"user":{"login":"edgars-pivovarenoks","id":19811309,"avatar_url":"https://avatars.githubusercontent.com/u/19811309?v=3","gravatar_id":"","url":"https://api.github.com/users/edgars-pivovarenoks","html_url":"https://github.com/edgars-pivovarenoks","followers_url":"https://api.github.com/users/edgars-pivovarenoks/followers","following_url":"https://api.github.com/users/edgars-pivovarenoks/following{/other_user}","gists_url":"https://api.github.com/users/edgars-pivovarenoks/gists{/gist_id}","starred_url":"https://api.github.com/users/edgars-pivovarenoks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edgars-pivovarenoks/subscriptions","organizations_url":"https://api.github.com/users/edgars-pivovarenoks/orgs","repos_url":"https://api.github.com/users/edgars-pivovarenoks/repos","events_url":"https://api.github.com/users/edgars-pivovarenoks/events{/privacy}","received_events_url":"https://api.github.com/users/edgars-pivovarenoks/received_events","type":"User","site_admin":false},"created_at":"2016-12-07T04:57:20Z","updated_at":"2016-12-07T04:57:20Z","body":"I pushed pretty much what I had on mind. \r\n\r\nLittle summary of last changes :\r\n- new class TriggerBehaviourResult, short lived result holding list of failed guard conditions,\r\n- Refactored TryFindHandler to be called only **once per Fire** in case of failed guard,\r\n- UnhandledTriggerAction got new parameter with list of unmet condition,\r\n- Error message updated in default unhandled trigger action."}}
{"actor":{"display_login":"edgars-pivovarenoks"}}