Rename
This commit is contained in:
@@ -34,7 +34,7 @@ import we.constants.CommonConstants;
|
|||||||
import we.exception.ExecuteScriptException;
|
import we.exception.ExecuteScriptException;
|
||||||
import we.exception.RedirectException;
|
import we.exception.RedirectException;
|
||||||
import we.exception.StopAndResponseException;
|
import we.exception.StopAndResponseException;
|
||||||
import we.fizz.component.ComponentHelper;
|
import we.fizz.component.ComponentExecutor;
|
||||||
import we.fizz.component.ComponentResult;
|
import we.fizz.component.ComponentResult;
|
||||||
import we.fizz.component.IComponent;
|
import we.fizz.component.IComponent;
|
||||||
import we.fizz.component.StepContextPosition;
|
import we.fizz.component.StepContextPosition;
|
||||||
@@ -164,7 +164,7 @@ public class Pipeline {
|
|||||||
List<IComponent> components = step.getComponents();
|
List<IComponent> components = step.getComponents();
|
||||||
if (components != null && components.size() > 0) {
|
if (components != null && components.size() > 0) {
|
||||||
StepContextPosition stepCtxPos = new StepContextPosition(step.getName());
|
StepContextPosition stepCtxPos = new StepContextPosition(step.getName());
|
||||||
return ComponentHelper.run(components, stepContext, stepCtxPos, (ctx, pos) -> {
|
return ComponentExecutor.exec(components, stepContext, stepCtxPos, (ctx, pos) -> {
|
||||||
step.beforeRun(stepContext, null);
|
step.beforeRun(stepContext, null);
|
||||||
return createStep(step);
|
return createStep(step);
|
||||||
}).flatMap(sr -> {
|
}).flatMap(sr -> {
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ import org.apache.commons.collections.CollectionUtils;
|
|||||||
import org.springframework.context.ConfigurableApplicationContext;
|
import org.springframework.context.ConfigurableApplicationContext;
|
||||||
|
|
||||||
import reactor.core.publisher.Mono;
|
import reactor.core.publisher.Mono;
|
||||||
import we.fizz.component.ComponentHelper;
|
import we.fizz.component.ComponentExecutor;
|
||||||
import we.fizz.component.ComponentResult;
|
import we.fizz.component.ComponentResult;
|
||||||
import we.fizz.component.IComponent;
|
import we.fizz.component.IComponent;
|
||||||
import we.fizz.component.StepContextPosition;
|
import we.fizz.component.StepContextPosition;
|
||||||
@@ -88,7 +88,7 @@ public class Step {
|
|||||||
step.addRequestConfig((String) requestConfig.get("name"), inputConfig);
|
step.addRequestConfig((String) requestConfig.get("name"), inputConfig);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
step.setComponents(ComponentHelper.buildComponents((List<Map<String, Object>>) config.get("components")));
|
step.setComponents(ComponentExecutor.buildComponents((List<Map<String, Object>>) config.get("components")));
|
||||||
return step;
|
return step;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -128,7 +128,7 @@ public class Step {
|
|||||||
List<IComponent> components = input.getConfig().getComponents();
|
List<IComponent> components = input.getConfig().getComponents();
|
||||||
if (components != null && components.size() > 0) {
|
if (components != null && components.size() > 0) {
|
||||||
StepContextPosition stepCtxPos = new StepContextPosition(name, requestName);
|
StepContextPosition stepCtxPos = new StepContextPosition(name, requestName);
|
||||||
Mono<Object> result = ComponentHelper.run(components, stepContext, stepCtxPos, (ctx, pos) -> {
|
Mono<Object> result = ComponentExecutor.exec(components, stepContext, stepCtxPos, (ctx, pos) -> {
|
||||||
if (input.needRun(ctx)) {
|
if (input.needRun(ctx)) {
|
||||||
return input.run();
|
return input.run();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ import we.fizz.component.condition.Condition;
|
|||||||
* @author Francis Dong
|
* @author Francis Dong
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class ComponentHelper {
|
public class ComponentExecutor {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts step context to ONode
|
* Converts step context to ONode
|
||||||
@@ -80,7 +80,7 @@ public class ComponentHelper {
|
|||||||
* @param stepContext
|
* @param stepContext
|
||||||
* @param f
|
* @param f
|
||||||
*/
|
*/
|
||||||
public static Mono<Object> run(List<IComponent> components, StepContext<String, Object> stepContext,
|
public static Mono<Object> exec(List<IComponent> components, StepContext<String, Object> stepContext,
|
||||||
StepContextPosition stepCtxPos, BiFunction<StepContext, StepContextPosition, Mono> f) {
|
StepContextPosition stepCtxPos, BiFunction<StepContext, StepContextPosition, Mono> f) {
|
||||||
if (components != null && components.size() > 0) {
|
if (components != null && components.size() > 0) {
|
||||||
// conditions before circle component
|
// conditions before circle component
|
||||||
@@ -28,7 +28,7 @@ import lombok.Data;
|
|||||||
import reactor.core.publisher.Flux;
|
import reactor.core.publisher.Flux;
|
||||||
import reactor.core.publisher.Mono;
|
import reactor.core.publisher.Mono;
|
||||||
import we.fizz.StepContext;
|
import we.fizz.StepContext;
|
||||||
import we.fizz.component.ComponentHelper;
|
import we.fizz.component.ComponentExecutor;
|
||||||
import we.fizz.component.ComponentResult;
|
import we.fizz.component.ComponentResult;
|
||||||
import we.fizz.component.ComponentTypeEnum;
|
import we.fizz.component.ComponentTypeEnum;
|
||||||
import we.fizz.component.IComponent;
|
import we.fizz.component.IComponent;
|
||||||
@@ -264,7 +264,7 @@ public class Circle implements IComponent {
|
|||||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||||
public Mono<Object> exec(StepContext<String, Object> stepContext, StepContextPosition stepCtxPos,
|
public Mono<Object> exec(StepContext<String, Object> stepContext, StepContextPosition stepCtxPos,
|
||||||
BiFunction<StepContext, StepContextPosition, Mono> f) {
|
BiFunction<StepContext, StepContextPosition, Mono> f) {
|
||||||
ONode ctxNode1 = ComponentHelper.toONode(stepContext);
|
ONode ctxNode1 = ComponentExecutor.toONode(stepContext);
|
||||||
CircleItem nextItem = this.next(ctxNode1);
|
CircleItem nextItem = this.next(ctxNode1);
|
||||||
if (nextItem != null) {
|
if (nextItem != null) {
|
||||||
return Mono.just(new CircleItemResult(ctxNode1, nextItem, null)).expand(circleItemResult -> {
|
return Mono.just(new CircleItemResult(ctxNode1, nextItem, null)).expand(circleItemResult -> {
|
||||||
@@ -293,7 +293,7 @@ public class Circle implements IComponent {
|
|||||||
} else {
|
} else {
|
||||||
stepContext.addStepCircleResult(stepCtxPos.getStepName());
|
stepContext.addStepCircleResult(stepCtxPos.getStepName());
|
||||||
}
|
}
|
||||||
ONode ctxNode2 = ComponentHelper.toONode(stepContext);
|
ONode ctxNode2 = ComponentExecutor.toONode(stepContext);
|
||||||
if (this.breakCircle(cItem.getIndex(), ctxNode2, stepContext, stepCtxPos)) {
|
if (this.breakCircle(cItem.getIndex(), ctxNode2, stepContext, stepCtxPos)) {
|
||||||
return Mono.empty();
|
return Mono.empty();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
package we.fizz.input;
|
package we.fizz.input;
|
||||||
|
|
||||||
import we.fizz.component.ComponentHelper;
|
import we.fizz.component.ComponentExecutor;
|
||||||
import org.reflections.Reflections;
|
import org.reflections.Reflections;
|
||||||
import we.fizz.exception.FizzRuntimeException;
|
import we.fizz.exception.FizzRuntimeException;
|
||||||
import we.fizz.input.extension.request.RequestInput;
|
import we.fizz.input.extension.request.RequestInput;
|
||||||
@@ -67,7 +67,7 @@ public class InputFactory {
|
|||||||
}
|
}
|
||||||
inputConfig.setType(typeEnum);
|
inputConfig.setType(typeEnum);
|
||||||
inputConfig.setDataMapping((Map<String, Object>) config.get("dataMapping"));
|
inputConfig.setDataMapping((Map<String, Object>) config.get("dataMapping"));
|
||||||
inputConfig.setComponents(ComponentHelper.buildComponents((List<Map<String, Object>>) config.get("components")));
|
inputConfig.setComponents(ComponentExecutor.buildComponents((List<Map<String, Object>>) config.get("components")));
|
||||||
inputConfig.parse();
|
inputConfig.parse();
|
||||||
return inputConfig;
|
return inputConfig;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user