iam writing a webapplication(jsps and servlets(client)),
iam using the following class to call the jbpm engine to get the data but it is 
not behaving as i think iam using the following code for the starting of the 
process :

public String startProcessInstance(long processDefinitionId,List 
taskFormParams) 
{
JbpmContext jbpmContext = null;
try {
      System.out.println(" the process definition id is " + rocessDefinitionId);
        jbpmContext = jbpmConfiguration.createJbpmContext();

        Connection conn = jbpmContext.getConnection();
        conn.setAutoCommit(true);
        GraphSession graphSession = jbpmContext.getGraphSession();
        ProcessDefinition processDefinition =                           
graphSession.loadProcessDefinition(processDefinitionId);
        ProcessInstance processInstance =                               
jbpmContext.newProcessInstance(processDefinition.getName());
        ContextInstance contextInstance = (ContextInstance) 
processInstance.getInstance(ContextInstance.class);
                        int size=taskFormParams.size();
                        for(int i=0;i<size;i++)
                        {
                                TaskFormParameter taskFormParam = 
(TaskFormParameter)taskFormParams.get(i);
                                System.out.println("the task form param is 
"+taskFormParam);
                                String label = taskFormParam.getLabel();
                                System.out.println("the label is "+label);
                                
contextInstance.setVariable(label,taskFormParam.getValue());
                        }

        TaskInstance startTaskInstance =                                
processInstance.getTaskMgmtInstance().createStartTaskInstance();
        Task task = startTaskInstance.getTask();
        StartState startState = task.getStartState();
        startTaskInstance.start(startState.getName());
        List transitions = startTaskInstance.getAvailableTransitions();
        int size1 = transitions.size();
        System.out.println("the no of transitions" + size1);
        String name = "";
        Transition transition = null;
        for (int i = 0; i < size1; i++) {
        System.out.println("the transaction is " + transitions.get(i));
        transition = (Transition) transitions.get(i);
        name = ((Transition) transitions.get(i)).getName();
        System.out.println(" the name of the transition is " + name);
        }
System.out.println(" the name is " + name);
if (transition != null) {
startTaskInstance.end(name);
System.out.println("the transition is u r at the end of transtionin if b;ock");
}
 else {
        startTaskInstance.end();
}
processInstance.signal();
conn.setAutoCommit(false);
                        jbpmContext.close();

                } catch (JbpmPersistenceException e) {
                        System.out.println(
                                "this is persisstence exception" + 
e.fillInStackTrace());
                } catch (Exception e) {
                        System.out.println(e.fillInStackTrace());
                } finally {
                        System.out.println(
                                " this is in final section to close the 
context");

                }
                return "task";
        }

i thought that it illl execute the start state and it ill stop at the second 
state but it is also executing the next state also.
it is behaving differently i didnt find any eror in this code and also the 
console si not showing any errors.
please help me or guide me i am a new bie to JBPM how to write 
webapplication(simple jsps and servlets ) with out using the beans of the JBPM 
webapplication.
"Any help regarding this will be appriciated".
Regards,
mohan.

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

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3954647

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to