Storyboard TTC2011HelloWorldConstantTransformation2WithReferences
A constant transformation that creates a Greeting object structure with references
Create class model and generate implementation:
The code that builds and runs the transformation / pattern looks like:
GreetingPO greetingPO = (GreetingPO) new Pattern<Pattern>() .startCreate() .has(new GreetingPO()); GreetingMessagePO greetingMessagePO = greetingPO.hasGreetingMessage() .hasText("Hello"); PersonPO personPO = greetingPO.hasPerson() .hasName("TTC Participants");
Check: Constant transformation has match true
At runtime the object structure for the pattern and for the hostgraph looks like:
For completeness just the host graph:
For fairness, the java code that does this transformation looks like:
Greeting greeting = new Greeting(); GreetingMessage greetingMessage = greeting.createGreetingMessage() .withText("Hello"); Person person = greeting.createPerson() .withName("TTC Participants");