Activiti eclipse BPMN Designer 5.9を使用して簡単なHello worldアプリケーションを作成しようとしています。私はEclipseでactivitiプロジェクトを作って、check.bpmnダイアグラムをsrc/main/resourcesフォルダに、私の.javaをsrc/test/javaに、activiti.cfg.xmlファイルをsrc/test/resourcesフォルダに追加しました。アプリケーションはちょうどコンソールに警告 "Hello"を表示すると仮定していますが、私はこれを行うようには思えません。アプリケーションを実行するために使用しているすべてのファイルがある場合は、以下のようにします。私は何が足りないのかわかりません。私はActiviti Eclipse BPMN 2.0デザイナーをインストールしました。eclipse activitiのBPMNエラー
UPDATE:
エラー:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.activiti.examples</groupId>
<artifactId>activiti-examples</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>BPMN 2.0 with Activiti - Examples</name>
<properties>
<activiti-version>5.8</activiti-version>
</properties>
<dependencies>
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-engine</artifactId>
<version>${activiti-version}</version>
</dependency>
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-spring</artifactId>
<version>${activiti-version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy</artifactId>
<version>1.7.5</version>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.2.132</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.1</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>Activiti</id>
<url>http://maven.alfresco.com/nexus/content/repositories/activiti</url>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<inherited>true</inherited>
<configuration>
<classpathContainers>
<classpathContainer>org.eclipse.jdt.USER_LIBRARY/Activiti Designer Extensions</classpathContainer>
</classpathContainers>
</configuration>
</plugin>
</plugins>
</build>
</project>
Check.bpmn:
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
<process id="process1" name="process1">
<startEvent id="startevent1" name="Start"></startEvent>
<scriptTask id="scripttask1" name="Script Task" scriptFormat="javascript">
<script><![CDATA[alert("hello");]]></script>
</scriptTask>
<sequenceFlow id="flow1" name="" sourceRef="startevent1" targetRef="scripttask1"></sequenceFlow>
<endEvent id="endevent1" name="End"></endEvent>
<sequenceFlow id="flow2" name="" sourceRef="scripttask1" targetRef="endevent1"></sequenceFlow>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_process1">
<bpmndi:BPMNPlane bpmnElement="process1" id="BPMNPlane_process1">
<bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
<omgdc:Bounds height="35" width="35" x="200" y="160"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="scripttask1" id="BPMNShape_scripttask1">
<omgdc:Bounds height="55" width="105" x="280" y="150"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
<omgdc:Bounds height="35" width="35" x="440" y="160"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
<omgdi:waypoint x="235" y="177"></omgdi:waypoint>
<omgdi:waypoint x="280" y="177"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
<omgdi:waypoint x="385" y="177"></omgdi:waypoint>
<omgdi:waypoint x="440" y="177"></omgdi:waypoint>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
ProcessTestProcess1.java
package org.activiti.designer.test;
import static org.junit.Assert.*;
import java.util.HashMap;
import java.util.Map;
import java.io.FileInputStream;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.test.ActivitiRule;
import org.junit.Rule;
import org.junit.Test;
public class ProcessTestProcess1 {
private String filename = "C:\Users\User\workspace\Proj\src\main\resources\diagrams\Check.bpmn";
@Rule
public ActivitiRule activitiRule = new ActivitiRule();
@Test
public void startProcess() throws Exception {
RepositoryService repositoryService = activitiRule.getRepositoryService();
repositoryService.createDeployment().addInputStream("process1.bpmn20.xml",
new FileInputStream(filename)).deploy();
RuntimeService runtimeService = activitiRule.getRuntimeService();
Map<String, Object> variableMap = new HashMap<String, Object>();
variableMap.put("name", "Activiti");
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("process1", variableMap);
assertNotNull(processInstance.getId());
System.out.println("id " + processInstance.getId() + " "
+ processInstance.getProcessDefinitionId());
}
}
エラー:
Description Resource Path Location Type
The import org.activiti.engine cannot be resolved ProcessTestProcess1.java /Proj/src/test/java/org/activiti/designer/test line 9 Java Problem
The import org.activiti.engine cannot be resolved ProcessTestProcess1.java /Proj/src/test/java/org/activiti/designer/test line 10 Java Problem
The import org.activiti.engine cannot be resolved ProcessTestProcess1.java /Proj/src/test/java/org/activiti/designer/test line 11 Java Problem
The import org.activiti.engine cannot be resolved ProcessTestProcess1.java /Proj/src/test/java/org/activiti/designer/test line 12 Java Problem
The import org.activiti cannot be resolved Main.java /helloworld/src/main/java line 1 Java Problem
The import org.activiti cannot be resolved Main.java /helloworld/src/main/java line 2 Java Problem
The import org.activiti cannot be resolved Main.java /helloworld/src/main/java line 3 Java Problem
RuntimeService cannot be resolved to a type ProcessTestProcess1.java /Proj/src/test/java/org/activiti/designer/test line 28 Java Problem
RepositoryService cannot be resolved to a type ProcessTestProcess1.java /Proj/src/test/java/org/activiti/designer/test line 25 Java Problem
ProcessService cannot be resolved to a type Main.java /helloworld/src/main/java line 13 Java Problem
ProcessInstance cannot be resolved to a type ProcessTestProcess1.java /Proj/src/test/java/org/activiti/designer/test line 31 Java Problem
ProcessEngine cannot be resolved to a type Main.java /helloworld/src/main/java line 10 Java Problem
Invalid escape sequence (valid ones are \b \t \n \f \r \" \' \\) ProcessTestProcess1.java /Proj/src/test/java/org/activiti/designer/test line 18 Java Problem
DbProcessEngineBuilder cannot be resolved to a type Main.java /helloworld/src/main/java line 10 Java Problem
ActivitiRule cannot be resolved to a type ProcessTestProcess1.java /Proj/src/test/java/org/activiti/designer/test line 21 Java Problem
ActivitiRule cannot be resolved to a type ProcessTestProcess1.java /Proj/src/test/java/org/activiti/designer/test line 21 Java Problem
ActivitiRule cannot be resolved to a type ProcessTestProcess1.java /Proj/src/test/java/org/activiti/designer/test line 25 Java Problem
ActivitiRule cannot be resolved to a type ProcessTestProcess1.java /Proj/src/test/java/org/activiti/designer/test line 28 Java Problem
http://codecramp.com/activiti-setup-eclipse/応答のための – EMM