cancel
Showing results for 
Search instead for 
Did you mean: 

Choose the transition to pass in endTask()

midoscofield
Champ in-the-making
Champ in-the-making
Hello,
<blockquote>endTask(transitionId) ends the task and signals the associated workflow path to progress to the next node using the specified transition.</blockquote>

The form of my task to end includes two transitions buttons "Approve" and "Reject".
When I try:
task.endTask ("Next")
that simulates the click on "Reject" But I need to click "Approve" .Even if i try to list  transitions of this task ,I can find only one called "Task done".

Any ideay please how to choose the other transition ?
5 REPLIES 5

darkredd
Star Contributor
Star Contributor
Hi,

I think your task type is defaulted to "reject" hence it uses that transition. I had a similar challenge a few years ago. Try switching you default task type outcome to "Approve" and observe.

Hi Dark,

Me too I thought, but i found that my exclusiveGateway have the "approve" transition as default flow.Any way,but my problem is that I can not change my workflow definition, because my need is to touch running instances.So I have to know how to distinguish between the two transitions without modifying my workflow.
Thanks anyway.

midoscofield
Champ in-the-making
Champ in-the-making
Ah, I was wrong, you speak of the default value in the model! hmm, I think it's a good idea, especially if I change the model that will be applied to the running instances.
I will try this. thank you.

midoscofield
Champ in-the-making
Champ in-the-making
This is an alternative that works very well! Thank you Dark !

Pleasure, happy coding!