Breadcrumbs

Home » Modeling » M2T (model-to-text transformation) » [Acceleo] How to generate a sequence (bag) of consecutive integers starting at 1(Need to determine if a bag of integers retrieved from modeling elements equals the series 1, 2, 3, ...)

I hope anyone can help me. I am assigning numbers as names of input pins in an action in an activity diagram. From this collection of input pins I am successfully computing a sequence (or bag) of integers (instances of Integer). What I need to determine now is whether such sequence (or bag) equals the sequence {1, 2, 3, 4, ... , n}.

My strategy is to generate the sequence {1, 2, 3, 4, ... , n} by using an expression like