In Orderful, a rule is a set of instructions that enables you to modify the data contained in your EDI transactions based on criteria that you define. By writing rules, you can adjust your outbound transactions to meet your trading partners' requirements or adjust your inbound transactions to meet the needs of your own ERP.
Rules and Paths
A path points to a particular location in Orderful's JSON schemas. In relation to X12 documents, a path which points to a location containing a text string corresponds to an element; a path pointing to an array of objects corresponds to a segment, and a path which points to an array of arrays (i.e. a group of segments) corresponds to a loop.
A rule is attached to a path within your transaction – specifically an element path. If the rule's path points to an element within an X12 segment that can repeat or that exists within a loop, the rule will apply to all instances of that element. The effect of the rule, however, might be different for each instance, depending on whether the rule you have written contains any conditional logic.
In Orderful's Rules Editor, you select the rule path by clicking on a data element in a transaction.
Transaction Type vs. Relationship Rules
Rules can be defined at either the transaction type or the relationship level:
A transaction type rule applies to all transaction types being exchanged in a given direction, regardless of the trading partner. For example, a transaction type rule could be defined on outbound 810 invoices. This rule would apply to every invoice you post.
A relationship rule applies only to your relationship with a specific EDI account. For example, you could define a relationship rule which would only apply to 810 invoices that you send to Costco.
Both a transaction type and a relationship rule can be defined on the same path. If that's the case, the relationship rule will override the transaction type rule.