Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 99c915d41970fd843a111040101594edee86e036 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
[comment encoding = UTF-8 /]
[module StateMachine('http://www.eclipse.org/uml2/4.0.0/UML')/]

[import org::eclipse::papyrus::qompass::designer::core::acceleo::EnumService/]
[import org::eclipse::papyrus::qompass::designer::core::acceleo::UMLTool/]
[import org::eclipse::papyrus::qompass::modellibs::core::acceleo::acceptableEvents/]

[template public StateMachine(clazz : BehavioredClassifier)]

// processEvents body - generated by Qompass 
//
// supports ports [if clazz.oclIsKindOf(Class)][for (port : Port | clazz.oclAsType(Class).ownedPort)] [literal('PortEnum_'+clazz.name, 'port_'+port.name)/] [/for][/if]
TRACEpr (AO);
PR ("IN [clazz.name/]::checkPreCond()" << showI);
	
[for (sm : StateMachine | ownedBehavior->select(oclIsKindOf(StateMachine)))]
core::ContainerServices::CallEvent_ event;
int timeout;
int newState;
int newSubSate;

switch(m_currentState)
{
	[for (state : State | sm.region.subvertex->select(oclIsKindOf(State)))]
	case [literal('LStateIDs_'+clazz.name, 'STATE_'+state.name)/]:
		// -------- treatment of accepted events
[state.acceptableEvents()/]
[comment		// -------- treatment of ignored events /]
[comment [state.ignoredEvents()/]
[comment		// -------- treatment of rejected events /]
[comment [state.rejectedEvent()/]
[comment		// -------- not accepted nor ignored neither rejected
		// else not acceptable event
/]
		break;
	[/for]
	
	default:
		OSAL_ERROR ("Inconsistent state");
		break;
}
if (animOut != 0) {
	animOut->enterState(newState, [clazz.fragment()/]);
}

[/for]
[/template]


[query public boundPackageRef(actual : Type) : Package =
	invoke('org.eclipse.papyrus.qompass.designer.core.acceleo.UMLTool',
		'boundPackageRef(org.eclipse.uml2.uml.Type)',
		Sequence{actual}) /]

Back to the top