cancel
Showing results for 
Search instead for 
Did you mean: 

DeploymentBuilder addInputStream

jmiller
Champ in-the-making
Champ in-the-making
Hello.  I tried to create a deployment using the DeploymentBuilder.addInputStream method providing a .bpmn20.xml file and it didn't create a deployment.  I'm wondering what I'm missing.  Here is my code:

ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
RepositoryService repositoryService = processEngine.getRepositoryService();
File f = new File("/Users/jmiller/Dev/Projects/activiti-sandbox/MyProcess.bpmn20.xml");
FileInputStream fis = new FileInputStream(f);
repositoryService.createDeployment().addInputStream("activitiAdhoc", fis).deploy();

Here's my process element from MyProcess.bpmn20.xml.  I figured I needed to match the process id to the resourceName of the method call:

<process id="activitiAdhoc" name="Adhoc Activiti Process">

When this didn't work, I copied the xml file to my classpath and called addClasspathResource instead - that worked for this example but may not work as well for us in our project:

repositoryService.createDeployment().addClasspathResource("MyProcess.bpmn20.xml").deploy();

I'm running Activiti-5.9 on Java version 1.6.0_31.  Thank you for your response.  I have a feeling I'm just confused about the API.

Joe
1 REPLY 1

steve1
Champ on-the-rise
Champ on-the-rise
Hi,

There are many answers already in this forum.

Simple search with "createDeployment" gives many answers.

Below is some of them:
http://forums.activiti.org/en/viewtopic.php?f=6&t=3588&hilit=createDeployment
http://forums.activiti.org/en/viewtopic.php?f=6&t=3171&hilit=createDeployment

Good luck!