diff --git a/com.incquerylabs.emdw.cpp.transformation/src/com/incquerylabs/emdw/cpp/transformation/queries/xtumlQueries.eiq b/com.incquerylabs.emdw.cpp.transformation/src/com/incquerylabs/emdw/cpp/transformation/queries/xtumlQueries.eiq index 6cc33a86..0dfde7f7 100644 --- a/com.incquerylabs.emdw.cpp.transformation/src/com/incquerylabs/emdw/cpp/transformation/queries/xtumlQueries.eiq +++ b/com.incquerylabs.emdw.cpp.transformation/src/com/incquerylabs/emdw/cpp/transformation/queries/xtumlQueries.eiq @@ -72,7 +72,8 @@ pattern classStateMachineTransitions( transition : Transition ) { find classStateMachineStates(xtClass, cppClass, state); - CompositeState.transitions(state, transition); + CompositeState.substates(compState, state); + CompositeState.transitions(compState, transition); } pattern classStateMachineEvents( diff --git a/tests/Dummy_StateMachine/Test_FSM/Main_Package/Test_Component/TEST.cc b/tests/Dummy_StateMachine/Test_FSM/Main_Package/Test_Component/TEST.cc index 1860a7fb..dfae55d9 100644 --- a/tests/Dummy_StateMachine/Test_FSM/Main_Package/Test_Component/TEST.cc +++ b/tests/Dummy_StateMachine/Test_FSM/Main_Package/Test_Component/TEST.cc @@ -21,17 +21,17 @@ using namespace std; #include "Test_FSM/Main_Package/Test_Component/Test_Component_def.hh" -using namespace ::Test_FSM::Main_Package::Test_Component::Test_Package; +// GENERATED CODE START // Constructor -TEST::TEST(): current_state(TEST_STATE_INIT) { +::Test_FSM::Main_Package::Test_Component::Test_Package::TEST::TEST(): current_state(TEST_STATE_INIT) { } // Destructor -TEST::~TEST() { +::Test_FSM::Main_Package::Test_Component::Test_Package::TEST::~TEST() { } -void TEST::processEvent(int eventId, std::string eventContent) { +void ::Test_FSM::Main_Package::Test_Component::Test_Package::TEST::processEvent(int eventId, std::string eventContent) { cout << "[TEST] Event " << eventId << " received with content: " << eventContent << endl; switch(current_state){ @@ -42,13 +42,14 @@ void TEST::processEvent(int eventId, std::string eventContent) { processEventInWorkingState(eventId, eventContent); break; } + } -void TEST::performEntryActionForInitState(int eventId, std::string eventContent) { +void ::Test_FSM::Main_Package::Test_Component::Test_Package::TEST::performEntryActionForInitState(int eventId, std::string eventContent) { cout << " [Entry: INIT]" << endl; } -void TEST::processEventInInitState(int eventId, std::string eventContent) { +void ::Test_FSM::Main_Package::Test_Component::Test_Package::TEST::processEventInInitState(int eventId, std::string eventContent) { cout << " [State: INIT] Processing event" << endl; // Init -WORK-> Work transition @@ -78,7 +79,7 @@ void TEST::processEventInInitState(int eventId, std::string eventContent) { return; } -bool TEST::evaluateGuardOnInitToWorkingTransition(int eventId, std::string eventContent) { +bool ::Test_FSM::Main_Package::Test_Component::Test_Package::TEST::evaluateGuardOnInitToWorkingTransition(int eventId, std::string eventContent) { if(eventContent == "valid") { return true; } else { @@ -87,19 +88,19 @@ bool TEST::evaluateGuardOnInitToWorkingTransition(int eventId, std::string event } } -void TEST::performActionsOnInitToInitTransition(int eventId, std::string eventContent) { +void ::Test_FSM::Main_Package::Test_Component::Test_Package::TEST::performActionsOnInitToInitTransition(int eventId, std::string eventContent) { cout << " [Action]" << endl; } -void TEST::performExitActionForInitState(int eventId, std::string eventContent) { +void ::Test_FSM::Main_Package::Test_Component::Test_Package::TEST::performExitActionForInitState(int eventId, std::string eventContent) { cout << " [Exit]" << endl; } -void TEST::performEntryActionForWorkingState(int eventId, std::string eventContent) { +void ::Test_FSM::Main_Package::Test_Component::Test_Package::TEST::performEntryActionForWorkingState(int eventId, std::string eventContent) { cout << " [Entry: WORKING]" << endl; } -void TEST::processEventInWorkingState(int eventId, std::string eventContent) { +void ::Test_FSM::Main_Package::Test_Component::Test_Package::TEST::processEventInWorkingState(int eventId, std::string eventContent) { cout << " [State: WORKING] Processing event" << endl; // Working -DONE-> Init transition @@ -126,14 +127,16 @@ void TEST::processEventInWorkingState(int eventId, std::string eventContent) { return; } -void TEST::performActionsOnWorkingToWorkingTransition(int eventId, std::string eventContent) { +void ::Test_FSM::Main_Package::Test_Component::Test_Package::TEST::performActionsOnWorkingToWorkingTransition(int eventId, std::string eventContent) { cout << " [Action]" << endl; } -void TEST::performExitActionForWorkingState(int eventId, std::string eventContent) { +void ::Test_FSM::Main_Package::Test_Component::Test_Package::TEST::performExitActionForWorkingState(int eventId, std::string eventContent) { cout << " [Exit]" << endl; } -void TEST::generateEvent(int eventId, std::string eventContent) { +void ::Test_FSM::Main_Package::Test_Component::Test_Package::TEST::generateEvent(int eventId, std::string eventContent) { cout << " [Generate] Event " << eventId << " generated with content: " << eventContent << endl; } + +// GENERATED CODE END diff --git a/tests/Dummy_StateMachine/Test_FSM/Main_Package/Test_Component/TEST.hh b/tests/Dummy_StateMachine/Test_FSM/Main_Package/Test_Component/TEST.hh index 580db28a..e739b10f 100644 --- a/tests/Dummy_StateMachine/Test_FSM/Main_Package/Test_Component/TEST.hh +++ b/tests/Dummy_StateMachine/Test_FSM/Main_Package/Test_Component/TEST.hh @@ -35,6 +35,9 @@ namespace Test_FSM { namespace Main_Package { namespace Test_Component { namespace Test_Package { + + // GENERATED CODE START + class TEST { public: enum TEST_state {TEST_STATE_INIT, TEST_STATE_WORKING}; @@ -78,8 +81,9 @@ namespace Test_FSM { // State machine void generateEvent(int eventId, std::string eventContent); - }; + + // GENERATED CODE END } } }