AnsweredAssumed Answered

How to start a process?

Question asked by kg86 on Mar 1, 2012
Latest reply on Mar 3, 2012 by albasmith
Hi,
I created an activiti process in the eclipse designer. It's only one Script task with Syste.out.println("Hello"); .
Now I want to run this process. But I don't know how? Run as java class and run as java applet wasn't sucessfull.

What I have to do to run a created process?

Edit:
I have found a tutorial. So I tried this code:

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("MyProcess.bpmn20.xml").deploy();
      
      //execute the process
      processService.startProcessInstanceByKey("MyProcess");
   }   
}

But there come an error:
'Editor does not contain a main type.'

Can someone find my mistake? Thanks a lot.

CU,
Kai

Outcomes