Prevent completion of task and entering to new task based on condition

Hi,

I have a business case like below:

I have a task/state called “Proposal” and need to change task/state to “Proposal Submitted” but based on whether my submission of Proposal to external system was successful if not I should not move the state to “Proposal Submitted”.

Basically I call a external system using http to submit my proposal and if external system doesn’t accept the proposal the change of state should fail.

Can I use ExecutionListener for this.? I tried execution listener but it gives notification after start and end of the task but I need to prevent completion of the previous task.

Please help me on this.

Regards,
Aradhya

You’d typically model this by capturing the response of the http task in a variable, and use an exclusive gateway with that variable to either go to ‘submitted’ or a failed state.

How we set path Variable in URL dynamically,

Thanks,
Brajesh