How to exit task form without saving

Hi…
There is a strange issue with the TaskForm class in Camunda.
As soon as this is called, a new object of my form is created and even if I cancel the form in order to not save anything, it remains there.

The function being used is:
camundaTaskForm.startTaskForm()

How can I close this form without creating a new object?

This is not my code, so kind of unable to figure out where is the issue and how to not create a new object or being able to delete it if required(for example on click of Cancel button).

I have been thinking about the following:

  • camundaTaskForm.completeTask();
  • requestProcess.stopTask(true);
    but they don’t work either.

Can someone please suggest?

Hi @Manpriya_Guliani,

Could you please elaborate on this please?

What do you mean with “it remains there”?

Cheers,
Roman

Hi,

I mean that when the startTaskForm() function is called an empty object is created.

I can’t figure out a way to get rid of this empty object. For example if the user doesn’t want to proceed with the form and quits in the middle, this object still remains and shows up in the list of form objects.

Hi @Manpriya_Guliani,

I am sorry, but I am not able to follow you.

When you call startTaskForm() there is no object returned as the return type of the method is void.

From which type is this “empty object”? What kind of list is it? Is it a list on the user interface? Could you please elaborate on this please a little bit more? Maybe you can share some code?

Cheers,
Roman

Hi,

Sorry for a late reply.

Let me put this in other words.

Is there a way to cancel or delete a ‘Running’ process instance?

Hi @Manpriya_Guliani,

Yes, there is a way to cancel or delete a running process instance. This can be done by RuntimeService#deleteProcessInstance() or in case of the REST API this can be done via 1.

Cheers,
Roman

Thanks @roman.smirnov

This is nice.