-
1. Re: implementing java logic inside task node
yushanyuan Feb 22, 2010 3:57 AM (in response to praneet)1 of 1 people found this helpfulin my way, i do this in two steps. first, save the student form in database, second, signal the process. one point that you should remember is these
two steps should be done in one transaction.
-
2. Re: implementing java logic inside task node
praneet Feb 22, 2010 4:22 AM (in response to yushanyuan)he lele thanks for replying
just look what i am doing this is my task node where asignee is student who has filled the form.
<task assignee="#{student.Name}" g="117,198,166,52" name="complete-registration-online">
<transition name="to send-welcome-email" to="send-welcome-email" g="-114,-18"/>
</task>
then in the service class i am written following method. when student sumit the form
following method is called .
public void saveForm(Form form) {
String name=form.getStudent().getName();
List<Task> tasks=taskService.findPersonalTasks(name);
System.out.println(tasks.get(0));
hibernateTemplate.saveOrUpdate(form);
taskService.completeTask(tasks.get(0).getId());
}
in this method when form is saved what i have done is i have called the complete task method.
so my question is this is write way to implement the task node or i have to do something different please suugest
-
3. Re: implementing java logic inside task node
yushanyuan Feb 22, 2010 4:34 AM (in response to praneet)your code is right. just make sure that happen in one transaction. -
4. Re: implementing java logic inside task node
yushanyuan Feb 22, 2010 4:37 AM (in response to praneet)you`d better put the List<Task> tasks=taskService.findPersonalTasks(name); in another method. and taskid can be used as a parameter -
5. Re: implementing java logic inside task node
praneet Feb 22, 2010 4:48 AM (in response to yushanyuan)thanks lee ,
i have done as u said.its working fine.
but tell me situation in which i should write event listner in the task node instead of doing what i have done previously
-
6. Re: implementing java logic inside task node
yushanyuan Feb 22, 2010 4:55 AM (in response to praneet)i am sorry. i never done this in a event listener before. so can not help. -
7. Re: implementing java logic inside task node
kukeltje Feb 22, 2010 3:10 PM (in response to praneet)1 of 1 people found this helpfulor do it in a data/process access layer, completely outside the process that just shares the transaction or.... take your pick.... it depends on what you want to do with the data...
EDIT:
Oops sorry, all the other responses were not visible... strange...
-
8. Re: implementing java logic inside task node
praneet Feb 22, 2010 11:11 PM (in response to kukeltje)can i do something like this in eventlistner of task node i will call the my java method that is task assigned to the assignee between the task start and task complete block.