<HTML>
<HEAD>
<TITLE>Can't deploy a process from API</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Hi All,<BR>
Trying to deploy a process from the Java API instead of the ant task&#8212;Java tells me that the process has deployed, and I get an ID back, but nothing shows up in the GWT-console app, and there&#8217;s nothing in the database. &nbsp;What am I missing?<BR>
<BR>
public class ProcessDeployer {

 &nbsp;&nbsp;&nbsp;ProcessEngine processEngine = new Configuration().buildProcessEngine();
 &nbsp;&nbsp;&nbsp;RepositoryService repositoryService = processEngine.getRepositoryService();

 &nbsp;&nbsp;&nbsp;public ProcessDeployer (String filePath) { &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;File deployment = new File(filePath);
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String deploymentDbid = repositoryService.createDeployment().addResourceFromFile(deployment).deploy();
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(&quot;DeploymentID is: &quot; +deploymentDbid);
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 &nbsp;&nbsp;&nbsp;}
 &nbsp;&nbsp;&nbsp;
 &nbsp;&nbsp;public ArrayList&lt;Deployment&gt; getDeployments() {
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DeploymentQuery query = repositoryService.createDeploymentQuery();
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return (ArrayList&lt;Deployment&gt;) query.list();
 &nbsp;&nbsp;}

}<BR>
<BR>
public class TestDeployer {

 &nbsp;&nbsp;&nbsp;/**
 &nbsp;&nbsp;&nbsp;&nbsp;* @param args
 &nbsp;&nbsp;&nbsp;&nbsp;*/
 &nbsp;&nbsp;&nbsp;public static void main(String[] args) {
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ProcessDeployer pd = new ProcessDeployer(&quot;/Users/emiller/jbpm-4.0/examples/src/org/jbpm/examples/task/variables/process.jpdl.xml&quot;);
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ArrayList &lt;Deployment&gt; deployments = pd.getDeployments();
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for (int i=0; i&lt; deployments.size(); i++) {
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Deployment deploy = (Deployment)deployments.get(i);
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(deploy.getState());
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>
<BR>
<BR>
Here&#8217;s my output:<BR>
14:52:30,482 INF | [Environment] Hibernate 3.3.1.GA
14:52:30,486 INF | [Environment] hibernate.properties not found
14:52:30,487 INF | [Environment] Bytecode provider name : javassist
14:52:30,491 INF | [Environment] using JDK 1.4 java.sql.Timestamp handling
14:52:30,531 INF | [Configuration] configuring from resource: jbpm.hibernate.cfg.xml
14:52:30,531 INF | [Configuration] Configuration resource: jbpm.hibernate.cfg.xml
14:52:30,591 INF | [Configuration] Reading mappings from resource : jbpm.repository.hbm.xml
14:52:30,722 INF | [Configuration] Reading mappings from resource : jbpm.execution.hbm.xml
14:52:30,867 INF | [Configuration] Reading mappings from resource : jbpm.history.hbm.xml
14:52:30,921 INF | [Configuration] Reading mappings from resource : jbpm.task.hbm.xml
14:52:30,952 INF | [Configuration] Reading mappings from resource : jbpm.identity.hbm.xml
14:52:31,002 INF | [Configuration] Configured SessionFactory: null
14:52:31,019 INF | [DriverManagerConnectionProvider] Using Hibernate built-in connection pool (not for production use!)
14:52:31,019 INF | [DriverManagerConnectionProvider] Hibernate connection pool size: 20
14:52:31,019 INF | [DriverManagerConnectionProvider] autocommit mode: false14:52:31,021 INF | [DriverManagerConnectionProvider] using driver: org.hsqldb.jdbcDriver at URL: jdbc:hsqldb:mem:.
14:52:31,021 INF | [DriverManagerConnectionProvider] connection properties: {user=sa, password=****}
14:52:31,211 INF | [Dialect] Using dialect: org.hibernate.dialect.HSQLDialect
14:52:31,216 INF | [TransactionFactoryFactory] Using default transaction strategy (direct JDBC transactions)
14:52:31,221 INF | [TransactionManagerLookupFactory] No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
14:52:31,225 INF | [ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory
14:52:31,286 INF | [SessionFactoryImpl] building session factory
14:52:32,050 INF | [SessionFactoryObjectFactory] Not binding factory to JNDI, no JNDI name configured
14:52:32,063 INF | [SchemaExport] Running hbm2ddl schema export
14:52:32,064 INF | [SchemaExport] exporting generated schema to database
14:52:32,100 INF | [SchemaExport] schema export complete
DeploymentID is: 1
active
<BR>
<BR>
Thanks,<BR>
Erin<BR>
<BR>
<BR>
</SPAN></FONT>
</BODY>
</HTML>