[JBoss jBPM] - dynamically create tasks
by AJanz
i got the following code to generate dynamically tasks on a node.
| public Object execute(JbpmContext jbpmContext) throws Exception {
| // TODO Auto-generated method stub
| // TODO Auto-generated method stub
|
| Boolean b;
| try {
| b = Boolean.TRUE;
| ProcessInstance pi = jbpmContext
| .loadProcessInstance(processid);
| for (int i = 0; i < actors.size(); i++) {
| String actor = (String) actors.get(i);
| TaskInstance ti = pi.getTaskMgmtInstance()
| .createTaskInstance();
| ti.setActorId(actor);
| jbpmContext.save(ti);
| }
| jbpmContext.save(pi);
| } catch (Exception e) {
| // TODO: handle exception
| e.printStackTrace();
| b= Boolean.FALSE;
| }
| return b;
| }
|
|
sometimes i got a nullpointer exception on
TaskInstance ti = pi.getTaskMgmtInstance()
the processid is set correct.
any idea what might be wrong?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4180295#4180295
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4180295
15 years, 9 months
[JBoss jBPM] - Re: Swimlane, groups and their fields
by provaJbpm
i'm working with HyperSqL default db for jbpm-suite.
this is my flow:
| <process-definition
| xmlns="urn:jbpm.org:jpdl-3.2" name="trip">
| <swimlane name="Clienti">
| <assignment expression="group(Clienti)"></assignment>
| </swimlane>
| <swimlane name="TourOperator">
| <assignment expression="group(TourOperator)"></assignment>
| </swimlane>
| <start-state name="richiesta pacchetto vacanza">
| <task name="Richiesta domanda" swimlane="Clienti">
| <controller>
| <variable name="data partenza" access="read,write,required" mapped-name="Data di partenza"></variable>
| </controller>
| </task>
| <transition name="richiesta verifica" to="verifica disponibilita"></transition>
| </start-state>
|
|
| <decision name="verifica disponibilita">
| <handler
| class='com.sample.action.VerificaDisponibilita'>
| </handler>
| <transition name="verifica negativa" to="prenotazione terminata"></transition>
| <transition name="verifica positiva" to="invio pagamento"></transition>
| </decision>
| <fork name="invio pagamento">
| <event type="node-enter">
| <action name="controllo scelta pagamento" class="com.sample.action.VerificaTipoPagamento"></action>
| </event>
| <transition name="pagamento carta" to="carta di credito"></transition>
| <transition name="pagamento contanti" to="contanti"></transition>
| </fork>
| <state name="carta di credito">
| <transition name="pagamento carta ok" to="pagamento ok"></transition>
| </state>
| <state name="contanti">
| <transition name="pagamento contanti ok" to="pagamento ok"></transition>
| </state>
| <join name="pagamento ok">
| <transition name="prenotazione eseguita" to="prenotazione ok"></transition>
| </join>
|
| <end-state name="prenotazione terminata"></end-state>
| <state name="prenotazione ok">
| <transition name="termina flusso" to="prenotazione terminata"></transition>
| </state>
|
| </process-definition>
|
it is in italian language :) thanks.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4180272#4180272
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4180272
15 years, 9 months