{"action":"created","issue":{"url":"https://api.github.com/repos/danielgerlag/workflow-core/issues/133","repository_url":"https://api.github.com/repos/danielgerlag/workflow-core","labels_url":"https://api.github.com/repos/danielgerlag/workflow-core/issues/133/labels{/name}","comments_url":"https://api.github.com/repos/danielgerlag/workflow-core/issues/133/comments","events_url":"https://api.github.com/repos/danielgerlag/workflow-core/issues/133/events","html_url":"https://github.com/danielgerlag/workflow-core/issues/133","id":318487985,"number":133,"title":"When Parallel() used, empty Do() causes following step to execute inside Do","user":{"login":"cnayan","id":2213067,"avatar_url":"https://avatars2.githubusercontent.com/u/2213067?v=4","gravatar_id":"","url":"https://api.github.com/users/cnayan","html_url":"https://github.com/cnayan","followers_url":"https://api.github.com/users/cnayan/followers","following_url":"https://api.github.com/users/cnayan/following{/other_user}","gists_url":"https://api.github.com/users/cnayan/gists{/gist_id}","starred_url":"https://api.github.com/users/cnayan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cnayan/subscriptions","organizations_url":"https://api.github.com/users/cnayan/orgs","repos_url":"https://api.github.com/users/cnayan/repos","events_url":"https://api.github.com/users/cnayan/events{/privacy}","received_events_url":"https://api.github.com/users/cnayan/received_events","type":"User","site_admin":false},"labels":[{"id":482391954,"url":"https://api.github.com/repos/danielgerlag/workflow-core/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"closed","locked":false,"assignee":{"login":"danielgerlag","id":2357007,"avatar_url":"https://avatars3.githubusercontent.com/u/2357007?v=4","gravatar_id":"","url":"https://api.github.com/users/danielgerlag","html_url":"https://github.com/danielgerlag","followers_url":"https://api.github.com/users/danielgerlag/followers","following_url":"https://api.github.com/users/danielgerlag/following{/other_user}","gists_url":"https://api.github.com/users/danielgerlag/gists{/gist_id}","starred_url":"https://api.github.com/users/danielgerlag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielgerlag/subscriptions","organizations_url":"https://api.github.com/users/danielgerlag/orgs","repos_url":"https://api.github.com/users/danielgerlag/repos","events_url":"https://api.github.com/users/danielgerlag/events{/privacy}","received_events_url":"https://api.github.com/users/danielgerlag/received_events","type":"User","site_admin":false},"assignees":[{"login":"danielgerlag","id":2357007,"avatar_url":"https://avatars3.githubusercontent.com/u/2357007?v=4","gravatar_id":"","url":"https://api.github.com/users/danielgerlag","html_url":"https://github.com/danielgerlag","followers_url":"https://api.github.com/users/danielgerlag/followers","following_url":"https://api.github.com/users/danielgerlag/following{/other_user}","gists_url":"https://api.github.com/users/danielgerlag/gists{/gist_id}","starred_url":"https://api.github.com/users/danielgerlag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielgerlag/subscriptions","organizations_url":"https://api.github.com/users/danielgerlag/orgs","repos_url":"https://api.github.com/users/danielgerlag/repos","events_url":"https://api.github.com/users/danielgerlag/events{/privacy}","received_events_url":"https://api.github.com/users/danielgerlag/received_events","type":"User","site_admin":false}],"milestone":null,"comments":8,"created_at":"2018-04-27T17:24:34Z","updated_at":"2018-04-30T10:42:42Z","closed_at":"2018-04-28T19:10:03Z","author_association":"NONE","body":"Issue is that the **Bye** step is executed twice in the given flow because there are two **Do** invocations declared (although there is nothing in them.)\r\n\r\nHere is the code:\r\n\r\n```\r\npublic void Build(IWorkflowBuilder<MyData> builder)\r\n{\r\n\tbuilder.StartWith<Start>()\r\n\t\t.Then<Dummy>(initThen =>\r\n\t\t{\r\n\t\t\tinitThen.Parallel()\r\n\t\t\t\t.Do(then => { })\r\n\t\t\t\t.Do(then => { });\r\n\t\t})\r\n\t\t.Then<Bye>();\r\n}\r\n```\r\n\r\nwhere steps are:\r\n\r\n```\r\ninternal class Start : StepBody\r\n{\r\n\tpublic override ExecutionResult Run(IStepExecutionContext context)\r\n\t{\r\n\t\tConsole.WriteLine(\"Workflow started - \" + context.Workflow.WorkflowDefinitionId);\r\n\t\treturn ExecutionResult.Next();\r\n\t}\r\n}\r\n\r\ninternal class Dummy : StepBody\r\n{\r\n\tpublic override ExecutionResult Run(IStepExecutionContext context)\r\n\t{\r\n\t\treturn ExecutionResult.Next();\r\n\t}\r\n}\r\n\r\ninternal class Bye : StepBody\r\n{\r\n\tpublic override ExecutionResult Run(IStepExecutionContext context)\r\n\t{\r\n\t\tConsole.WriteLine(\"Workflow terminating - \" + context.Workflow.WorkflowDefinitionId);\r\n\t\treturn ExecutionResult.Next();\r\n\t}\r\n}\r\n```\r\n\r\nObserved output:\r\n```\r\nWorkflow started - Simple Workflow\r\nWorkflow terminating - Simple Workflow\r\nWorkflow terminating - Simple Workflow\r\nWorkflow terminating - Simple Workflow\r\n```\r\n\r\nExpected output is:\r\n```\r\nWorkflow started - Simple Workflow\r\nWorkflow terminating - Simple Workflow\r\n```\r\n\r\nI'm trying to figure out the reason of redundant runs of step, but I need help.\r\n\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/danielgerlag/workflow-core/issues/comments/385364044","html_url":"https://github.com/danielgerlag/workflow-core/issues/133#issuecomment-385364044","issue_url":"https://api.github.com/repos/danielgerlag/workflow-core/issues/133","id":385364044,"user":{"login":"cnayan","id":2213067,"avatar_url":"https://avatars2.githubusercontent.com/u/2213067?v=4","gravatar_id":"","url":"https://api.github.com/users/cnayan","html_url":"https://github.com/cnayan","followers_url":"https://api.github.com/users/cnayan/followers","following_url":"https://api.github.com/users/cnayan/following{/other_user}","gists_url":"https://api.github.com/users/cnayan/gists{/gist_id}","starred_url":"https://api.github.com/users/cnayan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cnayan/subscriptions","organizations_url":"https://api.github.com/users/cnayan/orgs","repos_url":"https://api.github.com/users/cnayan/repos","events_url":"https://api.github.com/users/cnayan/events{/privacy}","received_events_url":"https://api.github.com/users/cnayan/received_events","type":"User","site_admin":false},"created_at":"2018-04-30T10:42:42Z","updated_at":"2018-04-30T10:42:42Z","author_association":"NONE","body":"I checked your example on Parallel again, and tried to use it in same manner. It worked. I guess I was trying to shorten up the setup of the flow, and that's why I was failing. Sorry for the confusion.\r\n\r\nAs per your documentation, this works:\r\n```\r\n            builder.StartWith<Start>()\r\n                .Then<Dummy>(initThen =>\r\n                {\r\n                    initThen.Parallel()\r\n                        .Do(then => then.StartWith<InformStep>())\r\n                        .Do(then => then.StartWith<InformStep>())\r\n                        ;\r\n                })\r\n                .Then<Bye>();\r\n```\r\nThe output (as observed), is same as expected:\r\n```\r\nWorkflow started - Simple Workflow\r\n========================================\r\n========================================\r\nWorkflow terminating - Simple Workflow\r\nI'm informed\r\nI'm informed\r\n```\r\nSo, your way works.\r\n\r\n\r\nI've enhanced the `ParallelStepBuilder` in my repository to let me work with my syntax, as well.\r\n```\r\n            builder.StartWith<Start>()\r\n                .Then<Dummy>(initThen =>\r\n                    initThen.Parallel()\r\n                        .Do<InformStep>()\r\n                        .Do<InformStep>()\r\n                )\r\n                .Then<Bye>();\r\n```\r\n"}}
{"actor":{"display_login":"cnayan"}}