Groovy Code Injection is a very powerful extension of N4 that allows the customer to extend the system by inserting their own code, and triggering this code to execute by sending a JMS message into the system, or by invocation through a WebService call.
There are many possible uses of this capability. For example, Matson will use this for their automobile stuffing operation. In this use case, a foreign system manages automobiles shipped by Matson. In one style of shipping, automobiles are stuffed into empty containers at the terminal, then shipped to the mainland. This stuffing operation is recorded in the automobile system, and Matson desires that this system should automatically update N4 when the stuffing occurs. Since this is not a normal EDI transaction or a state change that can be described in an SNX message, Direct Code Injection is used instead.
The code that Matson will insert will flow something like this:
find the empty Unit to be stuffed from the container id provided as a parameter
call N4's internal API's to update this container with
FreightKind changed from MTY to FCL
Hazards updated to reflect the gasoline within the car
Outbound carrier updated as provided in a parameter
Weight updated
Etc.
write a STUFF event in the Unit's history.