Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

join branches leftovers #1391

Merged
merged 1 commit into from
Dec 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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();
}
}