Skip to content

Commit

Permalink
Add retries to ListWorkflowInstanceResponse.
Browse files Browse the repository at this point in the history
  • Loading branch information
jsyrjala committed Nov 20, 2014
1 parent 91c4b1e commit 2abaf21
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public ListWorkflowInstanceResponse convert(WorkflowInstance instance, QueryWork
resp.stateText = instance.stateText;
resp.nextActivation = instance.nextActivation;
resp.created = instance.created;
resp.retries = instance.retries;
if (query.includeActions) {
resp.actions = new ArrayList<>();
for (WorkflowInstanceAction action : instance.actions) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ public class ListWorkflowInstanceResponse {
@ApiModelProperty(value = "State variables for current state.", required=false)
public Map<String, Object> stateVariables;

@ApiModelProperty(value = "Number of times current state has been retried.", required=true)
public int retries;

@ApiModelProperty(value = "State change attempts. One instance for each processing attempt.", required=false)
public List<Action> actions;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public void convertWithActionsWorks() throws IOException {
WorkflowInstance i = new WorkflowInstance.Builder().setId(1).setType("dummy").setBusinessKey("businessKey").
setExternalId("externalId").setState("cState").setStateText("cState desc").setNextActivation(now()).
setActions(Arrays.asList(a)).
setRetries(42).
setStateVariables(stateVariables).build();

JsonNode node1 = mock(JsonNode.class);
Expand All @@ -70,6 +71,7 @@ public void convertWithActionsWorks() throws IOException {
assertThat(resp.stateText, is(i.stateText));
assertThat(resp.nextActivation, is(i.nextActivation));
assertThat(resp.created, is(i.created));
assertThat(resp.retries, is(i.retries));
assertThat(resp.actions, contains(reflectEquals(new Action(a.state, a.stateText, a.retryNo,
a.executionStart, a.executionEnd, a.executorId))));
}
Expand Down

0 comments on commit 2abaf21

Please sign in to comment.