A simple worflow might have no states:
simpleWorkflow =
element simple_workflow {
element field_id {
attribute REF { xsd:IDREF }
}?,
element is_used {xsd:long}?,
element states {
element state {
element to_id {
attribute REF { xsd:string }
},
element transitions {
element transition {
element from_id {
attribute REF { xsd:string }
}
}+
}?,
simplePostActionsContent,
preConditionsContent
}+
}?
}?
The code does not handle that and a warning is raised if you try to import a workflow that does not have a states
tag.
PHP Warning: foreach() argument must be of type array|object, null given in /usr/share/tuleap/plugins/tracker/include/Workflow/WorkflowFactory.class.php on line 384