Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[WORKFLOW] [RFC] Pass context/metadata in the entire workflow process #27925

Copy link
Copy link
Closed
@noniagriconomie

Description

@noniagriconomie
Issue body actions

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    RFCRFC = Request For Comments (proposals about features that you want to be discussed)RFC = Request For Comments (proposals about features that you want to be discussed)Workflow

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.