Bonita and Bonita Rest in the same server

Hi

I want to deploy bonita.war and bonita-server-rest.war in the same server, and that they both share the same engine or / and API

I mean that all the operations done in the  bonita-server-rest.war be able in the bonita.war engine

 

What do i need to do this ?

 

Thank  you and regards

I've found an article and it was very useful for me.

 

Now I 've tested with a java REST client the exampple and it was succesful

The link is 

http://documentation.bonitasoft.com/5x/bos-57/system-administration/installation/configure-bos-rest/bos-rest-jboss

 

 

Optionally, if you want to use the REST API, specific descriptors and classpath configurations for those servers are included in the bonita-server-rest.war.

How To Configure BOS With REST On JBoss

Go to <BOS-5.7-DEPLOY> \bonita_execution_engine\interfaces\REST\with_engine\bonita-server-rest.war.

Copy this as a *.war file to <JBOSS_HOME>\server\default\deploy.

Server side configuration

Configure the REST user's login and password in the JAAS configuration to be used by the server to authenticate the client's request for access. This configuration must contain the loginContext BonitaRESTServer.

<application-policy name="BonitaRESTServer">
      <authentication>
      <login-module code="org.ow2.bonita.identity.auth.BonitaRESTServerLoginModule" flag="required">
        <module-option name="logins">restuser</module-option>
        <module-option name="passwords">restbpm</module-option>
        <module-option name="roles">restuser</module-option>
      </login-module>
      </authentication>
</application-policy>

Client side configuration

There are three types of client for the REST server:

  1. The Bonita User Experience in REST mode.  This requires only configuration.
  2. The Bonita API in REST mode (Java client). This requires configuration and acknowledgment on how to use the Bonita API. (See the series Build your applications with Bonita Runtime on www.bonitasoft.org.)
  3. A language other than Java (HTTP client): This requires acknowledgment on the Bonita REST API.

Bonita User Experience configuration

If your client is Bonita User Experience or any Java client, configure the loginContext BonitaStore in <JBOSS_HOME>\server\default\conf\login-config.xml, according to the REST users defined in the BonitaRESTLoginModule:

<application-policy name="BonitaStore">
    <authentication>
      <login-module code="org.ow2.bonita.identity.auth.BonitaRESTLoginModule" flag="required">
        <module-option name = "restUser">restuser</module-option>
        <module-option name = "restPassword">restbpm</module-option>          
      </login-module>
    </authentication>
  </application-policy>

The client will use this login and password to request authentication with the server.

You will also have to update your server variable BONITA_OPTS to use the REST API:

set "BONITA_OPTS=-DBONITA_HOME=<JBOSS_HOME>\bonita
-Dorg.ow2.bonita.rest-server-address =<your URL> (i.e. http://localhost:8080/bonita-server-rest/)
-Dorg.ow2.bonita.api-type=REST/"

Test the REST API server

Execute a simple call to the €œgetLightProcesses€ method (queryDefinitionAPI) using a rest client:

    Specify URL: http://localhost:8080/bonita-server-rest/API/queryDefinitionAPI/getLightProcesses
    Select €œPOST€ method 
    For body: 
        Set content type to: application/x-www-form-urlencoded 
        Insert a header
            Key: options
            Value: user:admin
    For authentication:
        Select BASIC authentication type
        Set username to: restuser
        Set password to: restbpm

Run the query. You should get an empty set of processes.