@@ -517,42 +517,33 @@ def is_conditional_step(param_to_step: Dict[str, CWLObjectType], parm_id: str) -
517517
518518
519519def is_all_output_method_loop_step (param_to_step : Dict [str , CWLObjectType ], parm_id : str ) -> bool :
520- """Check if a step contains a http://commonwl.org/cwltool#Loop requirement with `all` outputMethod."""
520+ """Check if a step contains a `loop` directive with `all` outputMethod."""
521521 source_step : Optional [MutableMapping [str , Any ]] = param_to_step .get (parm_id )
522522 if source_step is not None :
523- for requirement in source_step .get ("requirements" , []):
524- if (
525- requirement ["class" ] == "http://commonwl.org/cwltool#Loop"
526- and requirement .get ("outputMethod" ) == "all"
527- ):
528- return True
523+ if source_step .get ("loop" ) is not None and source_step .get ("outputMethod" ) == "all" :
524+ return True
529525 return False
530526
531527
532528def loop_checker (steps : Iterator [MutableMapping [str , Any ]]) -> None :
533529 """
534- Check http://commonwl.org/cwltool#Loop requirement compatibility with other directives.
530+ Check `loop` compatibility with other directives.
535531
536- :raises ValidationException: If there is an incompatible combination between
537- cwltool:loop and 'scatter' or 'when'.
532+ :raises ValidationException: If there is an incompatible combination between `loop` and `scatter`.
538533 """
539534 exceptions = []
540535 for step in steps :
541- requirements = {
542- ** {h ["class" ]: h for h in step .get ("hints" , [])},
543- ** {r ["class" ]: r for r in step .get ("requirements" , [])},
544- }
545- if "http://commonwl.org/cwltool#Loop" in requirements :
546- if "when" in step :
536+ if "loop" in step :
537+ if "when" not in step :
547538 exceptions .append (
548539 SourceLine (step , "id" ).makeError (
549- "The `cwltool:Loop ` clause is not compatible with the `when ` directive."
540+ "The `when ` clause is mandatory when the `loop ` directive is defined ."
550541 )
551542 )
552543 if "scatter" in step :
553544 exceptions .append (
554545 SourceLine (step , "id" ).makeError (
555- "The `cwltool:Loop ` clause is not compatible with the `scatter` directive."
546+ "The `loop ` clause is not compatible with the `scatter` directive."
556547 )
557548 )
558549 if exceptions :
0 commit comments