How to make a rest call in kie workbench - rest

I am a newbie to kie workbench, I am using drools 6.3.0 and want to write a code in kie workbench for making a rest call.
With extensions tab, I made a angular page and now I want to make a rest call.
But i am not getting how to use Rest Api in kie workbench.
Can anyone please help me in this.

Simplest way : User default REST task.
Programmatic way : You need to create Java Handler. Use Apache HttpClient to implement programmatic REST call in "executeWorkItem" of your "WorkItemHandler", upload the jar in KIE Workbench. Then configure your "Task" to use this handler.

Related

KIE Drool Workbench: Unable to get to workbench UI due to "Forbidden" screen

I have been trying follow the links and details available to set up a KIE Drools workbench for Drools like https://www.intertech.com/simple-setup-of-drools-kie-workbench-and-kie-server-in-one-wildfly-instance/.
From what I could analyze and read up KIE Drools Workbench will let me configure a rule engine through a front end and that Guvnor used to handle this aspect prior to workbench. These configured rules can be blended into my Spring Boot application to drive my loan application requirement. I hope that this understanding of usage of KIE Drools workbench is correct. Please confirm.
Below are the things I tried.
Set up KIE Workbench in Wildfly
Set up KIE Server in Wildfly
Getting them deployed I had to go through many issues which I was able to resolve like updating the jboss-deployment-structure.xml and executing using standalone-full.xml.
This is the UI I see now.
But for the workbench I am only seeing FORBIDDEN on screen.
Can you please suggest what can be done so that I can have the UI to create my custom rules.
Just thought of updating that I was able to resolve the issue I faced. The only thing to be done is to follow the link I shared word by word :) . The users were created as stated and the exact version of war files were used and I am now able to access the workbench. Now on I will be exploring the usage.

Calling spring boot rest service from GWT

I want the gwt app to call a spring boot rest service with basic authentication which consumes and produces a json object and is deployed on a seperate server from the gwt app.
Any hints on how this can be done ?
There is a library called restygwt to easily define REST calls. I think there is an easy way to set the 'Basic' header.

Can I test rule using Drools (KIE) Workbench?

I am new to Drools so my question could be obvious but I cannot find an answer.
I defined Data Model and Rule, built and deployed to my Drools server. Is any way to test it using Drools Workbench or I need to implement java client application or manually simulated call from web client like Postmen or SoapUI to Drools server? Thank you!
I figured out that I cannot test my rule from Drools Workbench and need to use either web client or application.

Runtime Strategy on drools kie server is always showing singleton

I am am deploying my kjar onto kie server container using kie workbench. The kie deployment descriptor has "runtime-strategy" set to "PER_REQUEST". However, when kie server container is finally created, it is showing "runtime-strategy" as "SINGLETON" always. The behavior is also reflecting "SINGLETON".
Please let me know of a solution to this.
I see the same behavior with kie-drools-wb-6.5.0.Final-tomcat7.war. For some reason the "Save" button is disabled(attached screenshot)Execution Server Page : Drools Workbench
I am logged in as admin just to make sure its not an authorization issue. Thoughts on what could be the issue?
From the drools google group: This is a UI only issue. Can be confirmed by making a REST call to the Kie Server.
More details : https://issues.jboss.org/browse/RHBPMS-4373

.NET application remotely invoke drools workbench 6.1 to execute rule

Is it possible that the drools workbench provide REST/SOAP API for .NET/python applications to execute rules.
thanks,
Kalin
There is a REST API, but it would be of no use to you. The rules don't get executed in Workbench. It's really just a repository for them. The REST API would let you download the rules, but you wouldn't be able to execute them in a .NET application.
Instead you would need to run up a rules service of your own. You could create a minimal Java web application, with REST/SOAP operations.
However, there is also the Drools Camel Server, which can be configured to load rules from your Workbench and expose them through a REST API. See the docs here:
http://docs.jboss.org/drools/release/6.0.1.Final/drools-docs/html_single/#ch.server