cancel
Showing results for 
Search instead for 
Did you mean: 

hello world

sarra1
Champ in-the-making
Champ in-the-making
Hi, I'm a beginner in activiti , i try to run a simple process hello world:


import org.activiti.DbProcessEngineBuilder;
import org.activiti.ProcessEngine;
import org.activiti.ProcessService;



public class RunProcess {

   public static void main(String [ ] args){
      //First, boot up the process engine:
      ProcessEngine processEngine = new DbProcessEngineBuilder().configureFromPropertiesResource("activiti.properties").buildProcessEngine();
      ProcessService processService = processEngine.getProcessService();

      //To run the process, it first need to be ‘deployed’ to the engine.
      //Deploying means that the process is parsed and stored in the Activiti database:
      processService.createDeployment().addClasspathResource("hello-world.bpmn20.xml").deploy();

      //execute the process
      processService.startProcessInstanceByKey("helloWorld");
      }
      }


Hi,
———–
I am getting following error while executing the program.
——————–
juin 17, 2013 12:19:48 PM org.activiti.impl.ProcessEngineImpl <init>
INFO: ProcessEngine default created
Exception in thread "main" org.activiti.ActivitiException: couldn't read input stream hello-world.bpmn20.xml
   at org.activiti.impl.util.IoUtil.readInputStream(IoUtil.java:36)
   at org.activiti.impl.repository.DeploymentBuilderImpl.addInputStream(DeploymentBuilderImpl.java:43)
   at org.activiti.impl.repository.DeploymentBuilderImpl.addClasspathResource(DeploymentBuilderImpl.java:52)
   at RunProcess.main(RunProcess.java:16)
Caused by: java.lang.NullPointerException
   at org.activiti.impl.util.IoUtil.readInputStream(IoUtil.java:30)
   … 3 more
———-

thanks
4 REPLIES 4

jbarrez
Star Contributor
Star Contributor
Well, the exception is pretty clear: it can't find your process file.

Where is this file? Are you using maven? etc …

sarra1
Champ in-the-making
Champ in-the-making
thank's, it s ok
juin 17, 2013 1:48:57 PM org.activiti.impl.ProcessEngineImpl <init>
INFO: ProcessEngine default created
juin 17, 2013 1:48:58 PM org.activiti.impl.bpmn.BpmnDeployer deploy
INFO: Processing resource hello-world.bpmn20.xml
Hello world

ronit_taranekar
Champ in-the-making
Champ in-the-making
Getting the same error… How did it got solved ?

ronit_taranekar
Champ in-the-making
Champ in-the-making
Ok solved… it needs to be in same folder as of java file