Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

fix: check workflow exists when executing #335

Merged
merged 2 commits into from
May 21, 2023

Commits on May 21, 2023

  1. fix: check workflow exists when executing

    User may introduce a typo and the output is not great:
    
    ```
    2023-05-11 10:23:13.200 ERROR 52759 --- [         task-6] .a.i.SimpleAsyncUncaughtExceptionHandler : Unexpected exception occurred invoking async method: public void com.redhat.parodos.workflow.execution.service.WorkFlowExecutorImpl.executeAsync(java.util.UUID,java.lang.String,com.redhat.parodos.workflows.work.WorkContext,java.util.UUID)
    
    java.lang.NullPointerException: Cannot invoke "com.redhat.parodos.workflow.definition.entity.WorkFlowDefinition.getName()" because "workflow" is null
            at com.redhat.parodos.workflow.execution.aspect.WorkFlowExecutionFactory.isMainWorkFlow(WorkFlowExecutionFactory.java:55) ~[classes!/:na]
            at com.redhat.parodos.workflow.execution.aspect.WorkFlowExecutionFactory.createExecutionHandler(WorkFlowExecutionFactory.java:38) ~[classes!/:na]
            at com.redhat.parodos.workflow.execution.aspect.WorkFlowExecutionAspect.executeAroundAdvice(WorkFlowExecutionAspect.java:86) ~[classes!/:na]
            at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
            at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[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:568) ~[na:na]
            at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:634) ~[spring-aop-5.3.20.jar!/:5.3.20]
            at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:624) ~[spring-aop-5.3.20.jar!/:5.3.20]
            at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:72) ~[spring-aop-5.3.20.jar!/:5.3.20]
            at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175) ~[spring-aop-5.3.20.jar!/:5.3.20]
            at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) ~[spring-aop-5.3.20.jar!/:5.3.20]
            at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97) ~[spring-aop-5.3.20.jar!/:5.3.20]
            at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.20.jar!/:5.3.20]
            at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) ~[spring-aop-5.3.20.jar!/:5.3.20]
            at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:708) ~[spring-aop-5.3.20.jar!/:5.3.20]
            at com.redhat.parodos.workflows.workflow.ParallelFlow$$EnhancerBySpringCGLIB$$7530a326.execute(<generated>) ~[workflow-engine-1.0.11-SNAPSHOT.jar!/:na]
            at com.redhat.parodos.workflows.engine.WorkFlowEngineImpl.run(WorkFlowEngineImpl.java:38) ~[workflow-engine-1.0.11-SNAPSHOT.jar!/:na]
            at com.redhat.parodos.workflow.execution.service.WorkFlowExecutorImpl.execute(WorkFlowExecutorImpl.java:35) ~[classes!/:na]
            at com.redhat.parodos.workflow.execution.service.WorkFlowExecutorImpl.executeAsync(WorkFlowExecutorImpl.java:27) ~[classes!/:na]
            at com.redhat.parodos.workflow.execution.service.WorkFlowExecutorImpl$$FastClassBySpringCGLIB$$510b4225.invoke(<generated>) ~[classes!/:na]
            at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[workflow-examples-1.0.11-SNAPSHOT-jar-with-dependencies.jar:5.3.20]
            at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:793) ~[spring-aop-5.3.20.jar!/:5.3.20]
            at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.3.20.jar!/:5.3.20]
            at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) ~[spring-aop-5.3.20.jar!/:5.3.20]
            at org.springframework.aop.interceptor.AsyncExecutionInterceptor.lambda$invoke$0(AsyncExecutionInterceptor.java:115) ~[spring-aop-5.3.20.jar!/:5.3.20]
            at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[na:na]
            at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[na:na]
            at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[na:na]
            at java.base/java.lang.Thread.run(Thread.java:833) ~[na:na]
    ```
    
    Signed-off-by: Eloy Coto <eloy.coto@acalustra.com>
    eloycoto committed May 21, 2023
    Configuration menu
    Copy the full SHA
    1d67f80 View commit details
    Browse the repository at this point in the history
  2. feat: add WorkFlowDefinitionNotFoundException class

    Signed-off-by: Eloy Coto <eloy.coto@acalustra.com>
    eloycoto committed May 21, 2023
    Configuration menu
    Copy the full SHA
    00171e8 View commit details
    Browse the repository at this point in the history