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

Promote fields() [and friends] to public methods #55

Closed
ehuelsmann opened this issue Jan 19, 2021 · 1 comment · Fixed by #57
Closed

Promote fields() [and friends] to public methods #55

ehuelsmann opened this issue Jan 19, 2021 · 1 comment · Fixed by #57
Labels
enhancement Feature/improvement
Milestone

Comments

@ehuelsmann
Copy link
Member

Issue Template

Description

In #54, there is a plea to provide access to the action instances for the current state of a workflow in order to be able to access extra properties.

Once access to actions has been established, it makes sense to promote the methods fields(), optional_fields() and required_fields() from private to public: using the same reasoning as used in #54, these methods provide information a UI or other consumer of the workflow could use for user interaction.

Bugs and Issues

Specify what version was used

1.49

ehuelsmann added a commit to ehuelsmann/perl-workflow that referenced this issue Jan 19, 2021
…ds as public

By reclassifying these methods as public, they become available for
consumers of Workflow. This makes sense once the action instances
become accessible by callers in order to provide access to their
extra properties (as intended by perl-workflow#54).
ehuelsmann added a commit to ehuelsmann/perl-workflow that referenced this issue Jan 24, 2021
…ds as public

By reclassifying these methods as public, they become available for
consumers of Workflow. This makes sense once the action instances
become accessible by callers in order to provide access to their
extra properties (as intended by perl-workflow#54).
@jonasbn jonasbn added the enhancement Feature/improvement label Jan 29, 2021
@ehuelsmann
Copy link
Member Author

Ok. So, while the public API doesn't direcly allow querying optional vs required fields (and if it doesn't, then why have these private methods???), but: the Workflow instance allows querying the set of 'current' (=allowable) actions (get_current_actions([$group])); once the current actions are available (by name), the fields for that action can be queried using the workflow instance by calling get_action_fields( $action ).

So maybe this issue is already catered for. Having an example that uses the fields in the docs would definitely be great to help newcomers understand the intent and capabilities of the library.

@jonasbn jonasbn added this to the 1.54 milestone Apr 18, 2021
@jonasbn jonasbn linked a pull request Apr 18, 2021 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature/improvement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants