PComponent.java 730 B

1234567891011121314151617181920212223242526272829303132
  1. /**
  2. * <p>Title: liteflow</p>
  3. * <p>Description: 轻量级的组件式流程框架</p>
  4. * @author Bryan.Zhang
  5. * @email weenyc31@163.com
  6. * @Date 2020/4/1
  7. */
  8. package com.yomahub.flowtest.components;
  9. import com.yomahub.liteflow.core.FlowExecutor;
  10. import com.yomahub.liteflow.core.NodeComponent;
  11. import com.yomahub.liteflow.core.NodeCondComponent;
  12. import org.springframework.stereotype.Component;
  13. import javax.annotation.Resource;
  14. @Component("p")
  15. public class PComponent extends NodeCondComponent {
  16. @Override
  17. public String processCond() throws Exception {
  18. System.out.println("p conponent executed");
  19. Integer flag = this.getSlot().getData("p_flag");
  20. if(flag == 10) {
  21. return "p1";
  22. }else {
  23. return "p2";
  24. }
  25. }
  26. }