question

Raashid Mohammed avatar image
0 Likes"
Raashid Mohammed asked Sam Stubbs converted comment to answer

Batch Max Value error

I have two labels type and count

type ( 1 to 5 )

count ( 100 to 200)

I have a batch which groups 3 tokens by type and releases 1 token with Max of all count values

For some reason the Max value does not work

the Sum value in label aggregation works in batch but not the Max value

Am I doing something wrong ?

Please help

See attached model

batchmaxvalue.fsm

Choose One
batch
batchmaxvalue.fsm (17.1 KiB)
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Sam Stubbs avatar image
2 Likes"
Sam Stubbs answered

Unfortunately it looks like this is a bug. I've reported it to the developers and we can work on fixing it.

In the meantime as a work around, you could use a custom code activity to store a "maxcount" label in the Process Flow that can assign that value to the token released by the batch.

Something similar to this:

if (getlabel(token,"count")>getlabel(processFlow,"maxcount"))  {
	setlabel(processFlow,"maxcount",getlabel(token,"count"));
}

Though you might need several maxcount labels, or make it an array so that it can store the max count for each item type.

Then just have each maxcount label be set back to zero after the batch token is released so that the next batch coming in can record the maxcount too.

5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.