AnsweredAssumed Answered

Cannot run an application

Question asked by parul_vipparthi on Nov 29, 2010
Latest reply on Nov 29, 2010 by parul_vipparthi
Hello

I have two files, a deployer file and an executor file. The deployer file just deploys resources and executer file executes it.

Here is the deployer code

public class UseCaseIndexerCreateWidgetDeployer {

   public static void main(String [] args)
   {
      ProcessEngine processEngine =  new ProcessEngineBuilder()
                              .configureFromResource("activiti.cfg.xml").buildProcessEngine();   
      RepositoryService repositoryService = processEngine.getRepositoryService();

      DeploymentBuilder deployment = repositoryService.createDeployment();
      
      deployment.addClasspathResource("org/idika/galaxy/usecase1/forms/UsecaseIndexerCreateWidget.bpmn20.xml");
      deployment.addClasspathResource("org/idika/galaxy/usecase1/forms/search_document.form");
      deployment.addClasspathResource("org/idika/galaxy/usecase1/forms/create_widget.form");

      deployment.name("UsecaseIndexer");
      deployment.deploy();   
      //repositoryService.deleteDeployment("110");

      processEngine.close();
      System.out.println("Finished deploying");   
   }
}

This works fine.
Generator code

      processEngine =  new ProcessEngineBuilder().configureFromResource("activiti.cfg.xml").buildProcessEngine();   
      runtimeService = processEngine.getRuntimeService();
      formService = processEngine.getFormService();
      repositoryService = processEngine.getRepositoryService();
      taskService = processEngine.getTaskService();      

      Object startForm = formService.getRenderedStartForm("usecase_indexer_createwidget:1");
      
       System.out.println("Start search form … "+ startForm);
       Map<String, Object> variables = new HashMap<String, Object>();
       String fname = "app_fn";
       String lname="app_ln";

       variables.put("firstName", fname);
       variables.put("lastName", lname);
       variables.put("doc_found", Boolean.FALSE);
      
       ProcessInstance pi =  runtimeService.startProcessInstanceByKey("usecase_indexer_createwidget", variables);
       TaskQuery taskquery = taskService.createTaskQuery();
       Task task = taskquery.processInstanceId(pi.getId()).singleResult();

      processEngine.close();
      System.out.println("Finished Indexer Usecase flow");      


This code gives an exception

Nov 29, 2010 6:24:47 PM org.activiti.engine.impl.ProcessEngineImpl <init>
INFO: ProcessEngine default created
Nov 29, 2010 6:24:47 PM org.activiti.engine.impl.bpmn.deployer.BpmnDeployer deploy
INFO: Processing resource org/idika/galaxy/usecase1/forms/create_widget.form
Nov 29, 2010 6:24:47 PM org.activiti.engine.impl.bpmn.deployer.BpmnDeployer deploy
INFO: Processing resource org/idika/galaxy/usecase1/forms/UsecaseIndexerCreateWidget.bpmn20.xml
Nov 29, 2010 6:24:48 PM org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XMLSchema currently not supported as typeLanguage
Nov 29, 2010 6:24:48 PM org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XPath currently not supported as typeLanguage
Nov 29, 2010 6:24:48 PM org.activiti.engine.impl.bpmn.deployer.BpmnDeployer deploy
INFO: Processing resource org/idika/galaxy/usecase1/forms/search_document.form
java.lang.NullPointerException
   at org.activiti.engine.impl.form.JuelFormEngine.getFormTemplateString(JuelFormEngine.java:58)
   at org.activiti.engine.impl.form.JuelFormEngine.renderStartForm(JuelFormEngine.java:34)
   at org.activiti.engine.impl.cmd.GetRenderedStartFormCmd.execute(GetRenderedStartFormCmd.java:61) …..

I have also attached the resources.
The same files work as junit test.

Please help
Thank you
parul

Attachments

Outcomes