Gemini Keith Gemini Keith - 3 months ago 31
Java Question

How does KIE Server load or be loaded from the beginning?

just as what I mentioned in title.

I'm using KIE 6.5.4.Final. An official KIE Workbench distribution running in a

apache-tomcat-7.0.70
acts as my KIE Controller. And I'm running my KIE Server instance in docker container from image
jboss.com/jboss/kie-server-showcase
.

I'm new to KIE system and I found it's hard to catch the real clue about how KIE Server works (I need run jBPM project there).

I'll be appreciate if any suggestion, thank you very much.

Actually, I have started my KIE Workbench according to its README. However, I have no idea about how to create the data source for a KIE Server manually. At the end, I just specified following environments for KIE Server docker container and make the KIE Server to register to KIE Workbench.

KIE_SERVER_ID
KIE_WB_PORT_8080_TCP_ADDR
KIE_WB_PORT_8080_TCP
KIE_WB_ENV_KIE_CONTEXT_PATH
DOCKER_IP
DOCKER_PORT


In my solution, there are several KIE Servers registered to KIE Controller (A KIE Workbench for simplicity). These KIE Servers only run Rules and Processes without any extra business logical. However, I do not know any remote listener such as ProcessEventListener can work in remote KIE Client, which retrieved by
KieServicesClient#getServicesClient()
. Is there any mechanism to achieve this?

Finally, my idea is adding a new
ProcessEventListener
on KIE Server and it will post a new message every time a task will be triggered.

So, the real problem should be how KIE Server is being loaded from the beginning. Thanks for any suggestion.

Answer

This is not the best answer but a choice.

After I've asked the question on IRQ group, I found the class org.kie.server.services.Bootstrap. It's should be the entrance.

Actually, a KIE server act as an web application running in tomcat or jboss(or other supported container listed here: http://www.drools.org/download/download.html). Which means there should be one or more web listeners that will initialize the KIE server itself. In other words, all classes annotated with annotation @WebListener should be paid special attention.


But how does the container know these classes annotated need to be loaded? The key factor is the listener defined at WEB-INF/web.xml.

I thought this might be help.