🛫Execute
Declare the startup class:
@SpringBootApplication
//Register your defined components into the Spring context
@ComponentScan({"com.xxx.xxx.cmp"})
public class LiteflowExampleApplication {
public static void main(String[] args) {
SpringApplication.run(LiteflowExampleApplication.class, args);
}
}
Then you can get the flowExecutor in any Spring-hosted class to execute the chain:
@Component
public class YourClass{
@Resource
private FlowExecutor flowExecutor;
public void testConfig(){
LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg");
}
}
notice
This DefaultContext
is the default context. Users can use their own arbitrary bean as the context to pass in. If they need to pass in their own context, they need to pass the Class attribute of the user bean. For details, please refer to Data context this chapter.
Help us improve this document (opens new window)
last update: 2022/10/13, 00:02:27