Creating Associations

Use Case

I have an action-only rule sheet to seed some data for later rule sheets. I have a Product entity which has an N:1 association to a ProductGroup entity.

To add Product records, I have lines similar to this:[productId='P1', name='Lettuce'][productId='P2', name='Filet Mignon'][productId='P3', name='Apple']

To add ProductGroup records, I have:[productGroupId='PG1', 'Produce'][productGroupId='PG2', 'Meat']

So what is the syntax to associate the "Lettuce" product to the "Produce" product group?

 We’ll consider three cases:Neither Products nor Product groups already exist and need to be created by the rules.

  1. The Product groups already exist but the Products need to be created and associated.
  2. Both the Product groups and the Products exist and must be associated.


Also see Generating Test Data :

and Custom Messages