Skip to content

Commit

Permalink
Copy new state variables to original variables after saving workflow …
Browse files Browse the repository at this point in the history
…instance
  • Loading branch information
gmokki committed Aug 1, 2014
1 parent e3f749e commit d8b88fd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,8 @@ private WorkflowInstance saveWorkflowInstanceState(StateExecutionImpl execution,
builder.setState(execution.getNextState()).setStateText(execution.getNextStateReason()).setRetries(0);
}
actionBuilder.setExecutionEnd(now()).setStateText(execution.getNextStateReason());
WorkflowInstance newInstance = builder.build();
workflowInstances.updateWorkflowInstance(newInstance, actionBuilder.build());
return newInstance;
workflowInstances.updateWorkflowInstance(builder.build(), actionBuilder.build());
return builder.setOriginalStateVariables(instance.stateVariables).build();
}

private boolean isNextActivationImmediately(StateExecutionImpl execution) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@ public Builder setProcessing(boolean processing) {
return this;
}

public Builder setOriginalStateVariables(Map<String, String> originalStateVariables) {
this.originalStateVariables.clear();
this.originalStateVariables.putAll(originalStateVariables);
return this;
}

public Builder setStateVariables(Map<String, String> stateVariables) {
this.stateVariables.clear();
this.stateVariables.putAll(stateVariables);
Expand Down

0 comments on commit d8b88fd

Please sign in to comment.