// check if the subject is already in the workflow
if (!
$marking->
getPlaces()) { if (!
$this->definition->
getInitialPlaces()) { throw new LogicException(sprintf('The Marking is empty and there is no initial place for workflow "%s".',
$this->name
));
} foreach ($this->definition->
getInitialPlaces() as $place) { $marking->
mark($place);
} // update the subject with the new marking
$this->markingStore->
setMarking($subject,
$marking);
if (!
$context) { $context = self::DEFAULT_INITIAL_CONTEXT;
} $this->
entered($subject, null,
$marking,
$context);
} // check that the subject has a known place
$places =
$this->definition->
getPlaces();
foreach ($marking->
getPlaces() as $placeName =>
$nbToken) {