Return to running task from external form?


I am stuck in a scenario where in a new jsf form(not a part of bpmn) opens up from a running task upon clicking a button.
The task is definitely still running and is highlighted in Cockpit.

I need to shift control to this task once the newly opened form is submitted i.e want to come back to the original same page in the bpmn flow.

For this, I tried injecting BusinessProcess and tried most of it functions in the bean for this new form in order to redirect it back.

Maybe there is some other perspective to this problem?
Any suggestions?

Not sure about the specs of your project but one way to fetch the form is to create a CamSDK.Form object in javascript with some options like the containerElement, taskId and form Url which can be retrieved by doing a rest call.