Versions Compared

Key

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

Overview

Set Use the sequence properties to set up a sequence of unique numbers that you want to allocate a unique number to an itemto records in a stream

Use the sequence properties to To create a sequence, specify a start value and how many numbers you require (the block size). PhixFlow then allocates from a block size. The block size specifies how often you go back to the database to update the number up to which you have allocated. This is referred to as the 'tidemark'. PhixFlow then allocates those numbers from the database and stores them in memory. When PhixFlow reserves a block, it marks the last reserved value in the database. 

You can then quickly assign the numbers to items using To assign a number from memory to stream records, use the nextValue function in an expression. You can also find the last assigned number using the curValue function. When all the numbers in the sequence have been used and , the next time the nextValue function is called , PhixFlow reserves the next block of numbers before assigning the next value. 

Tip

It is much quicker for PhixFlow to assign a number from memory than it is to assign a number from the database. It also takes time to reserve the next block of numbers.

Gaps in the Number Sequence

Sequence numbers are unique, but there may be gaps between sequence numbers. This depends on:

...

  1. You create a sequence with a block size of 100. It has the values 0-99.
  2. You have allocated the numbers 1 to 50 from memory.
  3. PhixFlow shuts down.
  4. On restart, PhixFlow reserves a new block from 100 to 199.
  5. PhixFlow starts issuing numbers from memory, starting with 100. 
  6. The numbers from 51 to 99 will never be issued.

...

Block Size and Performance 
Anchor
block
block

Use the block size to specify the range of values in the sequence. The block size affects PhixFlow performance.

...

Tip

We recommend you set a large block size, to optimise performance.

If you require a continuous sequence of values for items:

  • in a small stream set, you may want to accept the overhead of calculating assigning every value in the sequence from the database. In this case, set the Block Size to 1.
  • in larger stream sets, consider an  an alternative method of assigning the value.

Sequence Properties

To create a sequence, in the repository, right-click Sequences and click 

Insert excerpt
_add
_add
nopaneltrue
.

Insert excerpt
_standard_settings
_standard_settings
nopaneltrue

Basic Settings

FieldDescription
NameEnter the name of the sequence.
Start ValueEnter the first value in the sequence.
Block Size

Enter a number

for

to set the size of the sequence of numbers. This will depend on the

size

number of records in the stream

sets

set to which you are allocating unique numbers. For example, if the stream set has 10,000

data

records, the block size should be at least 10,000.

Note

Sequences provide unique numbers, but they the numbers may not always be contiguous.

Block size has an effect on performance; see

The Effect of
Current ValuePhixFlow displays the highest value already allocated.

Example: Using a Sequence

To set a stream attribute to a unique order ID:

  1. Create a

...

  1. sequence and set its Name to order_id

...

  1. .
  2. Create a

...

  1. stream with an Integer attribute.

  2. Set its attribute expression to: 

...

  1.   nextValue('order_id')

  2. Every time a new record is generated in this stream, nextValue will return a new unique value for the attribute.