{"action":"created","issue":{"url":"https://api.github.com/repos/effektif/effektif/issues/29","labels_url":"https://api.github.com/repos/effektif/effektif/issues/29/labels{/name}","comments_url":"https://api.github.com/repos/effektif/effektif/issues/29/comments","events_url":"https://api.github.com/repos/effektif/effektif/issues/29/events","html_url":"https://github.com/effektif/effektif/issues/29","id":100374235,"number":29,"title":"ExclusiveGateway ends workflow when no transition is found","user":{"login":"jblankendaal","id":11930623,"avatar_url":"https://avatars.githubusercontent.com/u/11930623?v=3","gravatar_id":"","url":"https://api.github.com/users/jblankendaal","html_url":"https://github.com/jblankendaal","followers_url":"https://api.github.com/users/jblankendaal/followers","following_url":"https://api.github.com/users/jblankendaal/following{/other_user}","gists_url":"https://api.github.com/users/jblankendaal/gists{/gist_id}","starred_url":"https://api.github.com/users/jblankendaal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jblankendaal/subscriptions","organizations_url":"https://api.github.com/users/jblankendaal/orgs","repos_url":"https://api.github.com/users/jblankendaal/repos","events_url":"https://api.github.com/users/jblankendaal/events{/privacy}","received_events_url":"https://api.github.com/users/jblankendaal/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-11T18:20:18Z","updated_at":"2015-08-20T12:38:14Z","closed_at":null,"body":"When an exclusive gateway does not have a default transition and no condition is met then the flow ends in the exclusive gateway. The end time of the activityInstance is set and the workstate is removed on the workflowInstance. \r\nIn the code there is a todo for this situation: \r\n// TODO create an event to let the user decide (ExclusiveGatewayImpl.java, line 69)\r\nA bit further in the code the activityInstance is end()-ed and propagatedToParent().\r\n\r\nBut since the activityInstance is closed, a message to this workflowInstance is not possible anymore: the workflow is ended.\r\n\r\nMy proposal is to leave the activityInstance open, so remove the code on lines 75-79. The only thing I am not sure about is what the consequences are when this workflowInstance is part of a invoked flow.\r\n\r\nOther thing that I propose is that if no conditions are met and there is no default transition defined, the code also looks for an empty transition, and if found, treats this transition as if it was the default. I already agreed on this in a separate session with @tombaeyens .\r\n\r\nI can create the above described patch and do a pull request, I just wanted to consult you guys first.\r\n"},"comment":{"url":"https://api.github.com/repos/effektif/effektif/issues/comments/132993551","html_url":"https://github.com/effektif/effektif/issues/29#issuecomment-132993551","issue_url":"https://api.github.com/repos/effektif/effektif/issues/29","id":132993551,"user":{"login":"tombaeyens","id":944245,"avatar_url":"https://avatars.githubusercontent.com/u/944245?v=3","gravatar_id":"","url":"https://api.github.com/users/tombaeyens","html_url":"https://github.com/tombaeyens","followers_url":"https://api.github.com/users/tombaeyens/followers","following_url":"https://api.github.com/users/tombaeyens/following{/other_user}","gists_url":"https://api.github.com/users/tombaeyens/gists{/gist_id}","starred_url":"https://api.github.com/users/tombaeyens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tombaeyens/subscriptions","organizations_url":"https://api.github.com/users/tombaeyens/orgs","repos_url":"https://api.github.com/users/tombaeyens/repos","events_url":"https://api.github.com/users/tombaeyens/events{/privacy}","received_events_url":"https://api.github.com/users/tombaeyens/received_events","type":"User","site_admin":false},"created_at":"2015-08-20T12:38:13Z","updated_at":"2015-08-20T12:38:13Z","body":"The code had some notes about activity instances that should be kept open.  That I removed.  \r\n\r\nI did create a customizable method in case the exclusive gateway is underspecified.  The default implementation will still look for the first transition without a condition.  @SilentGert if that's not ok for you, speak up :)\r\n\r\n```\r\n  /** called when this exclusive gateway is 'underspecified' so we have \r\n   * to guess what's best to do at this point.\r\n   *   \r\n   *  a) there is no outgoing transition with a condition that resolves to true \r\n   *  b) there is no default transition specified\r\n   *  c) and there is more than 1 transition\r\n   */\r\n  protected TransitionImpl handleUndefinedSelection(ActivityInstanceImpl activityInstance, List<TransitionImpl> outgoingTransitions) {\r\n    return findFirstTransitionWithoutCondition(activityInstance, outgoingTransitions);\r\n  }\r\n```"}}