Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

A Sequence sequence defines and caches a list of unique values that PhixFlow can then assign to items.

The curValue and nextValue functions are used to get the current and next values in the cached sequence.The following fields are configured in the Basic Settings:

Use the block size to specify the range of values in the sequence. For example, set a block size of 100 to cache 100 consecutive values. PhixFlow checks the database to determine the next available number in the sequence and then sets the next sequence of numbers as "used" in the database. The numbers are stored in the cache. When PhixFlow needs the next number in the sequence, it uses a number from the cache.

When all the values have been used, PhixFlow generates the next set of values in the sequence and saves it to the cache.  

Note

It is much quicker for PhixFlow to retrieve a value from the cached sequence than it is to go back to the database to calculate the next number in a sequence. 

If something clears the cache, such as Tomcat being restarted, any remaining numbers in the cache are lost. This can lead to item values having gaps in the sequence. 

If you want the items to have a continuous list of sequence values, you can set the block size to 1.

Insert excerpt
_standard_settings
_standard_settings
nopaneltrue

Basic Settings

FieldDescription
NameThe name of the sequence.
Start ValueThe first value in the sequence.
Block Size

For quicker performance, set the block size to a large value greater such as 100, or 10000.

To configure the sequence to generate values without any gaps in the sequence,

at the expense of increased database load,

set the block size to 1.

To improve performance, and allow gaps in the sequence of values, set the block size to a value greater than 1

This causes slow performance as PhixFlow has to perform database calculations for before providing the next value in the sequence.

Tip

If you require a continuous sequence of values for items, and the data set being processed is small, you may decide to accept the added overhead of calculating every value in the sequence.

If the data set is large, it is better to use a large block size, to optimise performance. If you require a continuous sequence consider an alternative method of assigning the value.


Current Value(Readonly) The highest value already allocated.

...

.

Example: Using a Sequence

To set a stream attribute to a unique order ID:

...