@@ -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.
0 commit comments