0 Replies Latest reply on May 3, 2014 2:21 PM by Mateusz Adamiak

    BRMS 6 JBPM REST interface seems not working

    Mateusz Adamiak Newbie

      Hi,

       

      When I run the JBoss with BRMS on localhost, the business-central works just fine, I can deploy my projects, but when I try to connect with it by REST interface it does not work.

       

      Firstly, when I go to the http://localhost:8080/business-central/rest/runtime/... each request is with status 404.

       

      Secondly, when I try to connect with the use of RemoteRuntimeEngine, I've got following error:

      Exception in thread "main" java.lang.RuntimeException: Error invoking StartProcessCommand via REST (http://localhost:8080/business-central/rest/runtime/com.example.test:test_project:1.0/execute):

      <html><head><title>JBoss Web/7.2.2.Final-redhat-1 - JBWEB000064: Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>JBWEB000065: HTTP Status 404 - Could not find resource for relative : /runtime/com.example.test:test_project:1.0/execute of full path: http://localhost:8080/business-central/rest/runtime/com.example.test:test_project:1.0/execute</h1><HR size="1" noshade="noshade"><p><b>JBWEB000309: type</b> JBWEB000067: Status report</p><p><b>JBWEB000068: message</b> <u>Could not find resource for relative : /runtime/com.example.test:test_project:1.0/execute of full path: http://localhost:8080/business-central/rest/runtime/com.example.test:test_project:1.0/execute</u></p><p><b>JBWEB000069: description</b> <u>JBWEB000124: The requested resource is not available.</u></p><HR size="1" noshade="noshade"><h3>JBoss Web/7.2.2.Final-redhat-1</h3></body></html>

          at org.kie.services.client.api.command.AbstractRemoteCommandObject.executeRestCommand(AbstractRemoteCommandObject.java:342)

          at org.kie.services.client.api.command.AbstractRemoteCommandObject.execute(AbstractRemoteCommandObject.java:110)

          at org.drools.core.command.impl.CommandBasedStatefulKnowledgeSession.startProcess(CommandBasedStatefulKnowledgeSession.java:232)

          at org.drools.core.command.impl.CommandBasedStatefulKnowledgeSession.startProcess(CommandBasedStatefulKnowledgeSession.java:223)

          at pl.worc.pwr.student.vl.workflow.brms.Test.main(Test.java:30)

       

      It is using following java code:

      public class Test {

       

          public static void main(String[] args) throws MalformedURLException {

              String deploymentId = "com.example.test:test_project:1.0";

              URL baseUrl = new URL("http://localhost:8080/business-central");

              String user = "aswu";

              String password = "uwsa@123";

              RemoteRestRuntimeFactory restSessionFactory = new RemoteRestRuntimeFactory(

                      deploymentId, baseUrl, user, password);

              System.out.println("Is RemoteRestRuntimeFactory created : "

                      + (restSessionFactory != null));

       

              RemoteRuntimeEngine runtimeEngine = restSessionFactory

                      .newRuntimeEngine();

              KieSession kieSession = runtimeEngine.getKieSession();

              System.out.println("Is KieSession obtained : " + (kieSession != null));

       

              kieSession.startProcess("test-project.test-process");

          }

       

      }

       

      Is it possible, that my REST is not active (I am using 90-days trial version)? Or maybe I do something wrong I am not aware of? Please, help me

       

      EDIT: Thanks to swiderski.maciej now I know, that I installed BRMS, but it is authoring environment, not execution one, so I cannot run the process on it. I need BPMS, that contains execution environment.