0 Replies Latest reply on Nov 11, 2013 4:26 AM by ocramot

    How to extend JBPM v5.4 REST API?

    ocramot Newbie

      Hello,

       

      I'm trying to add some new calls to the Rest API functionalities provided by v5.4, normally listed at http://localhost:8080/gwt-console-server/rs/server/resources/jbpm

       

      I am basing on the source that can be found at https://github.com/bpmc/bpm-console/tree/master/server/war-base/src/main/java/org/jboss/bpm/console/server ; in particular I'm trying to replicate what is done in the FormProcessingFacade.java, ProcessMgmtFacade.java , TaskListFacade.java and TaskMgmtFacade.java .

      These files are present in the directory bpm-console-2.3.8.Final\server\war-base\src\main\java\org\jboss\bpm\console\server

      I added my classes in the bpm-console-2.3.8.Final\server\war-base\src\main\java\my\package\name . All the additional REST services are in the gwt-console-server/rs/extended/ etc. form; e.g. I added some methods to return me the task list with additional data about the process, and I expect to find it at the address http://localhost:8080/gwt-console-server/rs/extended/tasks/{idRef}

      I also found the file bpm-console-2.3.8.Final\server\war-base\src\main\webapp\WEB-INF\web.xml , which contains:

       

      <web-resource-collection>

            <web-resource-name>Resteasy</web-resource-name>     

            <url-pattern>/rs/process/*</url-pattern>

            <url-pattern>/rs/task/*</url-pattern>

            <url-pattern>/rs/form/*</url-pattern>

            <url-pattern>/rs/tasks/*</url-pattern>

            <url-pattern>/rs/identity/user/*</url-pattern>

            <url-pattern>/rs/identity/secure/*</url-pattern>

            <url-pattern>/rs/history/*</url-pattern>

       

          </web-resource-collection>

       

      and I added the lines:

       

            <url-pattern>/rs/extended/process/*</url-pattern>

            <url-pattern>/rs/extended/task/*</url-pattern>

            <url-pattern>/rs/extended/tasks/*</url-pattern>

            <url-pattern>/rs/extended/form/*</url-pattern>

       

      When I compile, I see that the classes are added in the bpm-console-2.3.8.Final\server\war-base\target\gwt-console-server-war-base.war , but not in the bpm-console-2.3.8.Final\server\wars\jbpm\target\gwt-console-server.war ; its web.xml file is not modified as well.

      If I try to deploy the gwt-console-server-war-base.war along the gwt-console-server.war , I can see the original services, but not my own. What else do I have to edit in order to see them?