Skip to content

Commit

Permalink
join branches leftovers (#1391)
Browse files Browse the repository at this point in the history
  • Loading branch information
adriana-corui authored Dec 14, 2022
1 parent 35b7664 commit 19a3ed5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public class LanguageEventData extends HashMap<String, Serializable> {
public static final String PRODUCER_WORKER_UUID = "PRODUCER_WORKER_UUID";
public static final String ROBOT_UUID = "ROBOT_UUID";
public static final String ROBOT_GROUP_NAME = "ROBOT_GROUP_NAME";
public static final String BRANCH_ID = "BRANCH_ID";

public enum StepType {
FLOW("flow"),
Expand Down Expand Up @@ -156,6 +157,14 @@ public void setPath(String path) {
put(PATH, path);
}

public String getBranchId() {
return (String) get(BRANCH_ID);
}

public void setBranchId(String branchId) {
put(BRANCH_ID, branchId);
}

public String getResult() {
return (String) get(RESULT);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ private static LanguageEventData getLanguageEventData(ExecutionRuntimeServices r
eventData.setTimeStamp(new Date());
eventData.setExecutionId(runtimeServices.getExecutionId());
eventData.setPath(path);
eventData.setBranchId(runtimeServices.getBranchId());
return eventData;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
import static java.lang.Integer.parseInt;
import static org.apache.commons.collections4.CollectionUtils.isEmpty;
import static org.apache.commons.collections4.CollectionUtils.isNotEmpty;
import static org.apache.commons.lang3.BooleanUtils.isTrue;
import static org.apache.commons.lang3.StringUtils.isNotBlank;
import static org.apache.commons.lang3.Validate.notNull;

Expand Down Expand Up @@ -248,8 +249,8 @@ private void handleLastIteration(RunEnvironment runEnv,
clearExecutionRuntimeForNextStep(executionRuntimeServices);
runEnv.getExecutionPath().up();

if (temporaryBranchesContext.size() < executionRuntimeServices.removeSplitDataSize()) {
throw new RuntimeException("Exception occurred when running lane");
if (isTrue(executionRuntimeServices.removeBranchErrorKey())) {
throw new RuntimeException("Exception occurred during lane execution");
}

Context flowContext = runEnv.getStack().popContext();
Expand Down Expand Up @@ -401,6 +402,8 @@ private void collectBranchesData(
initialBranchContext,
Pair.of(RuntimeConstants.BRANCH_RETURN_VALUES_KEY, executableReturnValues)
);
} else {
executionRuntimeServices.setBranchErrorKey();
}
}
}
Expand Down Expand Up @@ -454,6 +457,7 @@ private void clearExecutionRuntimeForNextStep(ExecutionRuntimeServices execution
executionRuntimeServices.removeRemainingBranches();
executionRuntimeServices.removeParallelTemporaryContext();
executionRuntimeServices.removeSplitData();
executionRuntimeServices.removeSplitDataSize();
executionRuntimeServices.removeThrottleSize();
}
}

0 comments on commit 19a3ed5

Please sign in to comment.