2017-04-21 19 views
0

アクティビティとラクダを使ってスプリングブートをセットアップしました。私は以下を行うために電子メールをポーリングするCamelルートを設定しようとしています。同じ上のいくつかの例は本当に参考になる:アクティビティを再開/開始するためのキャメルルート

  • 再開activtiタスク
  • スタートactivitiタスク

については、例えば私たちは、私はラクダのルートを設定するために、以下の使用を開始

{"action" : "complete", "variables": [ {"name":"id, "value":1}, {"name":"outcome", "value":true} ]} 

正常に動作します以下AcitvitiへのREST APIのようなものを渡す必要があり、ユーザーのタスクを再開し、それに渡される必要がある変数を追加する方法がわかりませんactivitiプロセスに:

ここ
@Component 
public class MyCamelMailRouter extends RouteBuilder { 
    @Override 
    public void configure() throws Exception { 
     from("imaps://[email protected]&password=xxxxxx&consumer.delay=60000" 
       + "&searchTerm.subject=Approving&searchTerm.unseen=true") 
       .to("activiti:activationProcess:approval"); 
    } 
} 

は私のMavenの依存関係は、上記

<properties> 
    <activiti.version>5.22.0</activiti.version> 
    <activiti.rest.version>5.17.0</activiti.rest.version> 
</properties> 

<dependencyManagement> 
    <dependencies> 
     <dependency> 
      <groupId>org.springframework.cloud</groupId> 
      <artifactId>spring-cloud-dependencies</artifactId> 
      <version>Camden.SR5</version> 
      <type>pom</type> 
      <scope>import</scope> 
     </dependency> 

     <dependency> 
      <groupId>org.apache.camel</groupId> 
      <artifactId>camel-spring-boot-dependencies</artifactId> 
      <version>2.18.3</version> 
      <type>pom</type> 
      <scope>import</scope> 
     </dependency> 
    </dependencies> 
</dependencyManagement> 

<dependencies> 
    <dependency> 
     <groupId>com.sony.spe.spt</groupId> 
     <artifactId>rpm-services-common</artifactId> 
     <version>0.0.1-SNAPSHOT</version> 
    </dependency> 

    <dependency> 
     <groupId>org.activiti</groupId> 
     <artifactId>activiti-spring-boot-starter-basic</artifactId> 
     <version>${activiti.version}</version> 
    </dependency> 

    <dependency> 
     <groupId>org.activiti</groupId> 
     <artifactId>spring-boot-starter-rest-api</artifactId> 
     <version>${activiti.rest.version}</version> 
    </dependency> 

    <dependency> 
     <groupId>org.activiti</groupId> 
     <artifactId>activiti-spring-boot-starter-actuator</artifactId> 
     <version>${activiti.version}</version> 
    </dependency> 

    <dependency> 
     <groupId>org.activiti</groupId> 
     <artifactId>activiti-spring-boot-starter-jpa</artifactId> 
     <version>${activiti.version}</version> 
    </dependency> 

    <dependency> 
     <groupId>com.oracle.ojdbc</groupId> 
     <artifactId>ojdbc6</artifactId> 
     <version>11.2.0.1.0</version> 
    </dependency> 

    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-web</artifactId> 
    </dependency> 

    <dependency> 
     <groupId>org.springframework.cloud</groupId> 
     <artifactId>spring-cloud-starter-eureka</artifactId> 
    </dependency> 

    <dependency> 
     <groupId>org.springframework.cloud</groupId> 
     <artifactId>spring-cloud-config-client</artifactId> 
    </dependency> 

    <!-- Camel - start --> 
    <dependency> 
     <groupId>org.apache.camel</groupId> 
     <artifactId>camel-spring-boot-starter</artifactId> 
    </dependency> 

    <dependency> 
     <groupId>org.apache.camel</groupId> 
     <artifactId>camel-mail-starter</artifactId> 
    </dependency> 

    <dependency> 
     <groupId>org.apache.camel</groupId> 
     <artifactId>camel-stream-starter</artifactId> 
    </dependency> 
    <!-- Camel - end --> 

    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-test</artifactId> 
     <scope>test</scope> 
    </dependency> 
</dependencies> 

あるいくつかの参照で行く、春のブート起動中に以下の例外がスローされます私が使用した表記法を使ってactivitiに指示することができたことが明らかになりましたが、エラーポイントとしてはデフォルトではありません。どんな助けでも大歓迎です。

org.apache.camel.spring.boot.CamelSpringBootInitializationException: org.apache.camel.FailedToCreateRouteException: Failed to create route route1 at: >>> To[activiti:activationProcess:approval] <<< in route: Route(route1)[[From[imaps://[email protected] because of Failed to resolve endpoint: activiti://activationProcess:approval due to: No component found with scheme: activiti 
    at org.apache.camel.spring.boot.RoutesCollector.onApplicationEvent(RoutesCollector.java:124) ~[camel-spring-boot-2.18.3.jar:2.18.3] 
    at org.apache.camel.spring.boot.RoutesCollector.onApplicationEvent(RoutesCollector.java:41) ~[camel-spring-boot-2.18.3.jar:2.18.3] 
    at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167) ~[spring-context-4.3.7.RELEASE.jar:4.3.7.RELEASE] 
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) ~[spring-context-4.3.7.RELEASE.jar:4.3.7.RELEASE] 
    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:383) ~[spring-context-4.3.7.RELEASE.jar:4.3.7.RELEASE] 
    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:337) ~[spring-context-4.3.7.RELEASE.jar:4.3.7.RELEASE] 
    at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:882) ~[spring-context-4.3.7.RELEASE.jar:4.3.7.RELEASE] 
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:144) ~[spring-boot-1.5.2.RELEASE.jar:1.5.2.RELEASE] 
    at org.springframework.context.support.AbstractApplicationContext.__refresh(AbstractApplicationContext.java:545) ~[spring-context-4.3.7.RELEASE.jar:4.3.7.RELEASE] 
    at org.springframework.context.support.AbstractApplicationContext.jrLockAndRefresh(AbstractApplicationContext.java) ~[spring-context-4.3.7.RELEASE.jar:4.3.7.RELEASE] 
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java) ~[spring-context-4.3.7.RELEASE.jar:4.3.7.RELEASE] 
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) ~[spring-boot-1.5.2.RELEASE.jar:1.5.2.RELEASE] 
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:737) [spring-boot-1.5.2.RELEASE.jar:1.5.2.RELEASE] 
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:370) [spring-boot-1.5.2.RELEASE.jar:1.5.2.RELEASE] 
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:314) [spring-boot-1.5.2.RELEASE.jar:1.5.2.RELEASE] 
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1162) [spring-boot-1.5.2.RELEASE.jar:1.5.2.RELEASE] 
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1151) [spring-boot-1.5.2.RELEASE.jar:1.5.2.RELEASE] 
    at com.workflow.WorkflowApplication.main(WorkflowApplication.java:15) [classes/:na] 
Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route route1 at: >>> To[activiti:activationProcess:approval] <<< in route: Route(route1)[[From[imaps://[email protected] because of Failed to resolve endpoint: activiti://activationProcess:approval due to: No component found with scheme: activiti 
    at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:1071) ~[camel-core-2.18.3.jar:2.18.3] 
    at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:196) ~[camel-core-2.18.3.jar:2.18.3] 
    at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:984) ~[camel-core-2.18.3.jar:2.18.3] 
    at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:3401) ~[camel-core-2.18.3.jar:2.18.3] 
    at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:3132) ~[camel-core-2.18.3.jar:2.18.3] 
    at org.apache.camel.impl.DefaultCamelContext.access$000(DefaultCamelContext.java:183) ~[camel-core-2.18.3.jar:2.18.3] 
    at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2961) ~[camel-core-2.18.3.jar:2.18.3] 
    at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2957) ~[camel-core-2.18.3.jar:2.18.3] 
    at org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:2980) ~[camel-core-2.18.3.jar:2.18.3] 
    at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:2957) ~[camel-core-2.18.3.jar:2.18.3] 
    at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61) ~[camel-core-2.18.3.jar:2.18.3] 
    at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:2924) ~[camel-core-2.18.3.jar:2.18.3] 
    at org.apache.camel.spring.boot.RoutesCollector.maybeStart(RoutesCollector.java:141) ~[camel-spring-boot-2.18.3.jar:2.18.3] 
    at org.apache.camel.spring.boot.RoutesCollector.onApplicationEvent(RoutesCollector.java:116) ~[camel-spring-boot-2.18.3.jar:2.18.3] 
    ... 17 common frames omitted 
Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: activiti://activationProcess:approval due to: No component found with scheme: activiti 
    at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:629) ~[camel-core-2.18.3.jar:2.18.3] 
    at org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:79) ~[camel-core-2.18.3.jar:2.18.3] 
    at org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:211) ~[camel-core-2.18.3.jar:2.18.3] 
    at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:108) ~[camel-core-2.18.3.jar:2.18.3] 
    at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:114) ~[camel-core-2.18.3.jar:2.18.3] 
    at org.apache.camel.model.SendDefinition.resolveEndpoint(SendDefinition.java:62) ~[camel-core-2.18.3.jar:2.18.3] 
    at org.apache.camel.model.SendDefinition.createProcessor(SendDefinition.java:56) ~[camel-core-2.18.3.jar:2.18.3] 
    at org.apache.camel.model.ProcessorDefinition.makeProcessorImpl(ProcessorDefinition.java:545) ~[camel-core-2.18.3.jar:2.18.3] 
    at org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:506) ~[camel-core-2.18.3.jar:2.18.3] 
    at org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:222) ~[camel-core-2.18.3.jar:2.18.3] 
    at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:1068) ~[camel-core-2.18.3.jar:2.18.3] 
    ... 30 common frames omitted 

答えて

0

activiti-camelコンポーネントのJAR/maven依存関係を追加する必要があります。それはApache CamelからではなくActivitiプロジェクトからのものなので、依存関係の名前を見てください。

最後のスタックトレースからコンポーネントが見つからないことがわかります。

+0

ありがとうございます!そのトリックをして、依存関係が失われていた、私はすでに私は彼らのラクダの依存関係を持っていたので、春のブートactivitiの依存関係が自動的にそれを含むだろうと思った。 しかし、変数を渡す方法についての指針はありますか? – Sayantan

+0

アクティティティのドキュメントを確認してください。私はこのコンポーネントを知らない。私はApache Camelプロジェクトでプライマリで働いています。 –

関連する問題