Hi all

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. alt text 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.

Here is my callable subprocess:

alt text

and it's the code of api:

@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);
    }
}

And here is the way we trigger subprocess from service:

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();

My Question:

  1. 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?
  2. If we can't prevent zombie task, how ivy handle this kind of task? Does ivy clean it up automatically?

Thanks all

asked 27.10.2017 at 01:55

trungdv's gravatar image

trungdv
(suspended)
accept rate: 52%

edited 27.10.2017 at 01:57

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×147
×33
×1

Asked: 27.10.2017 at 01:55

Seen: 1,528 times

Last updated: 27.10.2017 at 01:57