Questions asked by Jailson Britohttps://answers.axonivy.com/questions/asked-by/761/jailson-brito/?type=rssQuestions asked by <a href="/users/761/jailson-brito" >Jailson Brito</a>enTue, 07 Feb 2017 18:32:50 -0500How to avoid the Error Http Status Code 409?https://answers.axonivy.com/questions/2427/how-to-avoid-the-error-http-status-code-409<p>Scenario:</p> <ol> <li>user1 authenticates and starts a task;</li> <li>Then, user1 closes the browser window with the task open;</li> <li>Finally, authenticates again and try to do the task.</li> </ol> <p>Then, it throw the Error: "Error Http Status Code 409", ConflictRequestException: "You cannot work on the task '305 - User 1 - Task 1 - ' with the identifier '41' because the user 'user1' is currently working on it.". </p> <p>The simulation doesn't start before the error, so I am wondering if it could be just a configuration on Axon Ivy. My Question is <strong>How to avoid the Error Http Status Code 409?</strong> </p> <p>Any help is appreciated.</p> <p>Notes: </p> <ul> <li>In my user application, the tasks are showing using the approach explained in <a href="http://answers.axonivy.com/questions/2410/findworktasks-never-returns-tasks-in-taskstate-resumed-state">findWorkTasks() never returns tasks in TaskState.RESUMED state</a>;</li> <li>Since it's not reliable in all browsers, I am avoiding to handle the window closing: <a href="http://answers.axonivy.com/questions/2406/detecting-when-the-user-closes-the-window-or-tab-of-the-browser-in-a-html-dialog">Detecting when the user closes the window or tab of the browser in a Html Dialog</a>;</li> <li>It seems that the Portal handles the action differently for RESUMED and SUSPENDED tasks, that's my plan B;</li> <li>Engine Version 6.0.5;</li> </ul>Jailson BritoTue, 07 Feb 2017 18:32:50 -0500https://answers.axonivy.com/questions/2427/how-to-avoid-the-error-http-status-code-409tasklisterror-handlingconfigurationtaskfindWorkTasks() never returns tasks in TaskState.RESUMED statehttps://answers.axonivy.com/questions/2410/findworktasks-never-returns-tasks-in-taskstate-resumed-state<p>Hello. </p> <p>Using engine 6.0.5, I am trying to query tasks that the session user is working or can work on. </p> <p>According to the docs, <a href="http://developer.axonivy.com/doc/6.0.5/publicApi/ch/ivyteam/ivy/workflow/IWorkflowSession.html#findWorkTasks-ch.ivyteam.ivy.workflow.IPropertyFilter-java.util.List-int-int-boolean-java.util.EnumSet-"><code>findWorkTasks()</code></a> can return tasks in states <code>TaskState.SUSPENDED</code>, <code>TaskState.CREATED</code>, <code>TaskState.RESUMED</code>, <code>TaskState.PARKED</code>. </p> <p>When I use it like this: </p> <p><code>result = ivy.session.findWorkTasks(filter, order, first, pageSize, true, EnumSet.of(TaskState.SUSPENDED, TaskState.RESUMED));</code></p> <p>It never returns <code>TaskState.RESUMED</code> tasks, only <code>TaskState.SUSPENDED</code>.</p> <p>Just to double check if I have resumed tasks, I tried the following call and it returns the <code>TaskState.RESUMED</code> tasks. <code>result = ivy.session.findLockedWorkTasks(filter, order, first, pageSize, true, EnumSet.of(TaskState.RESUMED));</code> </p> <p>What am I doing wrong on my use of <a href="http://developer.axonivy.com/doc/6.0.5/publicApi/ch/ivyteam/ivy/workflow/IWorkflowSession.html#findWorkTasks-ch.ivyteam.ivy.workflow.IPropertyFilter-java.util.List-int-int-boolean-java.util.EnumSet-"><code>findWorkTasks()</code></a>?</p> <p>Thanks in advance,</p>Jailson BritoWed, 01 Feb 2017 15:45:36 -0500https://answers.axonivy.com/questions/2410/findworktasks-never-returns-tasks-in-taskstate-resumed-statesessiontask-queryDetecting when the user closes the window or tab of the browser in a Html Dialoghttps://answers.axonivy.com/questions/2406/detecting-when-the-user-closes-the-window-or-tab-of-the-browser-in-a-html-dialog<p>Hello! I have the following scenario:</p> <ol> <li>User goes to the their Personal Task List;</li> <li>There's 1 task;</li> <li>User closes the window or tab in the browser;</li> <li>User comes back in 5 minutes and goes to their Personal Task List;</li> <li>The task is gone;</li> <li>After 30 minutes, the user refreshes the page;</li> <li>The task is back;</li> </ol> <p><strong>Question 1.</strong> I understand that since the user started to work on that task (step 2), it changed from SUSPENDED to RUNNING, and other users are not able to see that task in the meantime. I don't understand why even the user that is working on that task, can't see the task in the Personal Task List.</p> <p><strong>Question 2.</strong> Using Html Dialog, How to detect when the user change the context on the browser, to bind it to an event in the Logic? For example, if the user closes the tab/window, then it would fire a process to change the task to SUSPENDED again.</p> <p>I found old answers but they don't seem to be the exact scenario:</p> <ul> <li> <p><a href="http://answers.axonivy.com/questions/434/hook-into-global-closing-with-x-on-the-window">Hook into global closing with "X" on the window</a> - It talks about Rich Dialog and Java Class, I am using Html Dialog and I would like to bind it to an event containing a Script Step with a code in Ivy Script;</p> </li> <li> <p><a href="http://answers.axonivy.com/questions/359/how-can-i-logoff-the-user-if-he-closes-the-browser">How can I logoff the user if he closes the browser?</a> - This one says that the task would be immediately available for the same user, but this is not what's happening in my scenario.</p> </li> </ul> <p>Thanks in advance.</p>Jailson BritoMon, 30 Jan 2017 23:51:34 -0500https://answers.axonivy.com/questions/2406/detecting-when-the-user-closes-the-window-or-tab-of-the-browser-in-a-html-dialogprocesshtmldialogtask