This content has been marked as final.
Show 3 replies
-
1. Re: ActionHandler: executionContext.getTaskInstance()=null
iburth Oct 3, 2005 4:17 AM (in response to iburth)Hy,
finally I found the time to investigate this issue. Delving into the codebase I found out, that the executionContext IMHO isn't set up properly.
While TaskInstance&Task are set up correctly in TaskInstance.create(..)/TaskInstance.assign(..)
they aren't set in TaskInstance.start() at all;
I suggest to extend the TaskEventExecutionTestCase to check whether the executionContext is set up correctly by changing the implementation of the inner PlusPlus-class similarly topublic static class PlusPlus implements ActionHandler { private static final long serialVersionUID = 1L; public void execute(ExecutionContext executionContext) throws Exception { counter++; TaskInstance l_ti=executionContext.getTaskInstance(); Task l_task=executionContext.getTask(); if(l_ti==null || l_task==null){ fail("execution Context within "+executionContext.getEvent().toString()+" not properly setUp"); } } }
and to fix TaskInstance.start() with two additional lines:
public void start(){ if (start!=null) { throw new IllegalStateException("task instance '"+id+"' is already started"); } start = new Date(); if ( (task!=null) && (token!=null) ) { ExecutionContext executionContext = new ExecutionContext(token); //------ additional lines ----- executionContext.setTaskInstance(this); executionContext.setTask(task); //----------------------------- task.fireEvent(Event.EVENTTYPE_TASK_START, executionContext); } }
As said I regard this as a fix :-)
It would be great if someone could tell me whether/when this'll be fixed in the codebase :-) -
2. Re: ActionHandler: executionContext.getTaskInstance()=null
icyjamie Oct 3, 2005 10:39 AM (in response to iburth)Well, if you create an entry in JIRA, with a link to this topic, it's ready to be followed up.
-
3. Re: ActionHandler: executionContext.getTaskInstance()=null
iburth Oct 4, 2005 3:44 AM (in response to iburth)Done.
Added as JIRA-Issue: JBPM-394