text: #include "uml/impl/SequenceNodeImpl.hpp"
  
  #ifdef NDEBUG
  	#define DEBUG_MESSAGE(a) /**/
  #else
  	#define DEBUG_MESSAGE(a) a
  #endif
  
  #ifdef ACTIVITY_DEBUG_ON
      #define ACT_DEBUG(a) a
  #else
      #define ACT_DEBUG(a) /**/
  #endif
  
  //#include "util/ProfileCallCount.hpp"
  
  #include <cassert>
  #include <iostream>
  #include <sstream>
  #include "abstractDataTypes/Bag.hpp"
  #include "abstractDataTypes/Subset.hpp"
  #include "abstractDataTypes/SubsetUnion.hpp"
  #include "abstractDataTypes/Union.hpp"
  #include "abstractDataTypes/SubsetUnion.hpp"
  #include "ecore/EAnnotation.hpp"
  #include "ecore/EClass.hpp"
  
  //Includes from codegen annotation
  
  //Forward declaration includes
  #include "persistence/interfaces/XLoadHandler.hpp" // used for Persistence
  #include "persistence/interfaces/XSaveHandler.hpp" // used for Persistence
  
  #include <exception> // used in Persistence
  
  #include "uml/Activity.hpp"
  
  #include "uml/ActivityEdge.hpp"
  
  #include "uml/ActivityGroup.hpp"
  
  #include "uml/ActivityNode.hpp"
  
  #include "uml/ActivityPartition.hpp"
  
  #include "uml/Classifier.hpp"
  
  #include "uml/Comment.hpp"
  
  #include "uml/Constraint.hpp"
  
  #include "uml/Dependency.hpp"
  
  #include "uml/Element.hpp"
  
  #include "uml/ElementImport.hpp"
  
  #include "uml/ExceptionHandler.hpp"
  
  #include "uml/ExecutableNode.hpp"
  
  #include "uml/InputPin.hpp"
  
  #include "uml/InterruptibleActivityRegion.hpp"
  
  #include "uml/NamedElement.hpp"
  
  #include "uml/Namespace.hpp"
  
  #include "uml/OutputPin.hpp"
  
  #include "uml/PackageImport.hpp"
  
  #include "uml/PackageableElement.hpp"
  
  #include "uml/RedefinableElement.hpp"
  
  #include "uml/StringExpression.hpp"
  
  #include "uml/StructuredActivityNode.hpp"
  
  #include "uml/Variable.hpp"
  
  //Factories an Package includes
  #include "uml/impl/umlFactoryImpl.hpp"
  #include "uml/impl/umlPackageImpl.hpp"
  
  
  #include "ecore/EAttribute.hpp"
  #include "ecore/EStructuralFeature.hpp"
  
  using namespace uml;
  
  //*********************************
  // Constructor / Destructor
  //*********************************
  SequenceNodeImpl::SequenceNodeImpl()
  {	
  }
  
  SequenceNodeImpl::~SequenceNodeImpl()
  {
  #ifdef SHOW_DELETION
  	std::cout << "-------------------------------------------------------------------------------------------------\r\ndelete SequenceNode "<< this << "\r\n------------------------------------------------------------------------ " << std::endl;
  #endif
  }
  
  //Additional constructor for the containments back reference
  SequenceNodeImpl::SequenceNodeImpl(std::weak_ptr<uml::Activity > par_Activity, const int reference_id)
  :SequenceNodeImpl()
  {
  	switch(reference_id)
  	{	
  	case umlPackage::ACTIVITYNODE_ATTRIBUTE_ACTIVITY:
  		m_activity = par_Activity;
  		m_owner = par_Activity;
  		 return;
  	case umlPackage::ACTIVITYGROUP_ATTRIBUTE_INACTIVITY:
  		m_inActivity = par_Activity;
  		m_owner = par_Activity;
  		 return;
  	default:
  	std::cerr << __PRETTY_FUNCTION__ <<" Reference not found in class with the given ID" << std::endl;
  	}
     
  }
  
  
  //Additional constructor for the containments back reference
  SequenceNodeImpl::SequenceNodeImpl(std::weak_ptr<uml::StructuredActivityNode > par_inStructuredNode)
  :SequenceNodeImpl()
  {
  	m_inStructuredNode = par_inStructuredNode;
  	m_owner = par_inStructuredNode;
  }
  
  //Additional constructor for the containments back reference
  SequenceNodeImpl::SequenceNodeImpl(std::weak_ptr<uml::Namespace > par_namespace)
  :SequenceNodeImpl()
  {
  	m_namespace = par_namespace;
  	m_owner = par_namespace;
  }
  
  //Additional constructor for the containments back reference
  SequenceNodeImpl::SequenceNodeImpl(std::weak_ptr<uml::Element > par_owner)
  :SequenceNodeImpl()
  {
  	m_owner = par_owner;
  }
  
  //Additional constructor for the containments back reference
  SequenceNodeImpl::SequenceNodeImpl(std::weak_ptr<uml::ActivityGroup > par_superGroup)
  :SequenceNodeImpl()
  {
  	m_superGroup = par_superGroup;
  	m_owner = par_superGroup;
  }
  
  
  SequenceNodeImpl::SequenceNodeImpl(const SequenceNodeImpl & obj):SequenceNodeImpl()
  {
  	//create copy of all Attributes
  	#ifdef SHOW_COPIES
  	std::cout << "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r\ncopy SequenceNode "<< this << "\r\n+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ " << std::endl;
  	#endif
  	m_isLeaf = obj.getIsLeaf();
  	m_isLocallyReentrant = obj.getIsLocallyReentrant();
  	m_mustIsolate = obj.getMustIsolate();
  	m_name = obj.getName();
  	m_qualifiedName = obj.getQualifiedName();
  	m_visibility = obj.getVisibility();
  
  	//copy references with no containment (soft copy)
  	
  	m_activity  = obj.getActivity();
  
  	std::shared_ptr<Bag<uml::Dependency>> _clientDependency = obj.getClientDependency();
  	m_clientDependency.reset(new Bag<uml::Dependency>(*(obj.getClientDependency().get())));
  
  	std::shared_ptr<Union<uml::ActivityEdge>> _containedEdge = obj.getContainedEdge();
  	m_containedEdge.reset(new Union<uml::ActivityEdge>(*(obj.getContainedEdge().get())));
  
  	std::shared_ptr<Union<uml::ActivityNode>> _containedNode = obj.getContainedNode();
  	m_containedNode.reset(new Union<uml::ActivityNode>(*(obj.getContainedNode().get())));
  
  	m_context  = obj.getContext();
  
  	m_inActivity  = obj.getInActivity();
  
  	std::shared_ptr<Union<uml::ActivityGroup>> _inGroup = obj.getInGroup();
  	m_inGroup.reset(new Union<uml::ActivityGroup>(*(obj.getInGroup().get())));
  
  	m_inStructuredNode  = obj.getInStructuredNode();
  
  	std::shared_ptr<Bag<uml::ActivityEdge>> _incoming = obj.getIncoming();
  	m_incoming.reset(new Bag<uml::ActivityEdge>(*(obj.getIncoming().get())));
  
  	std::shared_ptr<Union<uml::NamedElement>> _member = obj.getMember();
  	m_member.reset(new Union<uml::NamedElement>(*(obj.getMember().get())));
  
  	m_namespace  = obj.getNamespace();
  
  	std::shared_ptr<Bag<uml::ActivityEdge>> _outgoing = obj.getOutgoing();
  	m_outgoing.reset(new Bag<uml::ActivityEdge>(*(obj.getOutgoing().get())));
  
  	m_owner  = obj.getOwner();
  
  	std::shared_ptr<Union<uml::RedefinableElement>> _redefinedElement = obj.getRedefinedElement();
  	m_redefinedElement.reset(new Union<uml::RedefinableElement>(*(obj.getRedefinedElement().get())));
  
  	std::shared_ptr<Union<uml::Classifier>> _redefinitionContext = obj.getRedefinitionContext();
  	m_redefinitionContext.reset(new Union<uml::Classifier>(*(obj.getRedefinitionContext().get())));
  
  	m_superGroup  = obj.getSuperGroup();
  
  
  	//Clone references with containment (deep copy)
  
  	std::shared_ptr<Bag<uml::ActivityEdge>> _edgeList = obj.getEdge();
  	for(std::shared_ptr<uml::ActivityEdge> _edge : *_edgeList)
  	{
  		this->getEdge()->add(std::shared_ptr<uml::ActivityEdge>(std::dynamic_pointer_cast<uml::ActivityEdge>(_edge->copy())));
  	}
  	#ifdef SHOW_SUBSET_UNION
  		std::cout << "Copying the Subset: " << "m_edge" << std::endl;
  	#endif
  	std::shared_ptr<Bag<uml::ElementImport>> _elementImportList = obj.getElementImport();
  	for(std::shared_ptr<uml::ElementImport> _elementImport : *_elementImportList)
  	{
  		this->getElementImport()->add(std::shared_ptr<uml::ElementImport>(std::dynamic_pointer_cast<uml::ElementImport>(_elementImport->copy())));
  	}
  	#ifdef SHOW_SUBSET_UNION
  		std::cout << "Copying the Subset: " << "m_elementImport" << std::endl;
  	#endif
  	std::shared_ptr<Bag<uml::ExecutableNode>> _executableNodeList = obj.getExecutableNode();
  	for(std::shared_ptr<uml::ExecutableNode> _executableNode : *_executableNodeList)
  	{
  		this->getExecutableNode()->add(std::shared_ptr<uml::ExecutableNode>(std::dynamic_pointer_cast<uml::ExecutableNode>(_executableNode->copy())));
  	}
  	#ifdef SHOW_SUBSET_UNION
  		std::cout << "Copying the Subset: " << "m_executableNode" << std::endl;
  	#endif
  	std::shared_ptr<Bag<uml::ExceptionHandler>> _handlerList = obj.getHandler();
  	for(std::shared_ptr<uml::ExceptionHandler> _handler : *_handlerList)
  	{
  		this->getHandler()->add(std::shared_ptr<uml::ExceptionHandler>(std::dynamic_pointer_cast<uml::ExceptionHandler>(_handler->copy())));
  	}
  	#ifdef SHOW_SUBSET_UNION
  		std::cout << "Copying the Subset: " << "m_handler" << std::endl;
  	#endif
  	std::shared_ptr<Bag<uml::PackageableElement>> _importedMemberList = obj.getImportedMember();
  	for(std::shared_ptr<uml::PackageableElement> _importedMember : *_importedMemberList)
  	{
  		this->getImportedMember()->add(std::shared_ptr<uml::PackageableElement>(std::dynamic_pointer_cast<uml::PackageableElement>(_importedMember->copy())));
  	}
  	#ifdef SHOW_SUBSET_UNION
  		std::cout << "Copying the Subset: " << "m_importedMember" << std::endl;
  	#endif
  	std::shared_ptr<Bag<uml::InterruptibleActivityRegion>> _inInterruptibleRegionList = obj.getInInterruptibleRegion();
  	for(std::shared_ptr<uml::InterruptibleActivityRegion> _inInterruptibleRegion : *_inInterruptibleRegionList)
  	{
  		this->getInInterruptibleRegion()->add(std::shared_ptr<uml::InterruptibleActivityRegion>(std::dynamic_pointer_cast<uml::InterruptibleActivityRegion>(_inInterruptibleRegion->copy())));
  	}
  	#ifdef SHOW_SUBSET_UNION
  		std::cout << "Copying the Subset: " << "m_inInterruptibleRegion" << std::endl;
  	#endif
  	std::shared_ptr<Bag<uml::ActivityPartition>> _inPartitionList = obj.getInPartition();
  	for(std::shared_ptr<uml::ActivityPartition> _inPartition : *_inPartitionList)
  	{
  		this->getInPartition()->add(std::shared_ptr<uml::ActivityPartition>(std::dynamic_pointer_cast<uml::ActivityPartition>(_inPartition->copy())));
  	}
  	#ifdef SHOW_SUBSET_UNION
  		std::cout << "Copying the Subset: " << "m_inPartition" << std::endl;
  	#endif
  	std::shared_ptr<Bag<uml::Constraint>> _localPostconditionList = obj.getLocalPostcondition();
  	for(std::shared_ptr<uml::Constraint> _localPostcondition : *_localPostconditionList)
  	{
  		this->getLocalPostcondition()->add(std::shared_ptr<uml::Constraint>(std::dynamic_pointer_cast<uml::Constraint>(_localPostcondition->copy())));
  	}
  	#ifdef SHOW_SUBSET_UNION
  		std::cout << "Copying the Subset: " << "m_localPostcondition" << std::endl;
  	#endif
  	std::shared_ptr<Bag<uml::Constraint>> _localPreconditionList = obj.getLocalPrecondition();
  	for(std::shared_ptr<uml::Constraint> _localPrecondition : *_localPreconditionList)
  	{
  		this->getLocalPrecondition()->add(std::shared_ptr<uml::Constraint>(std::dynamic_pointer_cast<uml::Constraint>(_localPrecondition->copy())));
  	}
  	#ifdef SHOW_SUBSET_UNION
  		std::cout << "Copying the Subset: " << "m_localPrecondition" << std::endl;
  	#endif
  	if(obj.getNameExpression()!=nullptr)
  	{
  		m_nameExpression = std::dynamic_pointer_cast<uml::StringExpression>(obj.getNameExpression()->copy());
  	}
  	#ifdef SHOW_SUBSET_UNION
  		std::cout << "Copying the Subset: " << "m_nameExpression" << std::endl;
  	#endif
  	std::shared_ptr<Bag<uml::ActivityNode>> _nodeList = obj.getNode();
  	for(std::shared_ptr<uml::ActivityNode> _node : *_nodeList)
  	{
  		this->getNode()->add(std::shared_ptr<uml::ActivityNode>(std::dynamic_pointer_cast<uml::ActivityNode>(_node->copy())));
  	}
  	#ifdef SHOW_SUBSET_UNION
  		std::cout << "Copying the Subset: " << "m_node" << std::endl;
  	#endif
  	std::shared_ptr<Bag<uml::Comment>> _ownedCommentList = obj.getOwnedComment();
  	for(std::shared_ptr<uml::Comment> _ownedComment : *_ownedCommentList)
  	{
  		this->getOwnedComment()->add(std::shared_ptr<uml::Comment>(std::dynamic_pointer_cast<uml::Comment>(_ownedComment->copy())));
  	}
  	#ifdef SHOW_SUBSET_UNION
  		std::cout << "Copying the Subset: " << "m_ownedComment" << std::endl;
  	#endif
  	std::shared_ptr<Bag<uml::Constraint>> _ownedRuleList = obj.getOwnedRule();
  	for(std::shared_ptr<uml::Constraint> _ownedRule : *_ownedRuleList)
  	{
  		this->getOwnedRule()->add(std::shared_ptr<uml::Constraint>(std::dynamic_pointer_cast<uml::Constraint>(_ownedRule->copy())));
  	}
  	#ifdef SHOW_SUBSET_UNION
  		std::cout << "Copying the Subset: " << "m_ownedRule" << std::endl;
  	#endif
  	std::shared_ptr<Bag<uml::PackageImport>> _packageImportList = obj.getPackageImport();
  	for(std::shared_ptr<uml::PackageImport> _packageImport : *_packageImportList)
  	{
  		this->getPackageImport()->add(std::shared_ptr<uml::PackageImport>(std::dynamic_pointer_cast<uml::PackageImport>(_packageImport->copy())));
  	}
  	#ifdef SHOW_SUBSET_UNION
  		std::cout << "Copying the Subset: " << "m_packageImport" << std::endl;
  	#endif
  	std::shared_ptr<Bag<uml::ActivityNode>> _redefinedNodeList = obj.getRedefinedNode();
  	for(std::shared_ptr<uml::ActivityNode> _redefinedNode : *_redefinedNodeList)
  	{
  		this->getRedefinedNode()->add(std::shared_ptr<uml::ActivityNode>(std::dynamic_pointer_cast<uml::ActivityNode>(_redefinedNode->copy())));
  	}
  	#ifdef SHOW_SUBSET_UNION
  		std::cout << "Copying the Subset: " << "m_redefinedNode" << std::endl;
  	#endif
  	std::shared_ptr<Bag<uml::InputPin>> _structuredNodeInputList = obj.getStructuredNodeInput();
  	for(std::shared_ptr<uml::InputPin> _structuredNodeInput : *_structuredNodeInputList)
  	{
  		this->getStructuredNodeInput()->add(std::shared_ptr<uml::InputPin>(std::dynamic_pointer_cast<uml::InputPin>(_structuredNodeInput->copy())));
  	}
  	#ifdef SHOW_SUBSET_UNION
  		std::cout << "Copying the Subset: " << "m_structuredNodeInput" << std::endl;
  	#endif
  	std::shared_ptr<Bag<uml::OutputPin>> _structuredNodeOutputList = obj.getStructuredNodeOutput();
  	for(std::shared_ptr<uml::OutputPin> _structuredNodeOutput : *_structuredNodeOutputList)
  	{
  		this->getStructuredNodeOutput()->add(std::shared_ptr<uml::OutputPin>(std::dynamic_pointer_cast<uml::OutputPin>(_structuredNodeOutput->copy())));
  	}
  	#ifdef SHOW_SUBSET_UNION
  		std::cout << "Copying the Subset: " << "m_structuredNodeOutput" << std::endl;
  	#endif
  	std::shared_ptr<Bag<uml::Variable>> _variableList = obj.getVariable();
  	for(std::shared_ptr<uml::Variable> _variable : *_variableList)
  	{
  		this->getVariable()->add(std::shared_ptr<uml::Variable>(std::dynamic_pointer_cast<uml::Variable>(_variable->copy())));
  	}
  	#ifdef SHOW_SUBSET_UNION
  		std::cout << "Copying the Subset: " << "m_variable" << std::endl;
  	#endif
  
  	
  }
  
  std::shared_ptr<ecore::EObject>  SequenceNodeImpl::copy() const
  {
  	std::shared_ptr<SequenceNodeImpl> element(new SequenceNodeImpl(*this));
  	element->setThisSequenceNodePtr(element);
  	return element;
  }
  
  std::shared_ptr<ecore::EClass> SequenceNodeImpl::eStaticClass() const
  {
  	return uml::umlPackage::eInstance()->getSequenceNode_Class();
  }
  
  //*********************************
  // Attribute Setter Getter
  //*********************************
  
  //*********************************
  // Operations
  //*********************************
  
  //*********************************
  // References
  //*********************************
  /*
  Getter & Setter for reference executableNode
  */
  std::shared_ptr<Bag<uml::ExecutableNode>> SequenceNodeImpl::getExecutableNode() const
  {
  	if(m_executableNode == nullptr)
  	{
  		m_executableNode.reset(new Bag<uml::ExecutableNode>());
  		
  		
  	}
  
      return m_executableNode;
  }
  
  
  
  /*Additional Setter for redefined reference 'StructuredActivityNode::node'*/
  
  
  
  //*********************************
  // Union Getter
  //*********************************
  std::shared_ptr<Union<uml::ActivityEdge>> SequenceNodeImpl::getContainedEdge() const
  {
  	if(m_containedEdge == nullptr)
  	{
  		/*Union*/
  		m_containedEdge.reset(new Union<uml::ActivityEdge>());
  			#ifdef SHOW_SUBSET_UNION
  			std::cout << "Initialising Union: " << "m_containedEdge - Union<uml::ActivityEdge>()" << std::endl;
  		#endif
  		
  		
  	}
  	return m_containedEdge;
  }
  
  std::shared_ptr<Union<uml::ActivityNode>> SequenceNodeImpl::getContainedNode() const
  {
  	if(m_containedNode == nullptr)
  	{
  		/*Union*/
  		m_containedNode.reset(new Union<uml::ActivityNode>());
  			#ifdef SHOW_SUBSET_UNION
  			std::cout << "Initialising Union: " << "m_containedNode - Union<uml::ActivityNode>()" << std::endl;
  		#endif
  		
  		
  	}
  	return m_containedNode;
  }
  
  std::shared_ptr<Union<uml::ActivityGroup>> SequenceNodeImpl::getInGroup() const
  {
  	if(m_inGroup == nullptr)
  	{
  		/*Union*/
  		m_inGroup.reset(new Union<uml::ActivityGroup>());
  			#ifdef SHOW_SUBSET_UNION
  			std::cout << "Initialising Union: " << "m_inGroup - Union<uml::ActivityGroup>()" << std::endl;
  		#endif
  		
  		
  	}
  	return m_inGroup;
  }
  
  std::shared_ptr<SubsetUnion<uml::InputPin, uml::Element>> SequenceNodeImpl::getInput() const
  {
  	if(m_input == nullptr)
  	{
  		/*SubsetUnion*/
  		m_input.reset(new SubsetUnion<uml::InputPin, uml::Element >());
  		#ifdef SHOW_SUBSET_UNION
  			std::cout << "Initialising shared pointer SubsetUnion: " << "m_input - SubsetUnion<uml::InputPin, uml::Element >()" << std::endl;
  		#endif
  		
  		/*SubsetUnion*/
  		m_input->initSubsetUnion(getOwnedElement());
  		#ifdef SHOW_SUBSET_UNION
  			std::cout << "Initialising value SubsetUnion: " << "m_input - SubsetUnion<uml::InputPin, uml::Element >(getOwnedElement())" << std::endl;
  		#endif
  		
  	}
  	return m_input;
  }
  
  std::shared_ptr<Union<uml::NamedElement>> SequenceNodeImpl::getMember() const
  {
  	if(m_member == nullptr)
  	{
  		/*Union*/
  		m_member.reset(new Union<uml::NamedElement>());
  			#ifdef SHOW_SUBSET_UNION
  			std::cout << "Initialising Union: " << "m_member - Union<uml::NamedElement>()" << std::endl;
  		#endif
  		
  		
  	}
  	return m_member;
  }
  
  std::shared_ptr<SubsetUnion<uml::OutputPin, uml::Element>> SequenceNodeImpl::getOutput() const
  {
  	if(m_output == nullptr)
  	{
  		/*SubsetUnion*/
  		m_output.reset(new SubsetUnion<uml::OutputPin, uml::Element >());
  		#ifdef SHOW_SUBSET_UNION
  			std::cout << "Initialising shared pointer SubsetUnion: " << "m_output - SubsetUnion<uml::OutputPin, uml::Element >()" << std::endl;
  		#endif
  		
  		/*SubsetUnion*/
  		m_output->initSubsetUnion(getOwnedElement());
  		#ifdef SHOW_SUBSET_UNION
  			std::cout << "Initialising value SubsetUnion: " << "m_output - SubsetUnion<uml::OutputPin, uml::Element >(getOwnedElement())" << std::endl;
  		#endif
  		
  	}
  	return m_output;
  }
  
  std::shared_ptr<Union<uml::Element>> SequenceNodeImpl::getOwnedElement() const
  {
  	if(m_ownedElement == nullptr)
  	{
  		/*Union*/
  		m_ownedElement.reset(new Union<uml::Element>());
  			#ifdef SHOW_SUBSET_UNION
  			std::cout << "Initialising Union: " << "m_ownedElement - Union<uml::Element>()" << std::endl;
  		#endif
  		
  		
  	}
  	return m_ownedElement;
  }
  
  std::shared_ptr<SubsetUnion<uml::NamedElement, uml::Element,uml::NamedElement>> SequenceNodeImpl::getOwnedMember() const
  {
  	if(m_ownedMember == nullptr)
  	{
  		/*SubsetUnion*/
  		m_ownedMember.reset(new SubsetUnion<uml::NamedElement, uml::Element,uml::NamedElement >());
  		#ifdef SHOW_SUBSET_UNION
  			std::cout << "Initialising shared pointer SubsetUnion: " << "m_ownedMember - SubsetUnion<uml::NamedElement, uml::Element,uml::NamedElement >()" << std::endl;
  		#endif
  		
  		/*SubsetUnion*/
  		m_ownedMember->initSubsetUnion(getOwnedElement(),getMember());
  		#ifdef SHOW_SUBSET_UNION
  			std::cout << "Initialising value SubsetUnion: " << "m_ownedMember - SubsetUnion<uml::NamedElement, uml::Element,uml::NamedElement >(getOwnedElement(),getMember())" << std::endl;
  		#endif
  		
  	}
  	return m_ownedMember;
  }
  
  std::weak_ptr<uml::Element > SequenceNodeImpl::getOwner() const
  {
  	return m_owner;
  }
  
  std::shared_ptr<Union<uml::RedefinableElement>> SequenceNodeImpl::getRedefinedElement() const
  {
  	if(m_redefinedElement == nullptr)
  	{
  		/*Union*/
  		m_redefinedElement.reset(new Union<uml::RedefinableElement>());
  			#ifdef SHOW_SUBSET_UNION
  			std::cout << "Initialising Union: " << "m_redefinedElement - Union<uml::RedefinableElement>()" << std::endl;
  		#endif
  		
  		
  	}
  	return m_redefinedElement;
  }
  
  
  
  
  std::shared_ptr<SequenceNode> SequenceNodeImpl::getThisSequenceNodePtr() const
  {
  	return m_thisSequenceNodePtr.lock();
  }
  void SequenceNodeImpl::setThisSequenceNodePtr(std::weak_ptr<SequenceNode> thisSequenceNodePtr)
  {
  	m_thisSequenceNodePtr = thisSequenceNodePtr;
  	setThisStructuredActivityNodePtr(thisSequenceNodePtr);
  }
  std::shared_ptr<ecore::EObject> SequenceNodeImpl::eContainer() const
  {
  	if(auto wp = m_activity.lock())
  	{
  		return wp;
  	}
  	if(auto wp = m_inActivity.lock())
  	{
  		return wp;
  	}
  
  
  	if(auto wp = m_inStructuredNode.lock())
  	{
  		return wp;
  	}
  
  	if(auto wp = m_namespace.lock())
  	{
  		return wp;
  	}
  
  	if(auto wp = m_owner.lock())
  	{
  		return wp;
  	}
  
  	if(auto wp = m_superGroup.lock())
  	{
  		return wp;
  	}
  	return nullptr;
  }
  
  //*********************************
  // Structural Feature Getter/Setter
  //*********************************
  Any SequenceNodeImpl::eGet(int featureID, bool resolve, bool coreType) const
  {
  	switch(featureID)
  	{
  		case uml::umlPackage::SEQUENCENODE_ATTRIBUTE_EXECUTABLENODE:
  		{
  			std::shared_ptr<Bag<ecore::EObject>> tempList(new Bag<ecore::EObject>());
  			Bag<uml::ExecutableNode>::iterator iter = m_executableNode->begin();
  			Bag<uml::ExecutableNode>::iterator end = m_executableNode->end();
  			while (iter != end)
  			{
  				tempList->add(*iter);
  				iter++;
  			}
  			return eAny(tempList); //21444
  		}
  	}
  	return StructuredActivityNodeImpl::eGet(featureID, resolve, coreType);
  }
  bool SequenceNodeImpl::internalEIsSet(int featureID) const
  {
  	switch(featureID)
  	{
  		case uml::umlPackage::SEQUENCENODE_ATTRIBUTE_EXECUTABLENODE:
  			return getExecutableNode() != nullptr; //21444
  	}
  	return StructuredActivityNodeImpl::internalEIsSet(featureID);
  }
  bool SequenceNodeImpl::eSet(int featureID, Any newValue)
  {
  	switch(featureID)
  	{
  		case uml::umlPackage::SEQUENCENODE_ATTRIBUTE_EXECUTABLENODE:
  		{
  			// BOOST CAST
  			std::shared_ptr<Bag<ecore::EObject>> tempObjectList = newValue->get<std::shared_ptr<Bag<ecore::EObject>>>();
  			std::shared_ptr<Bag<uml::ExecutableNode>> executableNodeList(new Bag<uml::ExecutableNode>());
  			Bag<ecore::EObject>::iterator iter = tempObjectList->begin();
  			Bag<ecore::EObject>::iterator end = tempObjectList->end();
  			while (iter != end)
  			{
  				executableNodeList->add(std::dynamic_pointer_cast<uml::ExecutableNode>(*iter));
  				iter++;
  			}
  			
  			Bag<uml::ExecutableNode>::iterator iterExecutableNode = m_executableNode->begin();
  			Bag<uml::ExecutableNode>::iterator endExecutableNode = m_executableNode->end();
  			while (iterExecutableNode != endExecutableNode)
  			{
  				if (executableNodeList->find(*iterExecutableNode) == -1)
  				{
  					m_executableNode->erase(*iterExecutableNode);
  				}
  				iterExecutableNode++;
  			}
  
  			iterExecutableNode = executableNodeList->begin();
  			endExecutableNode = executableNodeList->end();
  			while (iterExecutableNode != endExecutableNode)
  			{
  				if (m_executableNode->find(*iterExecutableNode) == -1)
  				{
  					m_executableNode->add(*iterExecutableNode);
  				}
  				iterExecutableNode++;			
  			}
  			return true;
  		}
  	}
  
  	return StructuredActivityNodeImpl::eSet(featureID, newValue);
  }
  
  //*********************************
  // Persistence Functions
  //*********************************
  void SequenceNodeImpl::load(std::shared_ptr<persistence::interfaces::XLoadHandler> loadHandler)
  {
  	std::map<std::string, std::string> attr_list = loadHandler->getAttributeList();
  	loadAttributes(loadHandler, attr_list);
  
  	//
  	// Create new objects (from references (containment == true))
  	//
  	// get umlFactory
  	int numNodes = loadHandler->getNumOfChildNodes();
  	for(int ii = 0; ii < numNodes; ii++)
  	{
  		loadNode(loadHandler->getNextNodeName(), loadHandler);
  	}
  }		
  
  void SequenceNodeImpl::loadAttributes(std::shared_ptr<persistence::interfaces::XLoadHandler> loadHandler, std::map<std::string, std::string> attr_list)
  {
  
  	StructuredActivityNodeImpl::loadAttributes(loadHandler, attr_list);
  }
  
  void SequenceNodeImpl::loadNode(std::string nodeName, std::shared_ptr<persistence::interfaces::XLoadHandler> loadHandler)
  {
  	std::shared_ptr<uml::umlFactory> modelFactory=uml::umlFactory::eInstance();
  
  	try
  	{
  		if ( nodeName.compare("executableNode") == 0 )
  		{
    			std::string typeName = loadHandler->getCurrentXSITypeName();
  			if (typeName.empty())
  			{
  				std::cout << "| WARNING    | type if an eClassifiers node it empty" << std::endl;
  				return; // no type name given and reference type is abstract
  			}
  			std::shared_ptr<uml::ExecutableNode> executableNode = std::dynamic_pointer_cast<uml::ExecutableNode>(modelFactory->create(typeName));
  			if (executableNode != nullptr)
  			{
  				std::shared_ptr<Bag<uml::ExecutableNode>> list_executableNode = this->getExecutableNode();
  				list_executableNode->push_back(executableNode);
  				loadHandler->handleChild(executableNode);
  			}
  			return;
  		}
  	}
  	catch (std::exception& e)
  	{
  		std::cout << "| ERROR    | " << e.what() << std::endl;
  	}
  	catch (...) 
  	{
  		std::cout << "| ERROR    | " <<  "Exception occurred" << std::endl;
  	}
  	//load BasePackage Nodes
  	StructuredActivityNodeImpl::loadNode(nodeName, loadHandler);
  }
  
  void SequenceNodeImpl::resolveReferences(const int featureID, std::list<std::shared_ptr<ecore::EObject> > references)
  {
  	StructuredActivityNodeImpl::resolveReferences(featureID, references);
  }
  
  void SequenceNodeImpl::save(std::shared_ptr<persistence::interfaces::XSaveHandler> saveHandler) const
  {
  	saveContent(saveHandler);
  
  	StructuredActivityNodeImpl::saveContent(saveHandler);
  	
  	ActionImpl::saveContent(saveHandler);
  	ActivityGroupImpl::saveContent(saveHandler);
  	NamespaceImpl::saveContent(saveHandler);
  	
  	ExecutableNodeImpl::saveContent(saveHandler);
  	
  	ActivityNodeImpl::saveContent(saveHandler);
  	
  	RedefinableElementImpl::saveContent(saveHandler);
  	
  	NamedElementImpl::saveContent(saveHandler);
  	
  	ElementImpl::saveContent(saveHandler);
  	
  	ObjectImpl::saveContent(saveHandler);
  	
  	ecore::EObjectImpl::saveContent(saveHandler);
  	
  	
  	
  	
  	
  	
  	
  	
  }
  
  void SequenceNodeImpl::saveContent(std::shared_ptr<persistence::interfaces::XSaveHandler> saveHandler) const
  {
  	try
  	{
  		std::shared_ptr<uml::umlPackage> package = uml::umlPackage::eInstance();
  
  	
  
  
  		//
  		// Add new tags (from references)
  		//
  		std::shared_ptr<ecore::EClass> metaClass = this->eClass();
  		// Save 'executableNode'
  		std::shared_ptr<Bag<uml::ExecutableNode>> list_executableNode = this->getExecutableNode();
  		for (std::shared_ptr<uml::ExecutableNode> executableNode : *list_executableNode) 
  		{
  			saveHandler->addReference(executableNode, "executableNode", executableNode->eClass() !=uml::umlPackage::eInstance()->getExecutableNode_Class());
  		}
  	}
  	catch (std::exception& e)
  	{
  		std::cout << "| ERROR    | " << e.what() << std::endl;
  	}
  }
  
  