Questions Tagged With zombietaskhttps://answers.axonivy.com/tags/zombietask/?type=rssquestions tagged <span class="tag">zombietask</span>enFri, 27 Oct 2017 01:55:45 -0400Zombie task is created after finishing callable subprocess. How to avoid it?https://answers.axonivy.com/questions/2932/zombie-task-is-created-after-finishing-callable-subprocess-how-to-avoid-it<p>Hi all</p> <p>We're using ivy 6.3, and have face the problem that we implement a restfulAPI by java code, when we trigger the callable subprocess from it. After callablesub is finished, it will remain a zombie task. <img alt="alt text" src="https://answers.axonivy.com/upfiles/Untitled_OKBhfzB.png"> Why i need to call ivy subprocess from api? Answer: i need to call ivy.repo() to persist my data then response the id. This api can't be called in restful.</p> <p>Here is my callable subprocess:</p> <p><img alt="alt text" src="https://answers.axonivy.com/upfiles/Untitled_xUuYAvG.png"></p> <p>and it's the code of api:</p> <pre><code>@Path("{applicationName}/individualch") @Produces(MediaType.APPLICATION_JSON) public class IndividualchApi { /** * This API is used by third party application when it want to call * to create dossier Response message is cobId * @param provider * @param externalId * @param sobDossier * @return */ @POST @Path("/dossiers") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public Response createIndividualCHDossier(@NotNull String provider, @NotNull String externalId, SobDossier sobDossier) { if (StringUtils.isBlank(provider) || StringUtils.isBlank(externalId) || sobDossier == null) { return Response.status(Status.BAD_REQUEST).entity(new ResponseExceptionMessage() .errorCode(DossierCreationServiceExceptionType.BAD_REQUEST.getUniqueCode().toString()) .message("Invalid params")).build(); } return new CreateDossierHandlerService().createIndividualCHDossier(provider, externalId, sobDossier); } } </code></pre> <p>And here is the way we trigger subprocess from service:</p> <pre><code>SubProcessCallResult callResult = SubProcessCall.withPath(CREATE_DOSSIER_HANDLER_PROCESS_NAME) .withStartSignature("createDossier(String,String,SobDossier)") .withParam(PARAM_PROVIDER, provider).withParam(PARAM_EXTERNAL_ID, externalId) .withParam(PARAM_SOB_DOSSIER, sobDossier) .call(); </code></pre> <p>My Question: </p> <ol> <li>Is it a good solution to go? I actually can't call ivy.repo() inside my service. How can we prevent this kind of zomebie task?</li> <li>If we can't prevent zombie task, how ivy handle this kind of task? Does ivy clean it up automatically?</li> </ol> <p>Thanks all</p>trungdvFri, 27 Oct 2017 01:55:45 -0400https://answers.axonivy.com/questions/2932/zombie-task-is-created-after-finishing-callable-subprocess-how-to-avoid-itivyrestzombietask