ICR

Purpose

For use with EDI systems to identify message envelopes.

Methods

Binding name: icrf


Method: int getNextISA(String name)

Increments the named X.12 Interchange Control Reference returning its new value. If the named reference is not found then it will be created automatically.


Method: String getNextISAStr(String name)

Increments the named X.12 Interchange Control Reference returning its new value as a zero padded string. If the named reference is not found then it will be created automatically.


Method: long getNextUNB(String name)

Increments the named EDIFACT Interchange Control Reference returning its new value. If the named reference is not found then it will be created automatically.


Method: String getNextUNBStr(String name)

Increments the named EDIFACT Interchange Control Reference returning its new value as azero padded string. If the named reference is not found then it will be created automatically.

The minimum value of a named ICRF is 1 and the maximum is 999999999 (X.12) or 99999999999999 (EDIFACT). The JMX Management Console may be used for finer control of ICRF instances.

ICRF Value Storage Policy & Storage Lifecycle

ICRFs are implemented as JMX MBeans. They can be viewed and managed by the Expert/Management Console.

Expert/Management console

Because ICRF values can change very quickly not all changes are saved to the database. This is a design decision to enable ICRF values to change rapidly and not be effected by database performance. By default, ICRF values are persisted ‘no more often than’ once every twenty seconds. If b2box is shutdown then the current value (in memory value) of each ICRF is saved to the database. It is therefore possible that if a b2box is ‘killed’ or it’s host system is halted before b2box has time to shut down, some ICRF values may not have been written ‘to disk’. If the use of one or more ICRF values becomes critical to business processes and the chance of a value not being persisted is regarded as too high, this behaviour can be overridden using b2box configuration property value(s):

com.amalto.b2box.core.impl.application.icrf.ICRFMBean.persistPolicy=[policy name]

Valid policy names are:

  • always
  • never
  • noMoreOftenThan (default)

Therefore to ensure each value update to an ICRF is written to the database simply select a policy name of always. You may also change the time period that effects the default policy of noMoreOftenThen by using the additional b2box configuration property:

com.amalto.b2box.core.impl.application.icrf.ICRFMBean.persistPeriod=[milliseconds value]

Example

(1..100).each {
    println icrf.getNextISAStr("myicrf")
}