title: jbpm 6 remote rest api integration with spring boot
body: <p>I am trying to create a jbpm+angular+springboot application .</p>
  
  <p>The idea of api documentation is here :</p>
  
  <p><a href="https://developer.jboss.org/people/bpmn2user/blog/2014/01/11/jbpm6--angular-js-web-example" rel="nofollow">https://developer.jboss.org/people/bpmn2user/blog/2014/01/11/jbpm6--angular-js-web-example</a></p>
  
  <p>The remote integration documentation:</p>
  
  <p><a href="http://docs.jboss.org/jbpm/v6.0/userguide/jBPMRemoteAPI.html" rel="nofollow">http://docs.jboss.org/jbpm/v6.0/userguide/jBPMRemoteAPI.html</a></p>
  
  <p>My spring boot controller:</p>
  
  <pre><code> package org.jbpm.spring.boot;
  
  import java.net.URL;
  
  import org.jbpm.services.api.model.UserTaskInstanceDesc;
  import org.kie.api.runtime.KieSession;
  import org.kie.api.runtime.manager.RuntimeEngine;
  import org.kie.api.runtime.process.ProcessInstance;
  import org.springframework.stereotype.Controller;
  import org.springframework.web.bind.annotation.RequestMapping;
  import org.springframework.web.bind.annotation.RequestMethod;
  import org.springframework.web.bind.annotation.RequestParam;
  
  @Controller
  @RequestMapping("/task")
  public class RestController {
  
  
      @RequestMapping(value = "/show", method = RequestMethod.GET)
      public UserTaskInstanceDesc getTask(@RequestParam String id) {
          String deploymentId="id";
          URL deploymentUrl=new URL("http://localhost:8080/jbpm-console/");
          String user="user";
          String password="password";
  
  
           RemoteRestSessionFactory restSessionFactory 
  
              = new RemoteRestSessionFactory(deploymentId, deploymentUrl, user, password);
  
            RuntimeEngine engine = restSessionFactory.newRuntimeEngine();
  
            KieSession ksession = engine.getKieSession();
  
            ProcessInstance processInstance = ksession.startProcess("org.jbpm.humantask");
  
  
      }
  
  }
  </code></pre>
  
  <p>for some reason  "RemoteRestSessionFactory" cant be resolved as type my pom looks like this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;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/xsd/maven-4.0.0.xsd"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
    &lt;groupId&gt;org.jbpm.spring&lt;/groupId&gt;
    &lt;artifactId&gt;spring-boot-jbpm&lt;/artifactId&gt;
    &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
    &lt;packaging&gt;jar&lt;/packaging&gt;
  
    &lt;name&gt;spring-boot-jbpm&lt;/name&gt;
    &lt;description&gt;jBPM with spring boot&lt;/description&gt;
  
    &lt;parent&gt;
      &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
      &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
      &lt;version&gt;1.1.9.RELEASE&lt;/version&gt;
      &lt;relativePath /&gt; &lt;!-- lookup parent from repository --&gt;
    &lt;/parent&gt;
  
  
    &lt;properties&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
      &lt;start-class&gt;org.jbpm.spring.boot.Application&lt;/start-class&gt;
      &lt;java.version&gt;1.7&lt;/java.version&gt;
      &lt;drools.version&gt;6.2.0.Final&lt;/drools.version&gt;
      &lt;jbpm.version&gt;6.2.0.Final&lt;/jbpm.version&gt;
      &lt;app.version&gt;0.0.1-SNAPSHOT&lt;/app.version&gt;
  
      &lt;hibernate.version&gt;4.2.0.Final&lt;/hibernate.version&gt;
      &lt;hibernate.core.version&gt;4.2.0.Final&lt;/hibernate.core.version&gt;
      &lt;slf4j.version&gt;1.6.4&lt;/slf4j.version&gt;
      &lt;jboss.javaee.version&gt;1.0.0.Final&lt;/jboss.javaee.version&gt;
      &lt;logback.version&gt;1.0.9&lt;/logback.version&gt;
      &lt;h2.version&gt;1.3.161&lt;/h2.version&gt;
      &lt;btm.version&gt;2.1.4&lt;/btm.version&gt;
    &lt;/properties&gt;
  
  
    &lt;dependencies&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
        &lt;artifactId&gt;spring-boot-starter-security&lt;/artifactId&gt;
        &lt;exclusions&gt;
          &lt;exclusion&gt;
            &lt;artifactId&gt;jul-to-slf4j&lt;/artifactId&gt;
            &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
          &lt;/exclusion&gt;
        &lt;/exclusions&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
        &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
        &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
        &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.kie&lt;/groupId&gt;
        &lt;artifactId&gt;kie-api&lt;/artifactId&gt;
        &lt;version&gt;${jbpm.version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.kie&lt;/groupId&gt;
        &lt;artifactId&gt;kie-internal&lt;/artifactId&gt;
        &lt;version&gt;${jbpm.version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.drools&lt;/groupId&gt;
        &lt;artifactId&gt;drools-core&lt;/artifactId&gt;
        &lt;version&gt;${jbpm.version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.drools&lt;/groupId&gt;
        &lt;artifactId&gt;drools-compiler&lt;/artifactId&gt;
        &lt;version&gt;${jbpm.version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.drools&lt;/groupId&gt;
        &lt;artifactId&gt;drools-persistence-jpa&lt;/artifactId&gt;
        &lt;version&gt;${jbpm.version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.jbpm&lt;/groupId&gt;
        &lt;artifactId&gt;jbpm-flow&lt;/artifactId&gt;
        &lt;version&gt;${jbpm.version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.jbpm&lt;/groupId&gt;
        &lt;artifactId&gt;jbpm-flow-builder&lt;/artifactId&gt;
        &lt;version&gt;${jbpm.version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.jbpm&lt;/groupId&gt;
        &lt;artifactId&gt;jbpm-bpmn2&lt;/artifactId&gt;
        &lt;version&gt;${jbpm.version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.jbpm&lt;/groupId&gt;
        &lt;artifactId&gt;jbpm-audit&lt;/artifactId&gt;
        &lt;version&gt;${jbpm.version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.jbpm&lt;/groupId&gt;
        &lt;artifactId&gt;jbpm-persistence-jpa&lt;/artifactId&gt;
        &lt;version&gt;${jbpm.version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.jbpm&lt;/groupId&gt;
        &lt;artifactId&gt;jbpm-human-task-core&lt;/artifactId&gt;
        &lt;version&gt;${jbpm.version}&lt;/version&gt;
        &lt;exclusions&gt;
          &lt;exclusion&gt;
            &lt;artifactId&gt;jboss-annotations-api_1.1_spec&lt;/artifactId&gt;
            &lt;groupId&gt;org.jboss.spec.javax.annotation&lt;/groupId&gt;
          &lt;/exclusion&gt;
        &lt;/exclusions&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.jbpm&lt;/groupId&gt;
        &lt;artifactId&gt;jbpm-human-task-jpa&lt;/artifactId&gt;
        &lt;version&gt;${jbpm.version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.jbpm&lt;/groupId&gt;
        &lt;artifactId&gt;jbpm-human-task-workitems&lt;/artifactId&gt;
        &lt;version&gt;${jbpm.version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.jbpm&lt;/groupId&gt;
        &lt;artifactId&gt;jbpm-human-task-audit&lt;/artifactId&gt;
        &lt;version&gt;${jbpm.version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.jbpm&lt;/groupId&gt;
        &lt;artifactId&gt;jbpm-runtime-manager&lt;/artifactId&gt;
        &lt;version&gt;${jbpm.version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.jbpm&lt;/groupId&gt;
        &lt;artifactId&gt;jbpm-services-api&lt;/artifactId&gt;
        &lt;version&gt;${jbpm.version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.jbpm&lt;/groupId&gt;
        &lt;artifactId&gt;jbpm-kie-services&lt;/artifactId&gt;
        &lt;version&gt;${jbpm.version}&lt;/version&gt;
        &lt;exclusions&gt;
          &lt;exclusion&gt;
            &lt;artifactId&gt;freemarker&lt;/artifactId&gt;
            &lt;groupId&gt;org.freemarker&lt;/groupId&gt;
          &lt;/exclusion&gt;
          &lt;exclusion&gt;
            &lt;artifactId&gt;javassist&lt;/artifactId&gt;
            &lt;groupId&gt;javassist&lt;/groupId&gt;
          &lt;/exclusion&gt;
        &lt;/exclusions&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.jbpm&lt;/groupId&gt;
        &lt;artifactId&gt;jbpm-workitems&lt;/artifactId&gt;
        &lt;version&gt;${jbpm.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
        &lt;groupId&gt;org.kie&lt;/groupId&gt;
        &lt;artifactId&gt;kie-spring&lt;/artifactId&gt;
        &lt;version&gt;${jbpm.version}&lt;/version&gt;
        &lt;exclusions&gt;
          &lt;exclusion&gt;
            &lt;artifactId&gt;drools-decisiontables&lt;/artifactId&gt;
            &lt;groupId&gt;org.drools&lt;/groupId&gt;
          &lt;/exclusion&gt;
          &lt;exclusion&gt;
            &lt;artifactId&gt;drools-templates&lt;/artifactId&gt;
            &lt;groupId&gt;org.drools&lt;/groupId&gt;
          &lt;/exclusion&gt;
        &lt;/exclusions&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
        &lt;groupId&gt;org.springframework&lt;/groupId&gt;
        &lt;artifactId&gt;spring-orm&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.springframework&lt;/groupId&gt;
        &lt;artifactId&gt;spring-jdbc&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.springframework&lt;/groupId&gt;
        &lt;artifactId&gt;spring-context&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.springframework&lt;/groupId&gt;
        &lt;artifactId&gt;spring-web&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.springframework&lt;/groupId&gt;
        &lt;artifactId&gt;spring-tx&lt;/artifactId&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
        &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
        &lt;artifactId&gt;hibernate-entitymanager&lt;/artifactId&gt;
        &lt;version&gt;${hibernate.version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
        &lt;artifactId&gt;hibernate-core&lt;/artifactId&gt;
        &lt;version&gt;${hibernate.version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;com.h2database&lt;/groupId&gt;
        &lt;artifactId&gt;h2&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.codehaus.btm&lt;/groupId&gt;
        &lt;artifactId&gt;btm&lt;/artifactId&gt;
        &lt;version&gt;${btm.version}&lt;/version&gt;
        &lt;exclusions&gt;
          &lt;exclusion&gt;
            &lt;artifactId&gt;jta&lt;/artifactId&gt;
            &lt;groupId&gt;javax.transaction&lt;/groupId&gt;
          &lt;/exclusion&gt;
        &lt;/exclusions&gt;
      &lt;/dependency&gt;
  
      &lt;!-- test dependencies --&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;ch.qos.logback&lt;/groupId&gt;
        &lt;artifactId&gt;logback-classic&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;junit&lt;/groupId&gt;
        &lt;artifactId&gt;junit&lt;/artifactId&gt;
        &lt;exclusions&gt;
          &lt;exclusion&gt;
            &lt;artifactId&gt;hamcrest-core&lt;/artifactId&gt;
            &lt;groupId&gt;org.hamcrest&lt;/groupId&gt;
          &lt;/exclusion&gt;
        &lt;/exclusions&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
        &lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;
        &lt;version&gt;1.7.5&lt;/version&gt;
          &lt;/dependency&gt;
              &lt;dependency&gt;
      &lt;groupId&gt;org.kie&lt;/groupId&gt;
      &lt;artifactId&gt;kie-server-client&lt;/artifactId&gt;
      &lt;version&gt;6.2.0.Final&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.kie.workbench.services&lt;/groupId&gt;
      &lt;artifactId&gt;kie-wb-common-services-api&lt;/artifactId&gt;
      &lt;version&gt;6.2.0.Final&lt;/version&gt;
  &lt;/dependency&gt;
        &lt;/dependencies&gt;
  
  
    &lt;build&gt;
      &lt;plugins&gt;
        &lt;plugin&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
        &lt;/plugin&gt;
      &lt;/plugins&gt;
    &lt;/build&gt;
  
  &lt;/project&gt;
  </code></pre>
  
  <p>How can i resolve this?</p>