flat file structure in Talend data mapper

Five Stars

flat file structure in Talend data mapper

I'm trying to create structure of flat file having single single line data. Like given below
To see the actual records I can split for better understanding
AA1000BB         Header Record 1
10123456         Group 1 Record 1
20123456         Group 1 Record 2  optional
30123456         Group 1 Record 3  mandatory
10123456         Group 2 Record 1
30123456         Group 2 Record 2
AA2000BB        Trailer
Record starting from 10 and 30 are mandatory and starting from 20 is optional
Every kind of record is having 8 characters.
So I have created structure like this:
Header   with min and max size 8
Loop-Records (1.*)
  10    Occurrence MIN and MAX 1
  20    Occurrence MIN 0 and MAX 1 
  30    Occurrence MIN 1 and MAX 1
Trailer    Occurrence MIN 1 and MAX 1
But its not working...Am I doing right ?
Getting error like this
Error - None of the rules (shown below) of where to go next after this element were satisfied. Check to see that the rules are correct. If you are in the designer, use the "Show Rules" button to see all of the rules (817)
One Star

Re: flat file structure in Talend data mapper

The message you get means the structure you created doesn't match the file structure.
I created one that match the file structure:

You will find it enclosed.