Open bronnikova18 opened 2 years ago
I'm not sure of the business use case, so my examples may not be realistic, but I'll try to show the format.
You could encode this as presence is required except that a certain value is forbidden.
<fixr:fieldRef id="145" presence="required">
<fixr:rule name="exception" presence="forbidden">
<fixr:when>DeliverToLocationID == "BadLocation"</fixr:when>
</fixr:rule>
</fixr:fieldRef>
Again, use a rule that sets it to forbidden in a certain exception case. Uses existence operator of Score DSL. Note that "le" operator avoids having to use an escape sequence for <
in XML.
<fixr:fieldRef id="2646">
<fixr:rule name="exception" presence="forbidden">
<fixr:when>exists CommissionRate and CommissionRage le 0.10 </fixr:when>
</fixr:rule>
</fixr:fieldRef>
Write the rules for field2 and field3.
<fixr:fieldRef id="9999">
<fixr:rule name="Field2Exception" presence="forbidden">
<fixr:when>field1 == "some value"</fixr:when>
</fixr:rule>
</fixr:fieldRef>
How would you create a rule that enforces a given number of occurrences in a repeating group? Example, in a swap trade I want to make sure that there is exactly one party of type clearing house. I think I can filter them like this: Parties[PartyRole==4] but is there a count or length operator/function?
The overall size of a repeating group may be limited with group attributes; see Repeating group
Limits on the size of a repeating group may optionally be specified with
implMinOccurs
andimplMaxOccurs
attributes. If those attributes are not present, then the repeating has unbound size.
There currently is no count operator. However, we are gathering proposed enhancements for Orchestra v1.1, so feel free to propose a syntax for it.
Thank you! Examples are very helpful.
Could you please provide one more example:
I propose to add these examples to v1.1 documentation.
Please provide sample code to define the following basic rules in Orchestra: