2 Replies Latest reply on Jun 3, 2009 2:58 AM by Johan Kumps

    java activity argument problem

    sk nam Newbie

      Hi, all~!
      I'm using jbpm4-beta2 version and jpdl java activity.
      but i don't know how java activity invoke method with Object type argument.

      <?xml version="1.0" encoding="UTF-8"?>
      
      <process name="Java" xmlns="http://jbpm.org/4.0/jpdl">
      
       <start g="20,20,48,48">
       <transition name="" to="invoke java method"/>
       </start>
      
       <java class="com.xener.jbpm.JohnDoe" g="96,16,127,52" method="hello" name="invoke java method" var="answer">
      
       <field name="state"><string value="fine"/></field>
       <field name="session"><env type="org.hibernate.Session"/></field>
      
       <arg>
       <object class="com.xener.jbpm.JohnDoeMsg">
       <field name="msg"><string value="#{msgObject}"/></field>
       </object>
       </arg>
      
       <transition name="" to="wait"/>
      
       </java>
      
       <state g="255,16,88,52" name="wait"/>
      
      </process>


      Thanks for any help~!

        • 1. Re: java activity argument problem
          sk nam Newbie

           

          "nuvole" wrote:
          Hi, all~!
          I'm using jbpm4-beta2 version and jpdl java activity.
          but i don't know how java activity invoke method with Object type argument.

          <?xml version="1.0" encoding="UTF-8"?>
          
          <process name="Java" xmlns="http://jbpm.org/4.0/jpdl">
          
           <start g="20,20,48,48">
           <transition name="" to="invoke java method"/>
           </start>
          
           <java class="com.xener.jbpm.JohnDoe" g="96,16,127,52" method="hello" name="invoke java method" var="answer">
          
           <field name="state"><string value="fine"/></field>
           <field name="session"><env type="org.hibernate.Session"/></field>
          
           <arg>
           <object class="com.xener.jbpm.JohnDoeMsg">
           <field name="msg"><string value="#{msgObject}"/></field>
           </object>
           </arg>
          
           <transition name="" to="wait"/>
          
           </java>
          
           <state g="255,16,88,52" name="wait"/>
          
          </process>


          but this error occured:
          16:38:12,187 ERROR [STDERR] org.hibernate.HibernateException: instance not of expected entity type:
          org.jbpm.pvm.internal.type.variable.UnpersistableVariable is not a: org.jbpm.pvm.internal.type.Vari
          ble
           at org.hibernate.persister.entity.AbstractEntityPersister.getSubclassEntityPersister(Abstra
          tEntityPersister.java:3663)
           at org.hibernate.impl.SessionImpl.getEntityPersister(SessionImpl.java:1374)
           at org.hibernate.engine.ForeignKeys.isTransient(ForeignKeys.java:203)
           at org.hibernate.event.def.AbstractSaveEventListener.getEntityState(AbstractSaveEventListen
          r.java:535)
           at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSave
          rUpdateEventListener.java:103)
           at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpd
          teEventListener.java:93)
           at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:534)
           at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:526)
           at org.hibernate.engine.CascadingAction$5.cascade(CascadingAction.java:241)
           at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:291)
           at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:239)
           at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:192)
           at org.hibernate.engine.Cascade.cascadeCollectionElements(Cascade.java:319)
           at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java:265)
           at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:242)
           at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:192)
           at org.hibernate.engine.Cascade.cascade(Cascade.java:153)
           at org.hibernate.event.def.AbstractFlushingEventListener.cascadeOnFlush(AbstractFlushingEve
          tListener.java:154)
           at org.hibernate.event.def.AbstractFlushingEventListener.prepareEntityFlushes(AbstractFlush
          ngEventListener.java:145)
           at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(Abstra
          tFlushingEventListener.java:88)
           at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java
          49)
           at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1027)
           at org.jbpm.pvm.internal.tx.HibernateSessionResource.prepare(HibernateSessionResource.java:
          4)
           at org.jbpm.pvm.internal.tx.StandardTransaction.commit(StandardTransaction.java:106)
           at org.jbpm.pvm.internal.tx.StandardTransaction.complete(StandardTransaction.java:65)
           at org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInter
          eptor.java:61)
           at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:54)
           at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)
           at org.jbpm.pvm.internal.svc.ExecutionServiceImpl.startProcessInstanceByKey(ExecutionServic
          Impl.java:72)
           at com.xener.jbpm.JavaInstantiateTest.testJavaInstantiate(JavaInstantiateTest.java:65)
           at com.xener.jbpm.web.JBPMServlet.doGet(JBPMServlet.java:23)
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.
          ava:290)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206
          
           at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.
          ava:235)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206
          
           at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
           at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
           at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.j
          va:190)
           at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
           at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextE
          tablishmentValve.java:126)
           at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEs
          ablishmentValve.java:70)
           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
           at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java
          158)
           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
           at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
           at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.j
          va:601)
           at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
           at java.lang.Thread.run(Thread.java:619)
          


          Thanks for any help~!


          • 2. Re: java activity argument problem
            Johan Kumps Newbie

            In case you still got the problem. I also had this error due to the fact the Object I was adding as a variable was not Serializable.

            Implementing java.io.Serializable should fix this error.

            Greetz