How to debug the execution of Drools rules to verify the evaluation path used and the rules activated in KIE Server? - drools

How to debug the execution of Drools rules to verify the evaluation path used and the rules activated in the KIE Server?

Related

Are IIS Application Request Routing Cache Control rules scriptable?

I have some cache control rules setup on ARR extension for IIS, I want to automate their creation for a new installation. Is there a way to do so on powershell or cmd? (running on Windows Server 2016 and IIS 10)
Bonus point if the solution involve chef infra.
When the cache control rule is manually created in iis through the iis manager, you will find that there is a corresponding rule generated in the url rewrite module.
And in applicationHost file, you can see this
So if you want to use powershell to create cache control rule, just create a rule with similar content in url rewrite.
The specific powershell statements can be viewed through the iis manager (appcmd or other script statements are also possible), you can create an instance rule according to your needs, obtain the powershell statements, and then change the parameters to form a complete powershell. You can check how to generate it from here.

Unable to setup KIE workbench and KIE server 7.35 on Wildfly 14

I managed to deploy KIE workbench and server 6.4.0 on wildfly 8.2.1.
but
When trying to deploy version 7.35.0 on wildfly 14.0 it fails with the following error :
"WFLYDS0022: Did not receive a response to the deployment operation
within the allowed timeout period [600 seconds]. Check the server
configuration file and the server logs to find more about the status
of the deployment."
I am using standalone-full.xml while deployment.
Maybe this is happening due to some services are taking long time than usual to start and due to it server is not able to start within the default timeout.
You can change default timeout using below property and see if that works for you.
<system-propeties>
<property name="jboss.as.management.blocking.timeout" value="1000"/>
<system-propeties>
Also, you can try by disabling the deployment scanner.
/subsystem=deployment-scanner/scanner=default:write-attribute(name=scan-enabled,value=false)

Drools workbench: Create multiple kie-sessions using Kie Server Java Client API

I am using Drools workbench 7.17 integrated with Kie execution server. I have created a project within workbench and the project is deployed on kie execution server.
I have configured kie-base and kie-session in project's settings. Defined stateful kie-session as KieSession. I am using Kie Server Java Client API to insert facts into engine.
I am able to do lookup on KieSession. I am going to receive the data for different users and I want to create and maintain separate sessions for each user. When the fact is inserted for the existing user then I should be able to reload kie-session associated with that user.
Is there any way through which iI can achieve this using drools workbench and kie-execution server? I couldn't find any example in kie server documentation to create new session using kie server java client api.
Thanks in advance.
If this is the case, a new session is created each time you make a call. No stateful sessions are maintained in the kie-server.
You have 3 solutions :
1) develop a kie-server extension for that but it is difficult to cluster(you will have to serialize the kie session)
2) Use the java API of drools to run the rules on the client-side.
3) make your rules so that the data generated by the rule execution contains the status of your calculation so that calling back drools with initial data + all generated by rules is equivalent to keeping a stateful session for your client session. Drools is quick on inserting data. But now all depends on how much data your insert. A few thousand is nothing.
Regards

kie workbench unable to find kie execution server

I have kie workbench and kie execution server.
Execution server is runnig on
http://localhost:7080/kie-server/
and I can check its availability via request to services/rest/server/.
Also I have a workbench, running on
http://localhost:8080/kie-wb
and I can work with it via UI (direct REST calls cause unauthorized response).
I want to register new server with a container and set as endpoint my execution server on 7080 port.
However in workbench via scanner it's unable to find any endpoint - so it seems my execution server is unable to connect to workbench
I start it with these parameters
D:\installed\apache-tomcat-7.0.52-Copy\bin>set JAVA_OPTS= -Dorg.kie.server.persistence.dialect=oorg.hibernate.dialect.H2Dialect -Dorg.kie.server.persistence.ds=jdbc/jbpmB
-Dorg.kie.server.controller=http://localhost:8080/kie-wb/rest/controller -Dorg.kie.server.id=first-kie-server
Where I set workbench controller as localhost:8080/kie-wb.
What's the problem?
I am using 6.3 versions for both workbench and server.
The problem is solved.
The culprit was me. Accidentally I used snapshot of execution server artifact. And it wasn't trying to connect to controller.
When I used the proper artifact it started to work fine.

BPEL Designer for Eclipse: how to debug a BPEL process

I'm trying to debug a BPEL process. I made it using BPEL Designer for Eclipse (3.7.2), i'm using Ode 1.3 as engine.
I have no idea how to debug my process. I can deploy it on ode in a debug session but I don't really understand what can i do after that.
You can deploy BPEL processes developed in WS-BPEL 2.0 standard on WSO2 BPS server.
Once you deploy the BPEL process on WSO2 Business Process Server, you can use following mechanisms to debug/troubleshoot failures.
1.Using Message Tracer. This enables you to view the inbound and outbound messages to and from BPS server. To enable message trace logs for BPEL processes;
Add the following entries to the $CARBON-HOME/lib/log4j.properties
log4j.logger.org.apache.ode.bpel.messagetrace=TRACE log4j.logger.org.wso2.carbon.bpel.messagetrace=TRACE
The preferred log4j appender should be configured such that it has a threshold of TRACE level. If CARBON_LOGFILE is the log4j appender, it should be changed as follows. By default this is set to DEBUG.
eg - log4j.appender.CARBON_LOGFILE.threshold=TRACE
Re-start the server.
2.Using the Event table in the 'Instance Information' page (Figure 1). Each and every activity should have 3 events upon the successful execution. If an activity only has 2 events or if it has an "ActivityFailureEvent", then something must have gone wrong within that particular activity. You may need to refer the log file of WSO2 BPS server in-order to further investigate on the issue.
Unfortunately, the open source tools for BPEL debugging are very limited. Although ODE provides APIs to suspend and resume processes at break points, the current tools don't make use of it. I'd recommend to enable the DebugBpelEventListener, which outputs the execution events to the configured logger. This usually helps to understand what is going on.