How to start a process?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2012 05:33 AM
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
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
Labels:
- Labels:
-
Archive
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2012 11:22 AM
Since you use the designer, the easiest way to only start a process instance is using a junit-test.
Right-click on your bpmn20.xml file and select Activiti "Generate Unit Test"
Now you will find a .java file in src/test/java run this file as a "JUnit test".
This is also described in the user guide
Regards,
michael
Right-click on your bpmn20.xml file and select Activiti "Generate Unit Test"
Now you will find a .java file in src/test/java run this file as a "JUnit test".
This is also described in the user guide
Regards,
michael

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2012 01:50 AM
check out this link 'JavaRanch FAQ HowToAskQuestionsOnJavaRanch' Basically i ma not able to find out any error in your code so you can try this link.
