Salome HOME
The draft of the "Copy from existing study" action is added. The YACS step is introdu...
[tools/siman.git] / Workspace / Siman-Common / src / org / splat / service / technical / StepsConfigServiceImpl.java
index 0776d9453a715d16b6ca60271048516d70257496..39c5f70a8a8e291a4723e04dc3cfaef435a64821 100644 (file)
@@ -47,6 +47,28 @@ public class StepsConfigServiceImpl implements StepsConfigService {
                return result;
        }
 
+       /**
+        * Check whether the workflow step involves a project element(s) of the given level.
+        * 
+        * @param stepNum
+        *            the step number
+        * @param level
+        *            the project element level
+        * @return true if there are project element's steps of the given level before the given step
+        */
+       public boolean stepInvolves(final int stepNum,
+                       final Class<? extends ProjectElement> level) {
+               boolean res = false;
+               for (int i = 0; i < _steps.size(); i++) {
+                       ProjectSettingsService.Step step = _steps.get(i);
+                       if (step.appliesTo(level) && step.getNumber() <= stepNum) {
+                               res = true;
+                               break;
+                       }
+               }
+               return res;
+       }
+
        /**
         * Get the steps.
         *