-
1. Re: Canceling an task instance
kukeltje Jun 11, 2007 7:34 AM (in response to ricardomarques)you don't... if you do not do a transition or a cancel in the api, it stays in the tasklist. So a 'cancel' on the user level means doing nothing in with the api. Look at the webconsole source .... has this identical functionality
-
2. Re: Canceling an task instance
ricardomarques Jun 11, 2007 8:15 AM (in response to ricardomarques)yes, but if I cancel it from the API, the task instance is terminated and it moves to the next node. I want that it stays in the same node, where the cancel action was called.
-
3. Re: Canceling an task instance
kukeltje Jun 11, 2007 8:19 AM (in response to ricardomarques)that is why I said you do NOT cancel it on the api, just do NOTHING.
-
4. Re: Canceling an task instance
ricardomarques Jun 11, 2007 9:40 AM (in response to ricardomarques)Sorry I haven't get that. But doing so... I get the task instance out of the tasklist, i think that is because i'm starting the work on the task, and leave it open.
-
5. Re: Canceling an task instance
kukeltje Jun 11, 2007 9:47 AM (in response to ricardomarques)?????
-
6. Re: Canceling an task instance
ricardomarques Jun 11, 2007 9:53 AM (in response to ricardomarques)Probally my english wasn't clear, let me try again.
If I do nothing, the task doesn't continue, but also doesn't appear on my tasklist, do i need to suspend or resume ? Or those methods aren't fit to that? -
7. Re: Canceling an task instance
kukeltje Jun 11, 2007 1:46 PM (in response to ricardomarques)your english was clear... You cannot get tasks out of your own tasklist. They are always in there. I'm not sure what you mean by 'leave it open'. if it is open (from my point of view) it is in your tasklist. So please show some code on what you are trying to achieve
suspending and resuming are on a completely different level. -
8. Re: Canceling an task instance
ricardomarques Jun 12, 2007 5:38 AM (in response to ricardomarques)For now... I had resolved the problem the following way (not sure that's the correct one), until now I get a task from the task list then start the work on the task and when the user had filled up the form i ended the task. This was giving me problems on canceling (if doing nothing), because on the moment that I start the work on the task using this code:
Command cmd = new StartWorkOnTaskCommand(getTid(), false); Object result = getEjbClient().getCommandService().execute(cmd);
When i retrive the task list using:try { cmd = new GetTaskListCommand(name,true); List result = (List) getEjbClient().getCommandService().execute(cmd); DataModel data = new ListDataModel(result); return data; }
I haven't the task on the tasklist (visible at least).
I had resolved the problem by starting the work and ending the work when user submit's the form. Probally i'm going to optimize this to make only one call to the ejb. -
9. Re: Canceling an task instance
kukeltje Jun 12, 2007 5:46 AM (in response to ricardomarques)ahh... ok... you use the command interface. Could be a bug in the implementation of the GetTaskListCommand. Maybe that returns only unstarted tasks.
This is exactely the reason that it is most of the time better to also post code.... -
10. Re: Canceling an task instance
ricardomarques Jun 12, 2007 6:42 AM (in response to ricardomarques)Ok, thanks for the feedback.
-
11. Re: Canceling an task instance
kukeltje Jun 12, 2007 6:53 AM (in response to ricardomarques)I just had a look and cannot find a reason for the behaviour you see. The implementation in both commands seems correct.
-
12. Re: Canceling an task instance
roccolocko Jun 13, 2007 11:17 AM (in response to ricardomarques)Once you get a task, you don't have to do anything to start using it. And only when you're done you have to make an END or a CANCEL if you wish, but if you DO NOTHING like kukeltje said, your task should be exactly in the same place where you left it.
Perhaps if you post a little code of what your doing.