Problem/Motivation

We need to determine the number of items in a list.

Steps to reproduce

Proposed resolution

For counting, we could implement an action that counts items on a specified Token and sets the count result into another token. For convenience, we could additionally implement a condition "number of items" extending from StringComparisonBase. That count action would only address "real" lists as we already have "Compare two scalar values" that may directly count a string length.

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#11 Screenshot 2022-05-17 at 18.14.34.png43.82 KBmxh

Issue fork eca-3280203

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mxh created an issue. See original summary.

jurgenhaas’s picture

Assigned: Unassigned » jurgenhaas

jurgenhaas’s picture

Assigned: jurgenhaas » Unassigned
Status: Active » Needs review

If the structure is OK this way, I'll add more tests.

mxh’s picture

Status: Needs review » Needs work

The only thing that should be considered is the check for \Traversable and calling iterator_count on such an object. The other notes are just minor ones.

jurgenhaas’s picture

Status: Needs work » Needs review

Covered your comments and tests included.

mxh’s picture

Status: Needs review » Needs work

Only minor comments, otherwise good to go. Big 👍🏼 for the great tests!

jurgenhaas’s picture

Status: Needs work » Needs review

Setting back for another review, names have changed a bit more than maybe expected.

mxh’s picture

Status: Needs review » Needs work

Sorry need to set once more to NW due the found problem with plugins having the same ID. Otherwise looks good and can be merged.

jurgenhaas’s picture

Status: Needs work » Needs review

Had to take a different approach as we have no control over plugin ids across different plugin managers. Updated the bpmn id instead by including the plugin type into the id.

mxh’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new43.82 KB

Took a second look and noticed that some settings on the condition plugin don't make sense to be shown via UI. Attached a screenshot with the affected ones that could be hidden IMO. Otherwise good to go.

  • jurgenhaas committed 09bca14 on 1.0.x
    Issue #3280203 by jurgenhaas, mxh: Add action and condition for counting...
jurgenhaas’s picture

Status: Reviewed & tested by the community » Fixed

That's correct - as it is a broader issue, I moved that into #3280939: Add support for hidden config form fields and as it doesn't hurt here, merged and closed this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.