question

Shawn Murty avatar image
0 Likes"
Shawn Murty asked Shawn Murty answered

How do I get the last character from a label?

I found code to get information about what operator was working on a specific processor.

if (gettasktype(ts, 4) == TASKTYPE_UTILIZE) {
treenode processor = gettaskinvolved(ts, 4, 2); 
setlabel(processor, "operator", current); 
}

I then attach the label FROM the processor TO the flow item.

From there I'm trying to use that information that is connected to the flow item in 'port by case' scenario in a queue, but it currently fails. Does data have to be an integer?? Could i at come point in the process grab the last character from the operator name ( i won't use more than 10 people)?

My goal is to split work completed in queues based on which operator last worked on the flowitem

queuelabelsprocessorflowitemports by label
· 1
5 |100000

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

Shawn Murty avatar image Shawn Murty commented ·

FYI, the code snippet is from the OnResourceTaskSequence of the operator. The operator is connected to a dispatcher.

0 Likes 0 ·
Joshua S avatar image
0 Likes"
Joshua S answered Joshua S edited

You can use

str.charAt(str.length).toNum()

where str is the name of your operator. This will output the last character as an int

5 |100000

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

Shawn Murty avatar image
0 Likes"
Shawn Murty answered Joerg Vogel commented

I made a label "Op" on the operator.

if (gettasktype(ts, 4) == TASKTYPE_UTILIZE) {
treenode processor = gettaskinvolved(ts, 4, 2); 
setlabel(processor, "operator", current.Op);  }
5 |100000

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