Good news everyone!

i was able to resolve the problem:
i now inject the jbpmContext and rerieve the taskinstance from there.

ending taskinstances (with or without specifying a transition) now works
*happy*

here is my code, maybe it helps so. else:

  | public String externalTaskActions(){
  |       if(jbpmContext!=null) log.debug("jbpmContext not null");
  |       if(ext_action.equalsIgnoreCase("end"))
  |               log.debug("Trying to end task "+ext_aufgabenID+" over 
transition "+ext_transition);
  |       if(ext_action.equalsIgnoreCase("start"))
  |             log.debug("Trying to start task "+ext_aufgabenID);
  | 
  |       TaskInstance ti=jbpmContext.getTaskInstance(ext_aufgabenID);
  |             if(ext_action.equalsIgnoreCase("end")){
  |                     if(ti!=null)
  |                     {
  |                             if(ext_transition!=null) {
  |                                     ti.end(ext_transition);
  |                                     log.debug("Transition is not null: 
"+ext_transition);
  |                             }
  |                             else { ti.end(); log.debug("Transition is 
null");}
  |                             log.debug("Ended 
"+ti.getName()+"/"+ti.getId()+" manually");
  |                             return "external_window";
  |                     }
  |                     else {
  |                             log.debug("Transition is empty");
  |                             //TODO exception?
  |                     }
  |             } 
  |             
  |             else if(ext_action.equalsIgnoreCase("start")){
  |                     if(ti!=null){
  |                             ti.start();
  |                             log.debug("Started "+ti.getName()+" manually");
  |                             return "external_window";
  |                     }else{
  |                             log.debug("TaskInstance is null");
  |                             //TODO exception?
  |                     }
  |             } else {
  |                     //TODO falsche aktion
  |             }
  |             
  |       return null;
  |   }
  | 

thanks for your suggestions kukeltje

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4229485#4229485

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4229485
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to