Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Process: Add hook to customize the process_label attribute #5713

Merged
merged 1 commit into from
Oct 26, 2022

Conversation

sphuber
Copy link
Contributor

@sphuber sphuber commented Oct 21, 2022

Fixes #5712

Up till now the process_label of a ProcessNode instance representing the execution of a Process would be set to the name of the process class. This was hardcoded and could not be changed, but in certain cases it may be useful for the subclass to provide a more meaningful label.

Here the _build_process_label method is called which should return the process label. It can be overridden by subclasses to return another string. When an instance of the Process is run, the value returned by this method will be stored in the process_label attribute.

Copy link
Member

@unkcpz unkcpz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sphuber thanks! Looks good to me.

Up till now the `process_label` of a `ProcessNode` instance representing
the execution of a `Process` would be set to the name of the process
class. This was hardcoded and could not be changed, but in certain cases
it may be useful for the subclass to provide a more meaningful label.

Here the `_build_process_label` method is called which should return the
process label. It can be overridden by subclasses to return another
string. When an instance of the `Process` is run, the value returned by
this method will be stored in the `process_label` attribute.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a hook to Process class that allow to customize the definition of the process_label
2 participants