You can’t natively. You cannot get a count of items that are part of a GroupCode unless you start storing some counts in Program Settings using the GroupCode as part of the Setting Name. Then you could check the Program Setting(s) in a Constraint.
As with everything “SambaPOS” there are multiple ways to achieve a desired result. Having a clear understanding of that result is key. I can show you some different ways, but as is most times the case, once I have done that, people will throw another piece of criteria in, which makes the solution break.
You can constrain Mappings, in particular, Print Job Mappings by Group, Product, and Product Tag.
You can Constrain Rules.
You can Constrain Actions with Rules.
You can make an Action “Generic” and then set the parameters of the Action via the Rule. Let me give you an example… you have 3 Print Job Actions, that all do exactly the same thing, except the Print Job Name is different in each Rule.
So let’s start there by making a Generic Execute Print Job Action …
While we’re at it, let’s make a Generic Update Program Setting Action we can use for whatever we like …
The key to both of those Actions that makes them “generic” is that we are using a [:variableName]
for some of the Action Parameters. That let’s us set the Parameter via the Rule instead of hard-coding it in the Action itself.
Now when we put together a Rule, our Actions look like the following, where we can set the Action Parameter via the Rule into the [:variableName]
that we defined for each Action Parameter …
Our Printing Rule looks similar, but now we have a single Action listed multiple times, and we have a [:variableName]
for the Print Job ([:printJobName]
). The point of this is show you the flexibility of using generic actions with variables…
Is it going to work like we want? Don’t know, have not tested it. I don’t have your Groups, Jobs, or other Config Settings. Try it.
Before you ask, this is what you need to know if you don’t already …