apache / incubator-kie-kogito-examples

Kogito examples - Kogito is a cloud-native business automation technology for building cloud-ready business applications.
http://kogito.kie.org
254 stars 381 forks source link

Not able to use Start Timer in a process #1307

Open linkfi opened 2 years ago

linkfi commented 2 years ago

Describe the bug

I am using Start Timer in a process. The process is very simple. Start Timer -> Script Task ->End But getting below error: java.lang.UnsupportedOperationException: Scheduling for process jobs is not yet implemented at org.kie.kogito.jobs.management.quarkus.VertxJobsService.scheduleProcessJob(VertxJobsService.java:94) at org.kie.kogito.jobs.management.quarkus.VertxJobsService_Subclass.scheduleProcessJob$$superforward1(Unknown Source) at org.kie.kogito.jobs.management.quarkus.VertxJobsService_Subclass$$function$$4.apply(Unknown Source) at io.quarkus.arc.impl.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:54) at io.quarkus.arc.runtime.devconsole.InvocationInterceptor.proceed(InvocationInterceptor.java:62) at io.quarkus.arc.runtime.devconsole.InvocationInterceptor.monitor(InvocationInterceptor.java:49) at io.quarkus.arc.runtime.devconsole.InvocationInterceptor_Bean.intercept(Unknown Source) at io.quarkus.arc.impl.InterceptorInvocation.invoke(InterceptorInvocation.java:41) at io.quarkus.arc.impl.AroundInvokeInvocationContext.perform(AroundInvokeInvocationContext.java:41) at io.quarkus.arc.impl.InvocationContexts.performAroundInvoke(InvocationContexts.java:32) at org.kie.kogito.jobs.management.quarkus.VertxJobsService_Subclass.scheduleProcessJob(Unknown Source) at org.kie.kogito.jobs.management.quarkus.VertxJobsService_ClientProxy.scheduleProcessJob(Unknown Source) at org.kie.kogito.process.impl.AbstractProcess.activate(AbstractProcess.java:174) at com.example.DemoStartTimerProcess_Subclass.activate$$superforward1(Unknown Source) at com.example.DemoStartTimerProcess_Subclass.activate(Unknown Source) at com.example.DemoStartTimerProcess.<init>(DemoStartTimerProcess.java:16) at com.example.DemoStartTimerProcess_Subclass.<init>(Unknown Source) at com.example.DemoStartTimerProcess_Bean.create(Unknown Source) at com.example.DemoStartTimerProcess_Bean.create(Unknown Source) at io.quarkus.arc.impl.AbstractSharedContext.createInstanceHandle(AbstractSharedContext.java:111) at io.quarkus.arc.impl.AbstractSharedContext$1.get(AbstractSharedContext.java:35) at io.quarkus.arc.impl.AbstractSharedContext$1.get(AbstractSharedContext.java:32) at io.quarkus.arc.impl.LazyValue.get(LazyValue.java:26) at io.quarkus.arc.impl.ComputingCache.computeIfAbsent(ComputingCache.java:69) at io.quarkus.arc.impl.AbstractSharedContext.get(AbstractSharedContext.java:32) at io.quarkus.arc.impl.ClientProxies.getApplicationScopedDelegate(ClientProxies.java:18) at com.example.DemoStartTimerProcess_ClientProxy.arc$delegate(Unknown Source) at com.example.DemoStartTimerProcess_ClientProxy.arc_contextualInstance(Unknown Source) at com.example.DemoStartTimerProcess_Observer_Synthetic_d70cd75bf32ab6598217b9a64a8473d65e248c05.notify(Unknown Source) at io.quarkus.arc.impl.EventImpl$Notifier.notifyObservers(EventImpl.java:323) at io.quarkus.arc.impl.EventImpl$Notifier.notify(EventImpl.java:305) at io.quarkus.arc.impl.EventImpl.fire(EventImpl.java:73) at io.quarkus.arc.runtime.ArcRecorder.fireLifecycleEvent(ArcRecorder.java:130) at io.quarkus.arc.runtime.ArcRecorder.handleLifecycleEvents(ArcRecorder.java:99) at io.quarkus.deployment.steps.LifecycleEventsBuildStep$startupEvent1144526294.deploy_0(Unknown Source) at io.quarkus.deployment.steps.LifecycleEventsBuildStep$startupEvent1144526294.deploy(Unknown Source) at io.quarkus.runner.ApplicationImpl.doStart(Unknown Source) at io.quarkus.runtime.Application.start(Application.java:101) at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:103) at io.quarkus.runtime.Quarkus.run(Quarkus.java:67) at io.quarkus.runtime.Quarkus.run(Quarkus.java:41) at io.quarkus.runtime.Quarkus.run(Quarkus.java:120) at io.quarkus.runner.GeneratedMain.main(Unknown Source) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at io.quarkus.runner.bootstrap.StartupActionImpl$1.run(StartupActionImpl.java:103) at java.base/java.lang.Thread.run(Thread.java:829) Resulted in: java.lang.RuntimeException: Failed to start quarkus ... 13 more Resulted in: io.quarkus.dev.appstate.ApplicationStartException: java.lang.RuntimeException: Failed to start quarkus at io.quarkus.dev.appstate.ApplicationStateNotification.waitForApplicationStart(ApplicationStateNotification.java:58) at io.quarkus.runner.bootstrap.StartupActionImpl.runMainClass(StartupActionImpl.java:122) at io.quarkus.deployment.dev.IsolatedDevModeMain.restartApp(IsolatedDevModeMain.java:253) at io.quarkus.deployment.dev.IsolatedDevModeMain.restartCallback(IsolatedDevModeMain.java:234) at io.quarkus.deployment.dev.RuntimeUpdatesProcessor.doScan(RuntimeUpdatesProcessor.java:536) at io.quarkus.deployment.dev.RuntimeUpdatesProcessor.doScan(RuntimeUpdatesProcessor.java:436) at io.quarkus.vertx.http.runtime.devmode.VertxHttpHotReplacementSetup$4.handle(VertxHttpHotReplacementSetup.java:152) at io.quarkus.vertx.http.runtime.devmode.VertxHttpHotReplacementSetup$4.handle(VertxHttpHotReplacementSetup.java:139) at io.vertx.core.impl.ContextImpl.lambda$null$0(ContextImpl.java:159) at io.vertx.core.impl.AbstractContext.dispatch(AbstractContext.java:100) at io.vertx.core.impl.ContextImpl.lambda$executeBlocking$1(ContextImpl.java:157) at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18) at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449) at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478) at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:29) at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:29) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ... 1 more

Scheduling service is running and intermediate timer is working fine. Use case I am trying to achieve is: after starting, the process should get scheduled as per the set time in the timer. Can a Kogito workflow be scheduled without calling the API and just using Start Timer?

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Kogito version or git rev (or at least Quarkus version if you are using Kogito via Quarkus platform BOM)

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

ricardozanini commented 2 years ago

Hi! I think this feature hasn't been implemented yet. See the message in your stack trace: Scheduling for process jobs is not yet implemented.

cc @tiagodolphine @wmedvede

adailsonm commented 1 year ago

this is already implemented in current versions. I think this issue no longer makes sense.

ricardozanini commented 1 year ago

@tiagodolphine @wmedvede can u please confirm? If so we can close this issue.

tiagodolphine commented 1 year ago

Yeah, scheduling a process using a start-timer event is not fully implemented, mainly if you use job-service. If no error message is thrown maybe we should add validation for it once building the app.