Description
Description
Hi
We are using the workflow component to redesign our internal processing of some business entities.
We are now facing some logic we did not know how to deal with on our code port.
Previously we were doing on our entities status change this logic:
$entity->setStatus(Entity::STATUS_X, $specificComment); // comment can be a tech comment, a context comment, or anything else
and the setStatus() method is like this
public function setStatus(int $status, ?string $comment = null)
{
$this->status = $status;
$this->addStatusLogRecord(new StatusLog($this, $comment));
return $this;
}
We were storing a statusLog on every status change with the new status, the date of change, the user (blameable) and an optionnal comment => for log/debug/history purpose
But now with the workflow, it is our internal marking store that call the setStatus()
(mapping of the current place to our internal status because we store an int not a string),
and unfortunately we are not able to pass some other metadata.
Feature Request
Discussion on the availability to have a workflow business context to allow the developper to pass some context in the workflow process,
and get this context inside the workflow process, all workflow events and in the workflow marking store logic as well.
Is this a feature that can be usefull for this component? giving some possibility to developpers?
Or maybe developpers are already dealing differently for this kind of purpose?
Obviously we can add an in memory property on the entity for storing the comment and if it is not null, get it for the addStatusLogRecord()
but this design is not pleasant at all.
Many thank for your time and thank you for this component that helps us a lot