|
@@ -35,8 +35,22 @@ public class HttpNode extends Node {
|
|
httpServiceTask.setExecutionListeners(this.buidEventListener());
|
|
httpServiceTask.setExecutionListeners(this.buidEventListener());
|
|
// httpServiceTask.setAsynchronous(true);
|
|
// httpServiceTask.setAsynchronous(true);
|
|
// httpServiceTask.setParallelInSameTransaction(true);
|
|
// httpServiceTask.setParallelInSameTransaction(true);
|
|
- // httpServiceTask.setImplementationType(ImplementationType.IMPLEMENTATION_TYPE_DELEGATEEXPRESSION);
|
|
|
|
- // httpServiceTask.setImplementation("${httpDelegate}");
|
|
|
|
|
|
+ // 失败重试
|
|
|
|
+ boolean isRetry = Objects.nonNull(this.retryCount) && this.retryCount > 0;
|
|
|
|
+ if (isRetry) {
|
|
|
|
+ StringBuilder retry = new StringBuilder();
|
|
|
|
+ retry.append(String.format("R%s", this.retryCount));
|
|
|
|
+ if (Objects.nonNull(this.duration)) {
|
|
|
|
+ retry.append("/")
|
|
|
|
+ .append(String.format(this.unit.getUnit(), this.duration));
|
|
|
|
+ ExtensionElement retryElement = new ExtensionElement();
|
|
|
|
+ retryElement.setNamespace("https://flowable.org/model");
|
|
|
|
+ retryElement.setNamespacePrefix("flowable");
|
|
|
|
+ retryElement.setName("failedJobRetryTimeCycle");
|
|
|
|
+ retryElement.setElementText(retry.toString());
|
|
|
|
+ httpServiceTask.addExtensionElement(retryElement);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
// 请求参数
|
|
// 请求参数
|
|
ArrayList<FieldExtension> fieldExtensions = new ArrayList<>();
|
|
ArrayList<FieldExtension> fieldExtensions = new ArrayList<>();
|
|
FieldExtension urlExtension = new FieldExtension();
|
|
FieldExtension urlExtension = new FieldExtension();
|
|
@@ -80,26 +94,10 @@ public class HttpNode extends Node {
|
|
activityBehaviorExtension.setStringValue("com.flow.behavior.CustomHttpServiceTaskActivityBehavior");
|
|
activityBehaviorExtension.setStringValue("com.flow.behavior.CustomHttpServiceTaskActivityBehavior");
|
|
fieldExtensions.add(activityBehaviorExtension);
|
|
fieldExtensions.add(activityBehaviorExtension);
|
|
httpServiceTask.setFieldExtensions(fieldExtensions);
|
|
httpServiceTask.setFieldExtensions(fieldExtensions);
|
|
- // 失败重试
|
|
|
|
- boolean isRetry = Objects.nonNull(this.retryCount) && this.retryCount > 0;
|
|
|
|
FieldExtension ignoreExtension = new FieldExtension();
|
|
FieldExtension ignoreExtension = new FieldExtension();
|
|
ignoreExtension.setFieldName("ignoreException");
|
|
ignoreExtension.setFieldName("ignoreException");
|
|
ignoreExtension.setStringValue(Boolean.toString(isRetry));
|
|
ignoreExtension.setStringValue(Boolean.toString(isRetry));
|
|
fieldExtensions.add(ignoreExtension);
|
|
fieldExtensions.add(ignoreExtension);
|
|
- if (isRetry) {
|
|
|
|
- StringBuilder retry = new StringBuilder();
|
|
|
|
- retry.append(String.format("R%s", this.retryCount));
|
|
|
|
- if (Objects.nonNull(this.duration)) {
|
|
|
|
- retry.append("/")
|
|
|
|
- .append(String.format(this.unit.getUnit(), this.duration));
|
|
|
|
- ExtensionElement retryElement = new ExtensionElement();
|
|
|
|
- retryElement.setNamespace("https://flowable.org/model");
|
|
|
|
- retryElement.setNamespacePrefix("flowable");
|
|
|
|
- retryElement.setName("failedJobRetryTimeCycle");
|
|
|
|
- retryElement.setElementText(retry.toString());
|
|
|
|
- httpServiceTask.addExtensionElement(retryElement);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
elements.add(httpServiceTask);
|
|
elements.add(httpServiceTask);
|
|
// 下一个节点的连线
|
|
// 下一个节点的连线
|
|
Node child = this.getChild();
|
|
Node child = this.getChild();
|