赞
踩
如果感觉Kstry框架有可取之处,还请简单支持一个star,您的支持是项目前进最大的动力!
详见:RBAC模式
流程回溯可以在链路执行完之后,拿到结果或者异常之前,打印节点执行日志或执行自定义回调方法,可以应对如下问题:
下面步骤仅为简单介绍,具体细节请参考使用文档
<dependency>
<groupId>cn.kstry.framework</groupId>
<artifactId>kstry-core</artifactId>
<version>最新版本</version>
</dependency>
@EnableKstry(bpmnPath = "./bpmn/*.bpmn")
@SpringBootApplication
public class KstryDemoApplication {
public static void main(String[] args) {
SpringApplication.run(KstryDemoApplication.class, args);
}
}
@TaskComponent(name = "goods")
public class GoodsService {
@NoticeResult
@TaskService(name = "init-base-info")
public GoodsDetail initBaseInfo(@ReqTaskParam(reqSelf = true) GoodsDetailRequest request) {
return GoodsDetail.builder().id(request.getId()).name("商品").build();
}
}
@RestController @RequestMapping("/goods") public class GoodsController { @Resource private StoryEngine storyEngine; @PostMapping("/show") public GoodsDetail showGoods(@RequestBody GoodsDetailRequest request) { StoryRequest<GoodsDetail> req = ReqBuilder.returnType(GoodsDetail.class) .startId("kstry-demo-goods-show").request(request).build(); TaskResponse<GoodsDetail> fire = storyEngine.fire(req); if (fire.isSuccess()) { return fire.getResult(); } return null; } }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。