Thank you Ambidex! You gave me the key I needed.
I had a similar problem: I needed to take a collection of independent Boolean variables from an external json feed and direct each into a single, existing, multi-valued taxonomy in Drupal 8. It seemed like a straightforward enough task that I decided to try using just the pre-existing process plugins.
This became more difficult as I discovered that the Boolean values could not be passed directly to a static_map with any ease (see: https://www.drupal.org/docs/8/api/migrate-api/migrate-process-plugins/process-plugin-static-map). In the end, I had to explicitly convert the booleans to strings, pass these to the static_map (one per taxonomy term), and then collect these all together, flattened, to hand off to the internal taxonomy. I was only interested in mapping those marked 'true' - so if false, we needed to skip setting anything. The end result was to be a series of checkboxes within a single vocabulary, checked if the incoming booleans were true.
Here's an example for anyone needing to do something similar:
callable: strtolower # a convenient method to do the conversion to string
bypass: true # skip mapping if the boolean value is false
'1': 23 # to the left is the result of
# converting the boolean to string;
# to the right is the taxonomy term id (tid)
# to which we're mapping. Note that we do no mapping
# at all for false - we just want to skip in that case.
_prepare_secondBooleanField: # map as many of these as needed
'1': 18 # etc - keep mapping tids (note: could also
# map names, but this would require doing an
# entity_lookup later; if you know the term ids
# (and we do, because we're mapping to an existing
# taxonomy) just use them directly. (It also allows
# the names to change without breaking the import
# for ongoing data feeds.)
# Now: flatten all the values that we've found together into
# one simple array (thanks to the clue from Ambidex above)
- '@_prepare_secondBooleanField' # etc - can keep adding fields
# Finally, hand the array to the taxonomy field!
# By using the tids above, we can do a direct assignment: