HComponent.java 828 B

12345678910111213141516171819202122232425262728293031323334
  1. /**
  2. * <p>Title: liteFlow</p>
  3. * <p>Description: 轻量级的组件式流程框架</p>
  4. * <p>Copyright: Copyright (c) 2017</p>
  5. * @author Bryan.Zhang
  6. * @email weenyc31@163.com
  7. * @Date 2017-8-1
  8. * @version 1.0
  9. */
  10. package com.yomahub.flowtest.components;
  11. import com.yomahub.liteflow.core.FlowExecutor;
  12. import com.yomahub.liteflow.core.NodeComponent;
  13. import com.yomahub.liteflow.entity.data.DefaultSlot;
  14. import org.springframework.stereotype.Component;
  15. import javax.annotation.Resource;
  16. @Component("h")
  17. public class HComponent extends NodeComponent {
  18. @Resource
  19. private FlowExecutor flowExecutor;
  20. @Override
  21. public void process() {
  22. System.out.println("Hcomponent executed!");
  23. try{
  24. flowExecutor.invoke("strategy1",3, DefaultSlot.class, this.getSlotIndex());
  25. }catch (Exception e){
  26. e.printStackTrace();
  27. }
  28. }
  29. }