Skip to content

Commit d52fe8c

Browse files
committed
Delete old methods
1 parent dfce9b3 commit d52fe8c

File tree

3 files changed

+2
-75
lines changed

3 files changed

+2
-75
lines changed

Kitodo-DataManagement/src/main/java/org/kitodo/data/database/beans/Process.java

Lines changed: 0 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -783,77 +783,6 @@ public void setOcrdWorkflowId(String ocrdWorkflowId) {
783783
this.ocrdWorkflowId = ocrdWorkflowId;
784784
}
785785

786-
/**
787-
* Returns the percentage of tasks in the process that are completed. The
788-
* total of tasks awaiting preconditions, startable, in progress, and
789-
* completed is {@code 100.0d}.
790-
*
791-
* @return percentage of tasks completed
792-
*/
793-
public Double getProgressClosed() {
794-
if (CollectionUtils.isEmpty(tasks) && !hasChildren()) {
795-
return 0.0;
796-
}
797-
return getTaskProgress(MAX_AGE_NANOSS).get(TaskStatus.DONE);
798-
}
799-
800-
/**
801-
* Returns the percentage of tasks in the process that are currently being
802-
* processed. The progress total of tasks waiting for preconditions,
803-
* startable, in progress, and completed is {@code 100.0d}.
804-
*
805-
* @return percentage of tasks in progress
806-
*/
807-
public Double getProgressInProcessing() {
808-
if (CollectionUtils.isEmpty(tasks) && !hasChildren()) {
809-
return 0.0;
810-
}
811-
return getTaskProgress(MAX_AGE_NANOSS).get(TaskStatus.INWORK);
812-
}
813-
814-
/**
815-
* Returns the percentage of the process's tasks that are now ready to be
816-
* processed but have not yet been started. The progress total of tasks
817-
* waiting for preconditions, startable, in progress, and completed is
818-
* {@code 100.0d}.
819-
*
820-
* @return percentage of startable tasks
821-
*/
822-
public Double getProgressOpen() {
823-
if (CollectionUtils.isEmpty(tasks) && !hasChildren()) {
824-
return 0.0;
825-
}
826-
return getTaskProgress(MAX_AGE_NANOSS).get(TaskStatus.OPEN);
827-
}
828-
829-
private Map<TaskStatus, Double> getTaskProgress(long maxAgeNanos) {
830-
long now = System.nanoTime();
831-
if (Objects.isNull(this.taskProgress) || now - taskProgress.getLeft() > maxAgeNanos) {
832-
Map<TaskStatus, Double> taskProgress = ProcessConverter.getTaskProgressPercentageOfProcess(this, true);
833-
this.taskProgress = Pair.of(System.nanoTime(), taskProgress);
834-
} else {
835-
this.taskProgress = Pair.of(now, taskProgress.getValue());
836-
}
837-
Map<TaskStatus, Double> value = taskProgress.getValue();
838-
return value;
839-
}
840-
841-
/**
842-
* Returns a coded overview of the progress of the process. The larger the
843-
* number, the more advanced the process is, so it can be used to sort by
844-
* progress. The numeric code consists of twelve digits, each three digits
845-
* from 000 to 100 indicate the percentage of tasks completed, currently in
846-
* progress, ready to start and not yet ready, in that order. For example,
847-
* 000000025075 means that 25% of the tasks are ready to be started and 75%
848-
* of the tasks are not yet ready to be started because previous tasks have
849-
* not yet been processed.
850-
*
851-
* @return overview of the processing status
852-
*/
853-
public String getProgressCombined() {
854-
return ProcessConverter.getCombinedProgressFromTaskPercentages(getTaskProgress(MAX_AGE_NANOSS));
855-
}
856-
857786
/**
858787
* Returns the record number of the parent process, if any. Is {@code 0} if
859788
* there is no parent process above.

Kitodo/src/main/java/org/kitodo/production/forms/ProcessForm.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,6 @@ public class ProcessForm extends TemplateBaseForm {
105105
private final Map<Integer, Boolean> assignedProcesses = new HashMap<>();
106106
private String settingImportConfigurationResultMessage;
107107
private boolean importConfigurationsSetSuccessfully = false;
108-
private boolean initialized = false;
109-
110108

111109
@Inject
112110
private CustomListColumnInitializer initializer;

Kitodo/src/main/java/org/kitodo/production/forms/ProcessListBaseView.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,9 @@ public Map<TaskStatus, Integer> getCachedTaskStatusCounts(Process process) {
277277
public double progress(Process process, TaskStatus status) {
278278
Map<TaskStatus, Integer> counts = getCachedTaskStatusCounts(process);
279279
int total = counts.values().stream().mapToInt(Integer::intValue).sum();
280-
// keep legacy semantics
281280
if (total == 0) {
282-
return status == TaskStatus.LOCKED ? 100.0 : 0.0;
281+
counts.put(TaskStatus.LOCKED, 1);
282+
total = 1;
283283
}
284284
return 100.0 * counts.getOrDefault(status, 0) / total;
285285
}

0 commit comments

Comments
 (0)