Skip to content

Commit

Permalink
fix default simulation tag for creating reclassification task on unca…
Browse files Browse the repository at this point in the history
…tegorized resource objects table
  • Loading branch information
skublik committed Apr 11, 2024
1 parent 6fc3dd8 commit cfd421a
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,8 @@ protected void onTemplateChosePerformed(CompiledObjectCollectionView view, AjaxR
}
};
}

protected boolean getDefaultSimulationTag() {
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,18 @@ private void initLayout() {
add(templateChoicePanel);

ToggleCheckBoxPanel simulationPanel = new ToggleCheckBoxPanel(ID_SIMULATE,
Model.of(false),
Model.of(getDefaultSimulationTag()),
createStringResource("TaskCreationPopup.simulate.label"),
createStringResource("TaskCreationPopup.simulate.tooltip"));
simulationPanel.setOutputMarkupId(true);
add(simulationPanel);

}

protected boolean getDefaultSimulationTag() {
return false;
}

@SuppressWarnings("all")
protected abstract AbstractTemplateChoicePanel<T> createChoicePanel(String id);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,18 @@ private List<WizardStep> createBasicSteps() {
steps.add(new TaskResourceObjectsWizardPanel(activityName, getAssignmentHolderModel()));
}

boolean isShadowReclassification = WebComponentUtil.hasArchetypeAssignment(task, SystemObjectsType.ARCHETYPE_SHADOW_RECLASSIFICATION_TASK.value());
//TODO this is not very clean, should be somehow passed to the wizard
boolean isSimulationTask = task.getActivity().getExecution() != null && task.getActivity().getExecution().getMode() != null;
if (isSimulationTask) {
steps.add(new TaskExecutionWizardPanel(getAssignmentHolderModel()));
steps.add(new TaskExecutionWizardPanel(getAssignmentHolderModel()){
@Override
protected boolean isShadowSimulation() {
return isShadowReclassification;
}
});
}

boolean isShadowReclassification = WebComponentUtil.hasArchetypeAssignment(task, SystemObjectsType.ARCHETYPE_SHADOW_RECLASSIFICATION_TASK.value());
boolean isImport = WebComponentUtil.hasArchetypeAssignment(task, SystemObjectsType.ARCHETYPE_IMPORT_TASK.value());
if (!isImport) {
if (isShadowReclassification) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ protected IModel<String> getTextModel() {

@Override
protected IModel<String> getSubTextModel() {
return createStringResource("PageTask.wizard.step.execution.subText");
return createStringResource(!isShadowSimulation() ? "PageTask.wizard.step.execution.subText" : "PageTask.wizard.step.execution.subText.shadow");
}

protected boolean isShadowSimulation() {
return false;
}

@Override
Expand Down

0 comments on commit cfd421a

Please sign in to comment.