I'm trying to setup the kie execution service (kie-server-services-6.2.0) for being provisioned by the kie-drools-wb-webapp-6.2.0, when I try to get access by following the webapp url of the execution server it shows a BASIC authentication, and don't know how to proceed for getting the access to the execution server, and also get the endpoint url, for provisioning the build-in rules examples of the kie-wb and get the REST or the WSDL working. The kie-wb has a username with role "admin" and I can build correctly the rules. Many thanks!!
Trying to answer you question I decided to create HOWTO from the very beginning what I did to get my Drool rules executed on remote server.
My task was to integrate Kie Workbench and Execution Server, so business users be able to create Drools rules and deploy them to the Repo, while developers could use these rules via calling REST services of standalone Drools execution server.
You should follow these steps:
Before using Drools Execution Server let me use such terminology:
Deployment of Drools Workbench
Most stable version of Kie Drools Workbench to deploy at the moment is 6.1.0.Final. Use this one for deploying on Tomcat 7.0 only!
You can download file called kie-drools-wb-distribution-wars from Jboss sonar repo, use version 6.1.0.Final and tomcat7.war
Make sure you added following jars to Tomcat's lib directory: javax.security.jacc-api-1.4.jar, kie-tomcat-integration.jar, slf4j-api-1.7.2.jar
Make sure you have or added following roles/users to tomcat-users.xml of your Tomcat:
<role rolename="admin"/> <!-- Tomcat Admin role -->
<role rolename="analyst"/> <!-- Kie Workbench Analyst role. -->
<role rolename="kie-server"/> <!-- Kie Drools Execution Server role. Needed to make REST Rules execution request -->
<user username="admin" password="admin" roles="manager-gui,manager-script" /> <!-- Tomcat Admin user -->
<user username="user1" password="user1" roles="admin, kie-server" /> <!-- Kie Drools Execution Server user. Needed to make REST Rules execution request -->
In Kie Workbench create a Model, Rules file. Validate them and click Deploy. Make sure you have jar file with your project being put to Maven repo!
As an example you can use rule and model I created for testing purposes: Drool rule file:
import com.arty.drlwb.MyExampleType;
rule "one"
when
MyExampleType(message == "Hello Worlddddd")
then
System.out.println("Hello World:)");
end
Deployment of Kie Drools Execution Server
For the moment of this To-Do writing the most stable version of Kie Drools Execution Server is kie-server-services-6.2.0.Beta3.war. You can download it here, Jboss sonar repo:
<response type="SUCCESS" msg="Kie Server info">
<kie-server-info>
<version>6.2.0.Beta3</version>
</kie-server-info>
</response>
<kie-container>
<container-id>{your_container_id}</container-id>
<status/>
<release-id>
<group-id>{your_project_group_id}</group-id>
<artifact-id>{your_project_artifact_id}</artifact-id>
<version>{your_project_version}</version>
</release-id>
<resolved-release-id/>
</kie-container>
<response type="SUCCESS" msg="List of created containers">
<kie-containers>
<kie-container container-id="{your_container_id}" status="STARTED">
<release-id>
<artifact-id>{your_project_artifact_id}</artifact-id>
<group-id>{your_project_group_id}</group-id>
<version>{your_project_version}</version>
</release-id>
<resolved-release-id>
<artifact-id>{your_project_artifact_id}</artifact-id>
<group-id>{your_project_group_id}</group-id>
<version>{your_project_version}</version>
</resolved-release-id>
</kie-container>
</kie-containers>
</response>
Use XML format. of cause use your own model instead of MyExampleType:
<batch-execution lookup="defaultKieSession">
<insert out-identifier="message" return-object="true" entry-point="DEFAULT">
<com.arty.drlwb.MyExampleType>
<message>Hello Worlddddd</message>
</com.arty.drlwb.MyExampleType>
</insert>
<fire-all-rules/>
</batch-execution>
P.S Due to luck of documentation about the topic I checked out Server's sources from GitHub. Take a look at kie-server-client and kie-server-integ-tests code and tests. Hope this helps.