0 Replies Latest reply on Mar 24, 2008 7:55 AM by Sara Rodríguez Dorrego

    Check if a process definition is deployed

    Sara Rodríguez Dorrego Novice

      Hello!!

      I'm trying to check if an process definition is deployed. I use this code to check it:

      Definition definition = null;
      
      ExecutionService executionService =jbpmServiceFactory.openExecutionService("admin");
      definition = executionService.getLatestDefinition( "altaProyecto" );
      executionService.close();
      
      


      My process definition is very simple. It hasn't anything special. Only 3 tasks that don't do any.

      <?xml version="1.0" encoding="UTF-8"?>
      
      <process-definition xmlns="" name="altaProyecto">
      
       <swimlane name="boss">
       <delegation class="org.jbpm.delegation.assignment.ActorAssignmentHandler">admin</delegation>
       </swimlane>
      
      
       <start-state name="Introducir datos del proyecto">
       <transition to="task-node1" name="to task-node1"></transition>
       </start-state>
      
      
       <task-node name="task-node1">
       <transition to="Fin"></transition>
       </task-node>
      
      
       <end-state name="Fin"></end-state>
      
      
      </process-definition>
      


      but it is thrown the following exception:

      12:45:52,811 ERROR [LogInterceptor] RuntimeException in method: public abstract
      boolean sessionJbpm.JbpmFacadeRemote.estaDesplegado(java.lang.String) throws jav
      a.rmi.RemoteException:
      java.lang.NullPointerException
       at org.jbpm.JbpmServiceFactory.openExecutionService(JbpmServiceFactory.j
      ava:57)
       at sessionJbpm.JbpmFacade.estaDesplegado(JbpmFacade.java:74)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.invocation.Invocation.performCall(Invocation.java:359)
       at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(S
      tatelessSessionContainer.java:237)
       at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invo
      ke(CachedConnectionInterceptor.java:158)
       at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(Stat
      elessSessionInstanceInterceptor.java:169)
       at org.jboss.ws.server.ServiceEndpointInterceptor.invoke(ServiceEndpoint
      Interceptor.java:64)
       at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidation
      Interceptor.java:63)
       at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInte
      rceptor.java:121)
       at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep
      torCMT.java:350)
       at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:1
      81)
       at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.
      java:168)
       at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
       at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFacto
      ryFinderInterceptor.java:136)
       at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:6
      48)
       at org.jboss.ejb.Container.invoke(Container.java:954)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
      er.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
      java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke
      (JRMPInvoker.java:819)
       at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:
      420)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
       at sun.rmi.transport.Transport$1.run(Transport.java:153)
       at java.security.AccessController.doPrivileged(Native Method)
       at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
       at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
      66)
       at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
      .java:707)
       at java.lang.Thread.run(Thread.java:595)
      




      Exist any method than check if a process definition is deployed? How I have to do for check this? Have I to execute a query that check if exist in the DB??



      Thanks,