4 Replies Latest reply on Jun 1, 2008 1:56 PM by kukeltje

    Changes to Task object not reflected in DB

    hashir

      Hi,

      I am running into a strange problem. It seems that I can not assign a user to a task with the code. The task below contains a swimlane as well i.e.

      <swimlane name="Initiator" />
      


      but when I try to assign an actor to this swimlane the change is not affected to the database ( Oracle 10g).

       try
       {
      
       ProcessDefinition prcoessDefinition = jbpmContext.getGraphSession().findLatestProcessDefinition( "LeaveApplicationProcess" );
      
       ProcessInstance process = new ProcessInstance( prcoessDefinition );
      TaskInstance applyForLeaveTask = process.getTaskMgmtInstance().createStartTaskInstance();
       applyForLeaveTask.setActorId( user );
       applyForLeaveTask.getSwimlaneInstance().setActorId( user );
      
       /* remaining code goes here */
      
       // Task completed.
       applyForLeaveTask.end();
      
       jbpmContext.save( process );
       }
       finally
       {
       jbpmContext.close();
       }
      


      The log is as follows:

      [WARN] ProxyWarnLog - Narrowing proxy to class org.jbpm.graph.node.StartState - this operation breaks ==
      [WARN] ProxyWarnLog - Narrowing proxy to class org.jbpm.graph.node.TaskNode - this operation breaks ==
      [WARN] ProxyWarnLog - Narrowing proxy to class org.jbpm.graph.node.TaskNode - this operation breaks ==
      [WARN] ProxyWarnLog - Narrowing proxy to class org.jbpm.graph.node.StartState - this operation breaks ==
      [WARN] ProxyWarnLog - Narrowing proxy to class org.jbpm.graph.node.TaskNode - this operation breaks ==
      


      Any idea?


      Hashir Ahmed

        • 1. Re: Changes to Task object not reflected in DB
          hashir

          My fault :). The userid was null & jbpm correctly updated DB with null.

          • 2. Re: Changes to Task object not reflected in DB
            zhanglikui888

            mmmmm

            • 3. Re: Changes to Task object not reflected in DB
              zhanglikui888

              I have the same problem,the below code is the detail:
              JbpmConfiguration config=JbpmConfiguration.getInstance();
              JbpmContext jbpmContext=config.createJbpmContext();
              //Session session=jbpmContext.getSessionFactory().openSession();
              //Transaction trans=session.beginTransaction();

              ProcessDefinition pd=jbpmContext.getGraphSession().findLatestProcessDefinition("baoxiao");
              //ProcessInstance pi=pd.createProcessInstance();
              ProcessInstance pi= new ProcessInstance(pd);
              pi.getContextInstance().setVariable(Constants.ISSUE_USER, Constants.userName);

              TaskInstance ti=pi.getTaskMgmtInstance().createStartTaskInstance();
              ti.setVariable("baoxiaoId", 6);//baoxiao.getBaoxiaoId());
              ti.end();



              the log is follow:
              2008-06-01 17:26:43,906 [org.hibernate.engine.StatefulPersistenceContext.ProxyWarnLog]
              [WARN] Narrowing proxy to class org.jbpm.graph.node.StartState - this operation breaks ==
              2008-06-01 17:26:47,421 [org.hibernate.engine.StatefulPersistenceContext.ProxyWarnLog]
              [WARN] Narrowing proxy to class org.jbpm.graph.node.TaskNode - this operation breaks ==

              • 4. Re: Changes to Task object not reflected in DB
                kukeltje

                those are WARNings, not errors, furthermore your 'problem' is totally different. Thirdly, you do not mention what your 'problem' is. is it the same as the subject? Forth, You post partial code (or your code is incomplete) since you do not close the context anywhere, nor mention that it is done somewhere.