Questions Tagged With taskhttps://answers.axonivy.com/tags/task/?type=rss&user=Emmanuelquestions tagged <span class="tag">task</span>enThu, 25 Jun 2015 23:25:10 -0400How to dynamically start a task from a process that was started from an HTML Dialoghttps://answers.axonivy.com/questions/1383/how-to-dynamically-start-a-task-from-a-process-that-was-started-from-an-html-dialog<p>Hi all,</p> <p>In a JSF Dialog we can start a task dynamically with: </p><pre><code>FacesContext.getCurrentInstance().getExternalContext().redirect(ivy.html.taskstartref(ivy.wf.findTask(95)));</code></pre><p></p> <p>We can also start an IProcess dynamically with something like that: </p><pre><code>IRequest request = requestFactory.createRequest(processStart, thisMapOrEmptyMapIfNull(params)); IResponse response = responseFactory.createResponse(); IRequestHandler requestHandler = (IRequestHandler)processStart.getProcessModelVersion().getAdapter(IProcessEngine.class); requestHandler.handleRequest(request, response); </code></pre><p></p> <p>Now we would like to combine both to start a process dynamically that should in turn start a task. The process can be started from within the JSF Dialog.<br> In the started process, as we are not in the JSF context, the following does not work (fails silently):</p><pre><code>FacesContext.getCurrentInstance().getExternalContext().redirect(ivy.html.taskstartref(ivy.wf.findTask(95)));</code></pre> The following code does not work as well (fails silently):<pre><code>IHttpResponse resp = ivy.response as IHttpResponse; resp.sendRedirect(ivy.html.taskstartref(in.task));</code></pre><p></p> <p>We tried also: </p><pre><code>IHttpResponse resp = ivy.response as IHttpResponse; HttpServletResponse sresp = resp.getHttpServletResponse(); sresp.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY); sresp.setHeader("Location",ivy.html.taskstartref(in.task)); sresp.sendRedirect(ivy.html.taskstartref(in.task)); sresp.flushBuffer();</code></pre> Here we get:<br> IllegalStateException: Cannot change buffer size after data has been written<br> Cannot set content type. Response already committed<p></p> <p>Is there a possibility to achieve what we try to do? Like for the process-start I have tried to find a proper IRequestHandler for starting a task. I have not found it.</p> <p>Thanks a lot in advance</p> <p>Emmanuel</p>EmmanuelThu, 25 Jun 2015 23:25:10 -0400https://answers.axonivy.com/questions/1383/how-to-dynamically-start-a-task-from-a-process-that-was-started-from-an-html-dialogtaskTaskQuery for description searchhttps://answers.axonivy.com/questions/1353/taskquery-for-description-search<p>Hi all,</p> <p>Is that possible to make a search for tasks by their description? A search by name is possible through:</p> <pre><code>TaskQuery stringFieldQuery = TaskQuery.create(); stringFieldQuery.where().name().isLike("search by name"); </code></pre> <p>I guessed it was the same for the description but it seems to be unpossible to do such a TaskQuery for the description because the following code returns an <em>IColumnFilterQuery</em> and not an <em>IStringColumnFilterQuery</em> as for the name():</p> <pre><code>stringFieldQuery.where().description() // There is no isLike("...") method then. </code></pre> <p>Is there another possibility with the TaskQuery?</p> <p>Thanks in advance</p> <p>Emmanuel</p>EmmanuelTue, 09 Jun 2015 11:50:46 -0400https://answers.axonivy.com/questions/1353/taskquery-for-description-searchtasktask-query