[jboss-user] [JBoss jBPM] - Re: calling process from the database of JBPM

btl_ayd do-not-reply at jboss.com
Fri Jun 27 08:47:11 EDT 2008


Hi I treid it but it didnt work.I want to start this process in java class.
I changed   	"JbpmConfiguration jbpmConfiguration =JbpmConfiguration.getInstance(); " as a "JbpmConfiguration jbpmConfiguration =JbpmConfiguration.parseResource("jbpm.cfg.xml");"
and here is my all code that calling process:



  | public static  void startProcessDefinition() {
  | 		String processDefinitionName = new String("websale");
  | 		JbpmConfiguration jbpmConfiguration =JbpmConfiguration.parseResource("jbpm.cfg.xml");
  | 	
  | 		JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
  | 		try {
  | 			GraphSession graphSession = jbpmContext.getGraphSession();
  | 			ProcessDefinition definition = graphSession.findLatestProcessDefinition(processDefinitionName);
  | 			System.out.println(graphSession.getProcessDefinition(2));
  | 			ProcessInstance instance = definition.createProcessInstance();
  | 			instance.signal();
  | 			
  | 			jbpmContext.save(instance);
  | 		} finally {
  | 			jbpmContext.close();
  | 		}
  | 	}
  | 	public static void main(String[] args) {
  | 		
  |       uzak.startProcessDefinition();
  | 	}
  | 

here is error has been occured


  | 15:37:12,229 [main] ERROR JDBCExceptionReporter : Table not found in statement [select top ? processdef0_.ID_ as ID1_0_, processdef0_.NAME_ as NAME3_0_, processdef0_.DESCRIPTION_ as DESCRIPT4_0_, processdef0_.VERSION_ as VERSION5_0_, processdef0_.ISTERMINATIONIMPLICIT_ as ISTERMIN6_0_, processdef0_.STARTSTATE_ as STARTSTATE7_0_ from JBPM_PROCESSDEFINITION processdef0_ where processdef0_.NAME_=? order by processdef0_.VERSION_ desc]
  | org.hibernate.exception.SQLGrammarException: could not execute query
  | 	at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
  | 	at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
  | 	at org.hibernate.loader.Loader.doList(Loader.java:2223)
  | 	at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
  | 	at org.hibernate.loader.Loader.list(Loader.java:2099)
  | 	at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
  | 	at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
  | 	at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
  | 	at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
  | 	at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
  | 	at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:811)
  | 	at org.jbpm.db.GraphSession.findLatestProcessDefinition(GraphSession.java:153)
  | 	at uzak.startProcessDefinition(uzak.java:28)
  | 	at uzak.main(uzak.java:40)
  | Caused by: java.sql.SQLException: Table not found in statement [select top ? processdef0_.ID_ as ID1_0_, processdef0_.NAME_ as NAME3_0_, processdef0_.DESCRIPTION_ as DESCRIPT4_0_, processdef0_.VERSION_ as VERSION5_0_, processdef0_.ISTERMINATIONIMPLICIT_ as ISTERMIN6_0_, processdef0_.STARTSTATE_ as STARTSTATE7_0_ from JBPM_PROCESSDEFINITION processdef0_ where processdef0_.NAME_=? order by processdef0_.VERSION_ desc]
  | 	at org.hsqldb.jdbc.Util.throwError(Unknown Source)
  | 	at org.hsqldb.jdbc.jdbcPreparedStatement.<init>(Unknown Source)
  | 	at org.hsqldb.jdbc.jdbcConnection.prepareStatement(Unknown Source)
  | 	at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:505)
  | 	at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:423)
  | 	at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
  | 	at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1547)
  | 	at org.hibernate.loader.Loader.doQuery(Loader.java:673)
  | 	at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
  | 	at org.hibernate.loader.Loader.doList(Loader.java:2220)
  | 	... 11 more
  | Exception in thread "main" org.jbpm.JbpmException: couldn't find process definition 'websale'
  | 	at org.jbpm.db.GraphSession.findLatestProcessDefinition(GraphSession.java:170)
  | 	at uzak.startProcessDefinition(uzak.java:28)
  | 	at uzak.main(uzak.java:40)
  | Caused by: org.hibernate.exception.SQLGrammarException: could not execute query
  | 	at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
  | 	at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
  | 	at org.hibernate.loader.Loader.doList(Loader.java:2223)15:37:12,430 [main] ERROR GraphSession : org.hibernate.exception.SQLGrammarException: could not execute query
  | 15:37:12,430 [main] DEBUG JbpmContext : closing JbpmContext
  | 15:37:12,430 [main] DEBUG Services : closing service 'persistence': org.jbpm.persistence.db.DbPersistenceService at 98bbf6
  | 15:37:12,430 [main] DEBUG DbPersistenceService : committing hibernate transaction org.hibernate.transaction.JDBCTransaction at 1c6a99d
  | 15:37:12,430 [main] DEBUG DbPersistenceService : closing hibernate session
  | 15:37:12,430 [main] DEBUG Services : closing service 'tx': org.jbpm.tx.TxService at 1aa0e3b
  | 
  | 	at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
  | 	at org.hibernate.loader.Loader.list(Loader.java:2099)
  | 	at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
  | 	at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
  | 	at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
  | 	at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
  | 	at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
  | 	at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:811)
  | 	at org.jbpm.db.GraphSession.findLatestProcessDefinition(GraphSession.java:153)
  | 	... 2 more
  | Caused by: java.sql.SQLException: Table not found in statement [select top ? processdef0_.ID_ as ID1_0_, processdef0_.NAME_ as NAME3_0_, processdef0_.DESCRIPTION_ as DESCRIPT4_0_, processdef0_.VERSION_ as VERSION5_0_, processdef0_.ISTERMINATIONIMPLICIT_ as ISTERMIN6_0_, processdef0_.STARTSTATE_ as STARTSTATE7_0_ from JBPM_PROCESSDEFINITION processdef0_ where processdef0_.NAME_=? order by processdef0_.VERSION_ desc]
  | 	at org.hsqldb.jdbc.Util.throwError(Unknown Source)
  | 	at org.hsqldb.jdbc.jdbcPreparedStatement.<init>(Unknown Source)
  | 	at org.hsqldb.jdbc.jdbcConnection.prepareStatement(Unknown Source)
  | 	at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:505)
  | 	at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:423)
  | 	at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
  | 	at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1547)
  | 	at org.hibernate.loader.Loader.doQuery(Loader.java:673)
  | 	at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
  | 	at org.hibernate.loader.Loader.doList(Loader.java:2220)
  | 	... 11 more
  | 
here is my jbpm.cfg.xml:

   <jbpm-configuration>
  | 
  |   <!-- 
  |     This configuration is used when there is no jbpm.cfg.xml file found in the 
  |     root of the classpath.  It is a very basic configuration without persistence
  |     and message services.  Only the authorization service installed.
  |     You can parse and create processes, but when you try to use one of the 
  |     unavailable services, you'll get an exception.
  |   -->
  |   
  |   <jbpm-context>
  |     <service name="persistence" factory="org.jbpm.persistence.db.DbPersistenceServiceFactory" />
  |     <service name="tx" factory="org.jbpm.tx.TxServiceFactory" />
  |     <service name="message" factory="org.jbpm.msg.db.DbMessageServiceFactory" />
  |     <service name="scheduler" factory="org.jbpm.scheduler.db.DbSchedulerServiceFactory" />
  |     <service name="logging" factory="org.jbpm.logging.db.DbLoggingServiceFactory" />
  |     <service name="authentication" factory="org.jbpm.security.authentication.DefaultAuthenticationServiceFactory" />
  |   </jbpm-context>
  | 
  |   <!-- configuration property used by persistence service impl org.jbpm.persistence.db.DbPersistenceServiceFactory -->
  |   <string name="resource.hibernate.cfg.xml" value="hibernate.cfg.xml" />
  | 
  |   <!-- configuration resource files pointing to default configuration files in jbpm-{version}.jar -->
  |   <string name="resource.business.calendar" value="org/jbpm/calendar/jbpm.business.calendar.properties" />
  |   <string name="resource.default.modules" value="org/jbpm/graph/def/jbpm.default.modules.properties" />
  |   <string name="resource.converter" value="org/jbpm/db/hibernate/jbpm.converter.properties" />
  |   <string name="resource.action.types" value="org/jbpm/graph/action/action.types.xml" />
  |   <string name="resource.node.types" value="org/jbpm/graph/node/node.types.xml" />
  |   <string name="resource.parsers" value="org/jbpm/jpdl/par/jbpm.parsers.xml" />
  |   <string name="resource.varmapping" value="org/jbpm/context/exe/jbpm.varmapping.xml" />
  |   <string name="resource.mail.templates" value="jbpm.mail.templates.xml" />
  | 
  |   <int    name="jbpm.byte.block.size" value="1024" singleton="true" />
  |   <string name="jbpm.mail.smtp.host" value="localhost" />
  |  <bean name="jbpm.task.instance.factory" class="org.jbpm.taskmgmt.impl.DefaultTaskInstanceFactoryImpl" singleton="true" />
  |   <!--  bean name="jbpm.task.instance.factory" class="org.jbpm.taskinstance.CustomTaskInstanceFactoryImpl" singleton="true" /-->
  |   <bean   name="jbpm.variable.resolver" class="org.jbpm.jpdl.el.impl.JbpmVariableResolver" singleton="true" />
  |   <bean   name="jbpm.mail.address.resolver" class="org.jbpm.identity.mail.IdentityAddressResolver" singleton="true" />
  |   
  |   <bean name="jbpm.job.executor" class="org.jbpm.job.executor.JobExecutor">
  |     <field name="jbpmConfiguration"><ref bean="jbpmConfiguration" /></field>
  |     <field name="name"><string value="JbpmJobExector" /></field>
  |     <field name="nbrOfThreads"><int value="1" /></field>
  |     <field name="idleInterval"><int value="2500" /></field>
  |     <field name="maxIdleInterval"><int value="3600000" /></field>
  |     <field name="historyMaxSize"><int value="20" /></field>
  |   </bean>
  | 
  | </jbpm-configuration>
  | 
What is wrong can you help me?
Thx.

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

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



More information about the jboss-user mailing list