spring-projects / spring-statemachine

Spring Statemachine is a framework for application developers to use state machine concepts with Spring.
1.52k stars 598 forks source link

how can i handler exception when send event #1097

Open carlos-ho opened 1 year ago

carlos-ho commented 1 year ago

hi: i have write a code like this

           Message message = MessageBuilder.withPayload(DangerTicketEvents.REVIEW_CREATE)
                    .setHeader("ticket", ticket)
                    .build();
            boolean result = this.sendEvent(message, ticket);
            if (!result){
                throw new BizBaseRuntimeException("新增隐患单失败");
            }

i hope i can get response or get exception from handler. but it can not. so how can i get result or exception when i sendEvent.

jiedada commented 1 year ago

I hope this helps you url:http://mp.weixin.qq.com/s?__biz=MzUzMTA2NTU2Ng==&mid=2247573043&idx=1&sn=e4935ab05754137145e08b036dcd6e74&chksm=fa4ba182cd3c289437813ef120abe6421c7235dde602586ddf9fac4920497b9ca51cdb655f41&scene=126&sessionid=1684719607#rd