cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot run an application

parul_vipparthi
Champ on-the-rise
Champ on-the-rise
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
4 REPLIES 4

frederikherema1
Star Contributor
Star Contributor
Hi,

Looks like your formKey is invalid:
<startEvent id="StartNoneEvent_2" activiti:formKey="org/activiti/examples/taskforms/search_document.form"/>

Should be something like "org/idika/galaxy/usecase1/forms/search_document.form" -> path inside the deployed BAR

parul_vipparthi
Champ on-the-rise
Champ on-the-rise
Right! and so it worked with junit.
Thank you for a quick reply.

parul

parul_vipparthi
Champ on-the-rise
Champ on-the-rise
hello again,

I ran deployer again after changing bpmn formKey. but still it gives the same error. does it not override with the same deployment name? Do I have to delete all previous deployments? if so please guide.

Thank you


parul

parul_vipparthi
Champ on-the-rise
Champ on-the-rise