There are many nuances in your question, but I will give you one example so you can try it out.
From StateChart to Pedestrian
From your image, what you have to add in "action" to create pedestrians when a transition occurs is:
pedSource.inject(n);
Where "n" is the number of pedestrians you want to add to the system. But since your statechart is in main and your pedestrians are in "Test" you have to do:
test.pedsource.inject(n); //if your agetn Test is unique
test.get(i).inject(n); //if your agent Test is a population, where "i" is the entity in the population that you want to affect
test must be defined in main. If Test is only an agent type, this will not work.
From Pedestrian to Statechart
Since your pedestrian is in Test, you can generate a transition in your statechart anywhere in your pedestrian blocks doing for instance
send("transitionMessage",main);
or
main.statechart.fireEvent("message");
But you need to define a statechart entry point (you haven't done that) and your agent test must be defined as a population or as a single agent in main, otherwise the communication will not be possible.
Check out the AnyLogic help documentation, it seems that you will need it a lot.
help.anylogic.com