Receive Event - Inbound : Custom Implementation

Dear Team,

I am getting null pointer exception for eventRegistry & InboundChannelModel in custom class created for triggering Inbound Channel/ Event.

Please confirm if I need to add any dependency or add some configuration to enable custom events as Java class implementation like we need to add for Kafka/RabbitMQ implementation. As far as I know its not required however please confirm.


logs:
2022-03-22 12:25:15.879 INFO 10364 — [io-29000-exec-2] c.a.a.w.service.InboundChannelService : jsonInputString —>>>>>>>>>>>>> {“eventName”:“receiveAECBConsent”,“variables”:[{“key”:“applicationReference”,“value”:“APP_11100002”},{“key”:“consentType”,“value”:“AECB”},{“key”:“isAccepted”,“value”:“true”},{“key”:“consentDate”,“value”:“21-03-2022”}]}
2022-03-22 12:25:15.880 INFO 10364 — [io-29000-exec-2] c.a.a.w.service.InboundChannelService : inbound Channel —>>>>>>>>>>>>> null
2022-03-22 12:25:15.880 INFO 10364 — [io-29000-exec-2] c.a.a.w.service.InboundChannelService : eventRegistry —>>>>>>>>>>>>> null
2022-03-22 12:25:15.904 ERROR 10364 — [io-29000-exec-2] o.a.c.c.C.[.[.[.[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [/work] threw exception [Request processing failed; nested exception is java.lang.NullPointerException] with root cause

java.lang.NullPointerException: null
at .InboundChannelService.handleInboundEvent(InboundChannelService.java:38) ~[classes/:na]
at .ReceiveEventController.handleReceiveEvent(ReceiveEventController.java:31) ~[classes/:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]

Below is body of REST API which is been converted as string in the adapter class to pass it to the BPMN channel/ event and same is been printed in the logs shared above:

{
“eventName”: “receiveAECBConsent”,
“variables”: [
{
“key”: “applicationReference”,
“value”: “APP_11100002”
},
{
“key”: “consentType”,
“value”: “AECB”
},
{
“key”: “isAccepted”,
“value”: “true”
},
{
“key”: “consentDate”,
“value”: “21-03-2022”
}
]
}

Please let me know if you need more information.

Also in application logs at boot up of application I see there is no event definition detected by the application.

======= flowable - license =======
2022-03-22 12:24:27.508 INFO 10364 — [ main] s.ServiceRegistryEngineAutoConfiguration : No deployment resources were found for autodeployment
2022-03-22 12:24:27.538 INFO 10364 — [ main] c.f.s.b.e.EventRegistryAutoConfiguration : No deployment resources were found for autodeployment

Can you share the full trace of the startup?

Hi Jorge,

PRB complete logs for application boot up:

Channel and Event which are part of application are not showing as linked models within app, so I need to add them manually and then deploy using control. However after deployment I don’t see Channel and Event definitions deployed.

Seems Event and Channel model definitions are not getting linked and deployed and that is why while executing REST end point to trigger event, getting null pointer exception as it doesnt exists.

Logs relevant to Event entries are mentioned below:

2022-03-22 12:24:31.357 INFO 10364 — [ main] c.f.app.engine.AppEngineConfiguration : Found 16 Engine Configurators in total:
2022-03-22 12:24:31.358 INFO 10364 — [ main] c.f.app.engine.AppEngineConfiguration : class org.flowable.engine.spring.configurator.SpringProcessEngineConfigurator (priority:50000)
2022-03-22 12:24:31.359 INFO 10364 — [ main] c.f.app.engine.AppEngineConfiguration : class org.flowable.eventregistry.spring.configurator.SpringEventRegistryConfigurator (priority:100000)
2022-03-22 12:24:31.359 INFO 10364 — [ main] c.f.app.engine.AppEngineConfiguration : class com.flowable.idm.engine.configurator.CoreIdmEngineConfigurator (priority:150000)
2022-03-22 12:24:31.359 INFO 10364 — [ main] c.f.app.engine.AppEngineConfiguration : class org.flowable.dmn.spring.configurator.SpringDmnEngineConfigurator (priority:200000)
2022-03-22 12:24:31.359 INFO 10364 — [ main] c.f.app.engine.AppEngineConfiguration : class com.flowable.form.spring.configurator.SpringFormEngineConfigurator (priority:300000)
2022-03-22 12:24:31.359 INFO 10364 — [ main] c.f.app.engine.AppEngineConfiguration : class com.flowable.content.spring.configurator.SpringContentEngineConfigurator (priority:400000)
2022-03-22 12:24:31.359 INFO 10364 — [ main] c.f.app.engine.AppEngineConfiguration : class org.flowable.cmmn.spring.configurator.SpringCmmnEngineConfigurator (priority:500000)
com.flowable.serviceregistry.engine.impl.deployer.ServiceRegistryEngineConfigurator (priority:900000)
2022-03-22 12:24:31.359 INFO 10364 — [ main] c.f.app.engine.AppEngineConfiguration : class com.flowable.platform.service.index.AppEngineIndexingConfigurator (priority:1000000)
2022-03-22 12:24:31.359 INFO 10364 — [ main] c.f.app.engine.AppEngineConfiguration : Executing beforeInit() of class org.flowable.engine.spring.configurator.SpringProcessEngineConfigurator (priority:50000)
2022-03-22 12:24:31.373 INFO 10364 — [ main] c.f.app.engine.AppEngineConfiguration : Executing beforeInit() of class org.flowable.eventregistry.spring.configurator.SpringEventRegistryConfigurator (priority:100000)
2022-03-22 12:24:31.381 INFO 10364 — [ main] c.f.app.engine.AppEngineConfiguration : Executing beforeInit() of class com.flowable.idm.engine.configurator.CoreIdmEngineConfigurator (priority:150000)
2022-03-22 12:24:33.263 INFO 10364 — [ main] o.f.s.SpringProcessEngineConfiguration : Executing configure() of class com.flowable.platform.engine.impl.indexing.configurator.ProcessEnginePlatformIndexingConfigurator (priority:10000)
2022-03-22 12:24:33.264 INFO 10364 — [ main] o.f.s.SpringProcessEngineConfiguration : Executing configure() of class com.flowable.inspect.rest.service.configurator.InspectBreakpointProcessEngineConfigurator (priority:10000)
2022-03-22 12:24:33.409 INFO 10364 — [ main] o.f.engine.impl.ProcessEngineImpl : ProcessEngine default created
2022-03-22 12:24:33.435 INFO 10364 — [ main] o.f.e.impl.cmd.ValidateV5EntitiesCmd : Total of v5 deployments found: 0
2022-03-22 12:24:33.439 INFO 10364 — [ main] c.f.app.engine.AppEngineConfiguration : Executing configure() of class org.flowable.eventregistry.spring.configurator.SpringEventRegistryConfigurator (priority:100000)
2022-03-22 12:24:33.680 INFO 10364 — [ main] liquibase.database : Set default schema name to public
2022-03-22 12:24:33.747 INFO 10364 — [ main] liquibase.lockservice : Successfully acquired change log lock
2022-03-22 12:24:34.233 INFO 10364 — [ main] liquibase.changelog : Reading from public.flw_ev_databasechangelog
2022-03-22 12:24:34.334 INFO 10364 — [ main] liquibase.lockservice : Successfully released change log lock
2022-03-22 12:24:34.336 INFO 10364 — [ main] o.f.e.impl.EventRegistryEngineImpl : EventRegistryEngine default created
2022-03-22 12:24:34.338 INFO 10364 — [ main] c.f.app.engine.AppEngineConfiguration : Executing configure() of class 2022-03-22 12:25:15.295 INFO 10364 — [io-29000-exec-2] o.a.c.c.C.[Tomcat].[localhost].[/work] : Initializing Spring DispatcherServlet ‘dispatcherServlet’
2022-03-22 12:25:15.296 INFO 10364 — [io-29000-exec-2] o.s.web.servlet.DispatcherServlet : Initializing Servlet ‘dispatcherServlet’
2022-03-22 12:25:15.313 INFO 10364 — [io-29000-exec-2] o.s.web.servlet.DispatcherServlet : Completed initialization in 17 ms
2022-03-22 12:25:15.878 INFO 10364 — [io-29000-exec-2] c.a.a.w.service.InboundChannelService : Json Value ----> {“eventName”:“receiveAECBConsent”,“variables”:[{“key”:“applicationReference”,“value”:“APP_11100002”},{“key”:“consentType”,“value”:“AECB”},{“key”:“isAccepted”,“value”:“true”},{“key”:“consentDate”,“value”:“21-03-2022”}]}
2022-03-22 12:25:15.879 INFO 10364 — [io-29000-exec-2] c.a.a.w.service.InboundChannelService : jsonInputString —>>>>>>>>>>>>> {“eventName”:“receiveAECBConsent”,“variables”:[{“key”:“applicationReference”,“value”:“APP_11100002”},{“key”:“consentType”,“value”:“AECB”},{“key”:“isAccepted”,“value”:“true”},{“key”:“consentDate”,“value”:“21-03-2022”}]}
2022-03-22 12:25:15.880 INFO 10364 — [io-29000-exec-2] c.a.a.w.service.InboundChannelService : inbound Channel —>>>>>>>>>>>>> null
2022-03-22 12:25:15.880 INFO 10364 — [io-29000-exec-2] c.a.a.w.service.InboundChannelService : eventRegistry —>>>>>>>>>>>>> null
2022-03-22 12:25:15.904 ERROR 10364 — [io-29000-exec-2] o.a.c.c.C.[.[.[.[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [/work] threw exception [Request processing failed; nested exception is java.lang.NullPointerException] with root cause

java.lang.NullPointerException: null
at com.alhilalbank.ahbflw.work.service.InboundChannelService.handleInboundEvent(InboundChannelService.java:38) ~[classes/:na]
at com.alhilalbank.ahbflw.work.controller.ReceiveEventController.handleReceiveEvent(ReceiveEventController.java:31) ~[classes/:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) ~[spring-web-5.3.13.jar:5.3.13]
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150) ~[spring-web-5.3.13.jar:5.3.13]
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117) ~[spring-webmvc-5.3.13.jar:5.3.13]

Hi Jose,

I am facing another issue with the deployment of app via Flowable Control.

This delegate expression I have used in channel model for Adapter Delegate expression and its been there in work micro-service.

Please suggest what I am missing here.

Flowable Control Logs:
Servlet.service() for servlet [dispatcherServlet] in context with path [/control] threw exception [Request processing failed; nested exception is com.flowable.control.logic.service.engine.exception.FlowableServiceException: Unknown property used in expression: ${InboundChannelService}] with root cause

com.flowable.control.logic.service.engine.exception.FlowableServiceException: Unknown property used in expression: ${InboundChannelService}
at com.flowable.control.logic.service.engine.FlowableClientService.executeRequest(FlowableClientService.java:109) ~[flowable-control-logic-3.11.1.jar!/:3.11.1]
at com.flowable.control.logic.service.engine.FlowableClientService.executeRequest(FlowableClientService.java:78) ~[flowable-control-logic-3.11.1.jar!/:3.11.1]
at com.flowable.control.rest.client.AbstractNewClientResource.uploadFile(AbstractNewClientResource.java:221) ~[flowable-control-rest-3.11.1.jar!/:3.11.1]
at com.flowable.control.rest.client.AppEngineClientResource.handleAppFileUpload(AppEngineClientResource.java:55) ~[flowable-control-rest-3.11.1.jar!/:3.11.1]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]

Hey @deepak-response,

Looking at your stacktraces it seems like you are using Flowable Enterprise. This forum is for Flowable Open Source and we try to keep things separate. I would suggest asking your questions about Flowable Enterprise in the Enterprise Forum.

In any case, looking at your error it sounds familiar to something that we fixed in the last few months. Please try with the latest Flowable versions.

Cheers,
Filip