Seam with jBPM - task(slash)process id may not be null
naruszef Jul 25, 2008 11:58 AMHi!
I'm seam beginner and I have got problems with integrating seam with jBPM. (using JBoss AS 4.2 and Seam 2.0.2)
I have got two Stateful Session Beans:
@Stateful
@Name("startProcess")
@Scope(ScopeType.BUSINESS_PROCESS)
public class StartProcessBean implements StartProcess{
@In(value="processInstance", required=false, scope=ScopeType.BUSINESS_PROCESS)
@Out(value="processInstance", required=false)
ProcessInstance processInstance;
@In(value="taskInstance", required=false, scope=ScopeType.BUSINESS_PROCESS)
@Out(value="taskInstance", required=false)
TaskInstance taskInstance;
@Begin
@CreateProcess(definition="todo")
public String begin(){
log.info("begining");
return "success";
}
@Remove
public void remove(){
log.info("removed");
}
@Logger
Log log;
}and
@Stateful
@Scope(ScopeType.BUSINESS_PROCESS)
@Name("start")
public class StartMyTaskBean implements StartMyTask {
@Logger
Log log;
@In(required=false,value="processInstance")
ProcessInstance processInstance;
@In(required=false,value="taskInstance")
TaskInstance taskInstance;
@StartTask()
public void beginTask() {
log.info("Task started");
}
@EndTask
public void endTask(){
log.info("Task ended");
}
@Remove
public void remove(){
log.info("Removed");
}
}I'm invoking this beans methods from form:
<h:commandButton value="Create process" action="#{startProcess.begin}"/>
<h:commandButton value="Begin" action="#{start.beginTask}"/>
<h:commandButton value="End" action="#{start.endTask}"/>
When i click on Create process button everything looks ok, but when i try to begin task using Begin button, I see the debug page with message:
Exception during request processing:
Caused by javax.servlet.ServletException with message: "#{start.beginTask}: javax.ejb.EJBTransactionRolledbackException: task/process id may not be null" Server logs looks ok, jbpm configuration also...
Could anyone tell me, what is wrong?
Thanks and regards!
Jakub Naruszewicz