@Test public void should_not_log_id_we_distribute_only_one_element() { Distribution distribution = new Distribution(); distribution.setKind(DistributionKind.REF); Action action = new Action(); action.setActionDefinition( new ActionDefinition("actionKey", ProcessBehavior.NOBLOCKING, null, new ArrayList<>(), new ArrayList<>())); ArrayList<Action> actions = new ArrayList<>(); actions.add(action); Step step = new Step(null, "workerId", "stepName", ProcessBehavior.NOBLOCKING, distribution, actions); step.defaultLifecycleLog(LifecycleState.TEMPORARY); boolean lifecycleEnabled = action.getActionDefinition().lifecycleEnabled(); assertThat(lifecycleEnabled).isFalse(); }
public void defaultLifecycleLog(LifecycleState lifecycleLog) { actions.forEach(action -> { boolean distributed = distribution.getKind().isDistributed(); if (distributed) { action.getActionDefinition().defaultLifecycleLog(lifecycleLog); } else { action.getActionDefinition().defaultLifecycleLog(DISABLED); } }); }
Step { public void defaultLifecycleLog(LifecycleState lifecycleLog) { actions.forEach(action -> { boolean distributed = distribution.getKind().isDistributed(); if (distributed) { action.getActionDefinition().defaultLifecycleLog(lifecycleLog); } else { action.getActionDefinition().defaultLifecycleLog(DISABLED); } }); } }
Step { public void defaultLifecycleLog(LifecycleState lifecycleLog) { actions.forEach(action -> { boolean distributed = distribution.getKind().isDistributed(); if (distributed) { action.getActionDefinition().defaultLifecycleLog(lifecycleLog); } else { action.getActionDefinition().defaultLifecycleLog(DISABLED); } }); } Step(); @JsonCreator  Step(
        @JsonProperty("id") String id,
        @JsonProperty("workerGroupId") String workerGroupId,
        @JsonProperty("stepName") String stepName,
        @JsonProperty("behavior") ProcessBehavior behavior,
        @JsonProperty("distribution") Distribution distribution,
        @JsonProperty("actions") List<Action> actions); }
Step { public void defaultLifecycleLog(LifecycleState lifecycleLog) { actions.forEach(action -> { boolean distributed = distribution.getKind().isDistributed(); if (distributed) { action.getActionDefinition().defaultLifecycleLog(lifecycleLog); } else { action.getActionDefinition().defaultLifecycleLog(DISABLED); } }); } Step(); @JsonCreator  Step(
        @JsonProperty("id") String id,
        @JsonProperty("workerGroupId") String workerGroupId,
        @JsonProperty("stepName") String stepName,
        @JsonProperty("behavior") ProcessBehavior behavior,
        @JsonProperty("distribution") Distribution distribution,
        @JsonProperty("actions") List<Action> actions); String getId(); void setId(String id); List<Action> getActions(); Step setActions(List<Action> actions); String getWorkerGroupId(); Step setWorkerGroupId(String workerGroupId); String getStepName(); Step setStepName(String stepName); Distribution getDistribution(); Step setDistribution(Distribution distribution); ProcessBehavior getBehavior(); Step setBehavior(ProcessBehavior behavior); ItemStatus getStepResponses(); Step setStepResponses(ItemStatus stepResponses); @JsonIgnore boolean shallStop(); @JsonIgnore boolean isBlocking(); @JsonIgnore boolean isFinally(); PauseOrCancelAction getPauseOrCancelAction(); Step setPauseOrCancelAction(PauseOrCancelAction pauseOrCancelAction); void defaultLifecycleLog(LifecycleState lifecycleLog); }
Step { public void defaultLifecycleLog(LifecycleState lifecycleLog) { actions.forEach(action -> { boolean distributed = distribution.getKind().isDistributed(); if (distributed) { action.getActionDefinition().defaultLifecycleLog(lifecycleLog); } else { action.getActionDefinition().defaultLifecycleLog(DISABLED); } }); } Step(); @JsonCreator  Step(
        @JsonProperty("id") String id,
        @JsonProperty("workerGroupId") String workerGroupId,
        @JsonProperty("stepName") String stepName,
        @JsonProperty("behavior") ProcessBehavior behavior,
        @JsonProperty("distribution") Distribution distribution,
        @JsonProperty("actions") List<Action> actions); String getId(); void setId(String id); List<Action> getActions(); Step setActions(List<Action> actions); String getWorkerGroupId(); Step setWorkerGroupId(String workerGroupId); String getStepName(); Step setStepName(String stepName); Distribution getDistribution(); Step setDistribution(Distribution distribution); ProcessBehavior getBehavior(); Step setBehavior(ProcessBehavior behavior); ItemStatus getStepResponses(); Step setStepResponses(ItemStatus stepResponses); @JsonIgnore boolean shallStop(); @JsonIgnore boolean isBlocking(); @JsonIgnore boolean isFinally(); PauseOrCancelAction getPauseOrCancelAction(); Step setPauseOrCancelAction(PauseOrCancelAction pauseOrCancelAction); void defaultLifecycleLog(LifecycleState lifecycleLog);  }