-- @path ASAMM=/InterComponentCommunicationModeling/MetaModels/ASAMM.ecore
-- @path ICCMM=/InterComponentCommunicationModeling/MetaModels/ICCMM.ecore

module ICCModelExtractorForOneToFortyApps;
create OUT : ICCMM from IN : ASAMM, IN1 : ASAMM, IN2 : ASAMM, IN3 : ASAMM, IN4 : ASAMM, IN5 : ASAMM, IN6 : ASAMM, IN7 : ASAMM, IN8 : ASAMM, IN9 : ASAMM, IN10 : ASAMM, IN11 : ASAMM, IN12 : ASAMM, IN13 : ASAMM, IN14 : ASAMM, IN15 : ASAMM, IN16 : ASAMM, IN17 : ASAMM, IN18 : ASAMM, IN19 : ASAMM, IN20 : ASAMM, IN21 : ASAMM, IN22 : ASAMM, IN23 : ASAMM, IN24 : ASAMM, IN25 : ASAMM, IN26 : ASAMM, IN27 : ASAMM, IN28 : ASAMM, IN29 : ASAMM, IN30 : ASAMM, IN31 : ASAMM, IN32 : ASAMM, IN33 : ASAMM, IN34 : ASAMM, IN35 : ASAMM, IN36 : ASAMM, IN37 : ASAMM, IN38 : ASAMM, IN39 : ASAMM;


helper context OclAny def:getApplicationOne (NameComp:String):ASAMM!Application=
  if ASAMM!Component.allInstances()->select(c | c.Name=NameComp).notEmpty() then
      ASAMM!Component.allInstances()->select(c | c.Name=NameComp).first().refImmediateComposite()
     else
     OclUndefined
  endif;

helper context OclAny def:getApplicationTwo (NameComp:String):ASAMM!Application=
  if ASAMM!Component.allInstances()->select(c | c.Name.endsWith(NameComp)).notEmpty() then
      ASAMM!Component.allInstances()->select(c | c.Name.endsWith(NameComp)).first().refImmediateComposite()
	 --OclUndefined
  else
    --OclUndefined
	 if ASAMM!ApplicationPolicyFile.allInstances()->select(c | NameComp.startsWith(c.Package)).notEmpty() then
	      if ASAMM!Component.allInstances()->select(c | NameComp.endsWith(c.Name)).notEmpty() then
	         ASAMM!Component.allInstances()->select(c | NameComp.endsWith(c.Name)).first().refImmediateComposite()
		   else
		   	OclUndefined
		  endif
	 else
	 OclUndefined
	 endif
  endif;

helper context OclAny def:getApplicationTwoCheck (NameComp:String):String=
  if ASAMM!Component.allInstances()->select(c | c.Name.endsWith(NameComp)).notEmpty() then
     -- ASAMM!Component.allInstances()->select(c | c.Name=NameComp).first().refImmediateComposite()
	 'yyyyy'
     else
     --OclUndefined
	 'nnnnn'
  endif;

   helper context OclAny def:getApplicationCHECK (NameComp:String):Boolean=
	--java!ClassInstanceCreation.allInstances()->select(c | c.type.type.name='Intent');
   if ASAMM!Component.allInstances()->select(c | c.Name=NameComp).notEmpty() then 
      true
	  else
	  	false
		endif;
   
   helper context OclAny def:getApplicationpolicyfileCHECK (NameOfLabel:String):Boolean=
	--java!ClassInstanceCreation.allInstances()->select(c | c.type.type.name='Intent');
   if ASAMM!Application.allInstances()->select(c | c.Label=NameOfLabel).notEmpty() then 
      true
	  else
	  	false
		endif;
   
   --
   helper context ASAMM!Application def:getLable (NameOfLabel:String):String=
	--java!ClassInstanceCreation.allInstances()->select(c | c.type.type.name='Intent');
   if ASAMM!Application.allInstances()->select(c | c.Label=NameOfLabel).notEmpty() then 
      self.Label
	  else
	  --	'AAAAAAAAA'
	  self.Label
		endif;
   
   
helper context OclAny def:getApplicationPolicyFile (NameOfLabel:String) :ASAMM!ApplicationPolicyFile=
  if ASAMM!Application.allInstances()->select(c | c.Label=NameOfLabel).notEmpty() then
      ASAMM!Application.allInstances()->select(c | c.Label=NameOfLabel).first().refImmediateComposite()
     else
     OclUndefined
  endif;
   
   
   
helper context OclAny def : getContainerApplicationPolicyFile : ASAMM!ApplicationPolicyFile =
	if self.oclIsTypeOf(ASAMM!ApplicationPolicyFile) then
		self
	else
			self.refImmediateComposite().getContainerApplicationPolicyFile
endif;

helper context OclAny def : getContainerOfApplication1 () : OclAny =
	if self.oclIsTypeOf(ASAMM!ApplicationPolicyFile) then
		self
	else
			--self.refImmediateComposite().getContainerOfApplication1
			--false
			self
			--self.refImmediateComposite().getContainerOfApplication1()
endif;

helper context ASAMM!Intent def:getCategories:Sequence(ASAMM!Category)=
	self.categories->flatten();

helper context ASAMM!Category def:getName:String=
	self.Name;

helper context ASAMM!Action def:exitAction:Boolean=
	if self.Name.oclIsUndefined() then
	true
	else
	false
	endif;

helper context ASAMM!IntentFilter def:hasSpecificAction(ActionName:String):Boolean=
	if self.actions->select(c | c.Name=ActionName).notEmpty() then
	   true
	else
		if self.actions->select(c | not c.Name.oclIsUndefined())->select(c | c.Name.toLower().endsWith(ActionName.toLower())).notEmpty() then
		  true
		else
		   if self.actions->select(c | not c.Name.oclIsUndefined())->select(c | ActionName.toLower().endsWith(c.Name.toLower())).notEmpty() then
		   true
		   else
		   	false
		   endif
		endif
	endif;

helper context ASAMM!IntentFilter def:hasSpecificAction_Receiver(ActionName:String):Boolean=
	if not self.actions.oclIsUndefined() then
	  if self.actions->select(c | not c.Name.oclIsUndefined()).notEmpty() then
	     if self.actions->select(c | not c.Name.oclIsUndefined())->select(c | c.Name.toLower()=ActionName.toLower()).notEmpty() then
		   true
		 else
		     if self.actions->select(c | not c.Name.oclIsUndefined())->select(c | c.Name.toLower().endsWith('.' + ActionName.toLower())).notEmpty() then
		      true
	         else
		     false
			 endif
        endif
	 else
	 false
	 endif
	else
	false
	endif;

helper context ASAMM!Activity def:hasFilterForActionoFActivity(ActionName:String):Boolean=
	if self.filters->select(c | c.hasSpecificAction(ActionName)).notEmpty() then
	   true
	else
	   false
	 endif;

helper context ASAMM!Service def:hasFilterForActionOfService(ActionName:String):Boolean=
	if self.filters->select(c | c.hasSpecificAction(ActionName)).notEmpty() then
	   true
	else
	   false
	 endif;

helper context ASAMM!BroadcastReceiver def:hasFilterForActionOfBroadcastReceiver(ActionName:String):Boolean=
--if self.Source=#XML then
   if self.filters->select(c | c.actions.notEmpty()).notEmpty() then
      if self.filters->select(c | c.actions.notEmpty())->select(c | c.hasSpecificAction_Receiver(ActionName)).notEmpty() then
	   true
      else
	   false
      endif
   else
    false
   endif;

helper context ASAMM!DynamicRegisteredBroadcastReceiver def:hasFilterForActionOfDynamicRegisteredBroadcastReceiver(ActionName:String):Boolean=
   if self.filters->select(c | c.actions.notEmpty()).notEmpty() then
      if self.filters->select(c | c.actions.notEmpty())->select(c | c.hasSpecificAction_Receiver(ActionName)).notEmpty() then
	   true
      else
	   false
      endif
   else
    false
   endif;

helper context ASAMM!Intent def:IdentifyReceiverComponent(ActionName:String):String=
	if ASAMM!Component.allInstances()->select(c | not c.oclIsTypeOf(ASAMM!ContentProvider)).notEmpty() then
	      if ASAMM!Activity.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.hasFilterForActionoFActivity(ActionName)).notEmpty() then
		      ASAMM!Activity.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.hasFilterForActionoFActivity(ActionName))->first().Name
	         else
	   	         if ASAMM!Service.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.hasFilterForActionOfService(ActionName)).notEmpty() then
		             ASAMM!Service.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.hasFilterForActionOfService(ActionName))->first().Name
				    else
				    	  if ASAMM!BroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.hasFilterForActionOfBroadcastReceiver(ActionName)).notEmpty() then
		                        ASAMM!BroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.hasFilterForActionOfBroadcastReceiver(ActionName))->first().Name
						  else
						  OclUndefined
						  endif
			    endif
		  endif
		 else
		 OclUndefined
	endif;

helper context OclAny def:IdentifyReceiverComponentActivity(ActionName:String):Sequence(ASAMM!Activity)=
	if ASAMM!Component.allInstances()->select(c | not c.oclIsTypeOf(ASAMM!ContentProvider)).notEmpty() then
	      if ASAMM!Activity.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.hasFilterForActionoFActivity(ActionName)).notEmpty() then
		      ASAMM!Activity.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.hasFilterForActionoFActivity(ActionName))->flatten()
	         else
	   	         
			OclUndefined
			endif
			    
		 else
		 OclUndefined
	endif;

helper context OclAny def:IdentifyReceiverComponentService(ActionName:String):Sequence(ASAMM!Service)=
	if ASAMM!Component.allInstances()->select(c | not c.oclIsTypeOf(ASAMM!ContentProvider)).notEmpty() then
	   	         if ASAMM!Service.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.hasFilterForActionOfService(ActionName)).notEmpty() then
		             ASAMM!Service.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.hasFilterForActionOfService(ActionName))->flatten()
				    else
				     OclUndefined
					 endif
				else
		 OclUndefined
	endif
	;

helper context OclAny def:IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(ActionName:String):Sequence(ASAMM!DynamicRegisteredBroadcastReceiver)=
		if ASAMM!DynamicRegisteredComponent.allInstances().notEmpty() then
	       if ASAMM!DynamicRegisteredComponent.allInstances()->select(c | not c.oclIsTypeOf(ASAMM!DynamicRegisteredBroadcastReceiver)).notEmpty() then
			  if ASAMM!DynamicRegisteredBroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined()).notEmpty() then
			    if ASAMM!DynamicRegisteredBroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.hasFilterForActionOfDynamicRegisteredBroadcastReceiver(ActionName)).notEmpty() then
     		        ASAMM!DynamicRegisteredBroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.hasFilterForActionOfDynamicRegisteredBroadcastReceiver(ActionName))->flatten()
                else
              	OclUndefined
			    endif
		      else
			  OclUndefined
		      endif
	      else
		  OclUndefined
	      endif
	   else
	   OclUndefined
	   endif;
--OclUndefined;

helper context OclAny def:IdentifyReceiverComponentBroadcastReceiver(ActionName:String):Sequence(ASAMM!BroadcastReceiver)=
	if ASAMM!Component.allInstances()->select(c | not c.oclIsTypeOf(ASAMM!ContentProvider)).notEmpty() then
	   	  if ASAMM!BroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.hasFilterForActionOfBroadcastReceiver(ActionName)).notEmpty() then
		      ASAMM!BroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.hasFilterForActionOfBroadcastReceiver(ActionName)).flatten()
		  else
			  OclUndefined
		  endif
	else
		 OclUndefined
	endif;


helper context ASAMM!Intent def:IdentifyReceiverApp:String=
	if not self.Action.oclIsUndefined() then
		self.IdentifyReceiverComponent(self.Action)
					   
				else
				'noooooooooooooo'
				endif;

helper context ASAMM!Intent def:exitActionOFIntentInActionOfIntentFilters:Boolean=
	if not self.Action.oclIsUndefined() then
	   if ASAMM!Action.allInstances()->select(c | c.Name=self.Action).notEmpty() then
	      true
	   else
	   	  false
	   endif
	else
		false
	endif;


--update until API 30(Android 11)
helper def:stringOfIntentAction2FilterAction :Map(OclAny,OclAny) = 
	Map{--Normal
('ACTION_SEND','android.intent.action.SEND'),('ACTION_AIRPLANE_MODE_CHANGED','android.intent.action.AIRPLANE_MODE'),
('ACTION_ALL_APPS','android.intent.action.ALL_APPS'),
('ACTION_ANSWER','android.intent.action.ANSWER'),
('ACTION_APPLICATION_PREFERENCES','android.intent.action.APPLICATION_PREFERENCES'),
('ACTION_APPLICATION_RESTRICTIONS_CHANGED','android.intent.action.APPLICATION_RESTRICTIONS_CHANGED'),
('ACTION_APP_ERROR','....'),--api 14
('ACTION_ASSIST','android.intent.action.ASSIST'),
('ACTION_ATTACH_DATA','android.intent.action.ATTACH_DATA'),
('ACTION_AUTO_REVOKE_PERMISSIONS','android.intent.action.AUTO_REVOKE_PERMISSIONS'),
('ACTION_BATTERY_CHANGED','android.intent.action.BATTERY_CHANGED'),
('ACTION_BATTERY_LOW','android.intent.action.BATTERY_LOW'),
('ACTION_BATTERY_OKAY','android.intent.action.BATTERY_OKAY'),
('ACTION_BOOT_COMPLETED','android.intent.action.BOOT_COMPLETED'),
('ACTION_BUG_REPORT','android.intent.action.BUG_REPORT'),
('ACTION_CALL','android.intent.action.CALL'),
('ACTION_CALL_BUTTON','android.intent.action.CALL_BUTTON'),
('ACTION_CAMERA_BUTTON','android.intent.action.CAMERA_BUTTON'),
('ACTION_CARRIER_SETUP','android.intent.action.CARRIER_SETUP'),
('ACTION_CHOOSER','android.intent.action.CHOOSER'),
('ACTION_CLOSE_SYSTEM_DIALOGS','android.intent.action.CLOSE_SYSTEM_DIALOGS'),
('ACTION_CONFIGURATION_CHANGED','android.intent.action.CONFIGURATION_CHANGED'),
('ACTION_CREATE_DOCUMENT','android.intent.action.CREATE_DOCUMENT'),
('ACTION_CREATE_REMINDER','android.intent.action.CREATE_REMINDER'),
('ACTION_CREATE_SHORTCUT','android.intent.action.CREATE_SHORTCUT'),
('ACTION_DATE_CHANGED','android.intent.action.DATE_CHANGED'),
('ACTION_DEFAULT','android.intent.action.VIEW'),
('ACTION_DEFINE','android.intent.action.DEFINE'),
('ACTION_DELETE','android.intent.action.DELETE'),
('ACTION_DEVICE_STORAGE_LOW','android.intent.action.DEVICE_STORAGE_LOW'),
('ACTION_DEVICE_STORAGE_OK','android.intent.action.DEVICE_STORAGE_OK'),
('ACTION_DIAL','android.intent.action.DIAL'),
('ACTION_DOCK_EVENT','android.intent.action.DOCK_EVENT'),
('ACTION_DREAMING_STARTED','android.intent.action.DREAMING_STARTED'),
('ACTION_DREAMING_STOPPED','android.intent.action.DREAMING_STOPPED'),
('ACTION_EDIT','android.intent.action.EDIT'),
('ACTION_EXTERNAL_APPLICATIONS_AVAILABLE','android.intent.action.EXTERNAL_APPLICATIONS_AVAILABLE'),
('ACTION_EXTERNAL_APPLICATIONS_UNAVAILABLE','android.intent.action.EXTERNAL_APPLICATIONS_UNAVAILABLE'),
('ACTION_FACTORY_TEST','android.intent.action.FACTORY_TEST'),
('ACTION_GET_CONTENTD','android.intent.action.GET_CONTENT'),
('ACTION_GET_RESTRICTION_ENTRIES','android.intent.action.GET_RESTRICTION_ENTRIES'),
('ACTION_GTALK_SERVICE_CONNECTED','android.intent.action.GTALK_CONNECTED'),
('ACTION_GTALK_SERVICE_DISCONNECTED','android.intent.action.GTALK_DISCONNECTED'),
('ACTION_HEADSET_PLUG','android.intent.action.HEADSET_PLUG'),
('ACTION_INPUT_METHOD_CHANGED','android.intent.action.INPUT_METHOD_CHANGED'),
('ACTION_INSERT','android.intent.action.INSERT'),
('ACTION_INSERT_OR_EDIT','android.intent.action.INSERT_OR_EDIT'),
('ACTION_INSTALL_FAILURE','android.intent.action.INSTALL_FAILURE'),
('ACTION_INSTALL_PACKAGE','android.intent.action.INSTALL_PACKAGE'),
('ACTION_LOCALE_CHANGED','android.intent.action.LOCALE_CHANGED'),
('ACTION_LOCKED_BOOT_COMPLETED','android.intent.action.LOCKED_BOOT_COMPLETED'),
('ACTION_MAIN','android.intent.action.MAIN'),
('ACTION_MANAGED_PROFILE_ADDED','android.intent.action.MANAGED_PROFILE_ADDED'),
('ACTION_MANAGED_PROFILE_AVAILABLE','android.intent.action.MANAGED_PROFILE_AVAILABLE'),
('ACTION_MANAGED_PROFILE_REMOVED','android.intent.action.MANAGED_PROFILE_REMOVED'),
('ACTION_MANAGED_PROFILE_UNAVAILABLE','android.intent.action.MANAGED_PROFILE_UNAVAILABLE'),
('ACTION_MANAGED_PROFILE_UNLOCKED','android.intent.action.MANAGED_PROFILE_UNLOCKED'),
('ACTION_MANAGE_NETWORK_USAGE','android.intent.action.MANAGE_NETWORK_USAGE'),
('ACTION_MANAGE_PACKAGE_STORAGE','android.intent.action.MANAGE_PACKAGE_STORAGE'),
('ACTION_MEDIA_BAD_REMOVAL','android.intent.action.MEDIA_BAD_REMOVAL'),
('ACTION_MEDIA_BUTTON','android.intent.action.MEDIA_BUTTON'),
('ACTION_MEDIA_CHECKING','android.intent.action.MEDIA_CHECKING'),
('ACTION_MEDIA_EJECT','android.intent.action.MEDIA_EJECT'),
('ACTION_MEDIA_MOUNTED','android.intent.action.MEDIA_MOUNTED'),
('ACTION_MEDIA_NOFS','android.intent.action.MEDIA_NOFS'),
('ACTION_MEDIA_REMOVED','android.intent.action.MEDIA_REMOVED'),
('ACTION_MEDIA_SCANNER_FINISHED','android.intent.action.MEDIA_SCANNER_FINISHED'),
('ACTION_MEDIA_SCANNER_SCAN_FILE','android.intent.action.MEDIA_SCANNER_SCAN_FILE'),
('ACTION_MEDIA_SCANNER_STARTED','android.intent.action.MEDIA_SCANNER_STARTED'),
('ACTION_MEDIA_SHARED','android.intent.action.MEDIA_SHARED'),
('ACTION_MEDIA_UNMOUNTABLE','android.intent.action.MEDIA_UNMOUNTABLE'),
('ACTION_MEDIA_UNMOUNTED','android.intent.action.MEDIA_UNMOUNTED'),
('ACTION_MY_PACKAGE_REPLACED','android.intent.action.MY_PACKAGE_REPLACED'),
('ACTION_MY_PACKAGE_SUSPENDED','android.intent.action.MY_PACKAGE_SUSPENDED'),
('ACTION_MY_PACKAGE_UNSUSPENDED','android.intent.action.MY_PACKAGE_UNSUSPENDED'),
('ACTION_NEW_OUTGOING_CALL','android.intent.action.NEW_OUTGOING_CALL'),
('ACTION_OPEN_DOCUMENT','android.intent.action.OPEN_DOCUMENT'),
('ACTION_OPEN_DOCUMENT_TREE','android.intent.action.OPEN_DOCUMENT_TREE'),
('ACTION_PACKAGES_SUSPENDED','android.intent.action.PACKAGES_SUSPENDED'),
('ACTION_PACKAGES_UNSUSPENDED','android.intent.action.PACKAGES_UNSUSPENDED'),
('ACTION_PACKAGE_ADDED','android.intent.action.PACKAGE_ADDED'),
('ACTION_PACKAGE_CHANGED','android.intent.action.PACKAGE_CHANGED'),
('ACTION_PACKAGE_DATA_CLEARED','android.intent.action.PACKAGE_DATA_CLEARED'),
('ACTION_PACKAGE_FIRST_LAUNCH','android.intent.action.PACKAGE_FIRST_LAUNCH'),
('ACTION_PACKAGE_FULLY_REMOVED','android.intent.action.PACKAGE_FULLY_REMOVED'),
('ACTION_PACKAGE_INSTALL','android.intent.action.PACKAGE_INSTALL'),
('ACTION_PACKAGE_NEEDS_VERIFICATION','android.intent.action.PACKAGE_NEEDS_VERIFICATION'),
('ACTION_PACKAGE_REMOVED','android.intent.action.PACKAGE_REMOVED'),
('ACTION_PACKAGE_REPLACED','android.intent.action.PACKAGE_REPLACED'),
('ACTION_PACKAGE_RESTARTED','android.intent.action.PACKAGE_RESTARTED'),
('ACTION_PACKAGE_VERIFIED','android.intent.action.PACKAGE_VERIFIED'),
('ACTION_PASTE','android.intent.action.PASTE'),
('ACTION_PICK','android.intent.action.PICK'),
('ACTION_PICK_ACTIVITY','android.intent.action.PICK_ACTIVITY'),
('ACTION_POWER_CONNECTED','android.intent.action.ACTION_POWER_CONNECTED'),
('ACTION_POWER_DISCONNECTED','android.intent.action.ACTION_POWER_DISCONNECTED'),
('ACTION_POWER_USAGE_SUMMARY','android.intent.action.POWER_USAGE_SUMMARY'),
('ACTION_PROCESS_TEXT','android.intent.action.PROCESS_TEXT'),
('ACTION_PROVIDER_CHANGED','android.intent.action.PROVIDER_CHANGED'),
('ACTION_QUICK_CLOCK','android.intent.action.QUICK_CLOCK'),
('ACTION_QUICK_VIEW','android.intent.action.QUICK_VIEW'),
('ACTION_REBOOT','android.intent.action.REBOOT'),
('ACTION_RUN','android.intent.action.RUN'),
('ACTION_SCREEN_OFF','android.intent.action.SCREEN_OFF'),
('ACTION_SCREEN_ON','android.intent.action.SCREEN_ON'),
('ACTION_SEARCH','android.intent.action.SEARCH'),
('ACTION_SEARCH_LONG_PRESS','android.intent.action.SEARCH_LONG_PRESS'),
('ACTION_SENDTO','android.intent.action.SENDTO'),
('ACTION_SEND_MULTIPLE','android.intent.action.SEND_MULTIPLE'),
('ACTION_SET_WALLPAPER','android.intent.action.SET_WALLPAPER'),
('ACTION_SHOW_APP_INFO','android.intent.action.SHOW_APP_INFO'),
('ACTION_SHUTDOWN','android.intent.action.ACTION_SHUTDOWN'),
('ACTION_SYNC','android.intent.action.SYNC'),
('ACTION_SYSTEM_TUTORIAL','android.intent.action.SYSTEM_TUTORIAL'),
('ACTION_TIMEZONE_CHANGED','android.intent.action.TIMEZONE_CHANGED'),
('ACTION_TIME_CHANGED','android.intent.action.TIME_SET'),
('ACTION_TIME_TICK','android.intent.action.TIME_TICK'),
('ACTION_TRANSLATE','android.intent.action.TRANSLATE'),
('ACTION_UID_REMOVED','android.intent.action.UID_REMOVED'),
('ACTION_UMS_CONNECTED','android.intent.action.UMS_CONNECTED'),
('ACTION_UMS_DISCONNECTED','android.intent.action.UMS_DISCONNECTED'),
('ACTION_UNINSTALL_PACKAGE','android.intent.action.UNINSTALL_PACKAGE'),
('ACTION_USER_BACKGROUND','android.intent.action.USER_BACKGROUND'),
('ACTION_USER_FOREGROUND','android.intent.action.USER_FOREGROUND'),
('ACTION_USER_INITIALIZE','android.intent.action.USER_INITIALIZE'),
('ACTION_USER_PRESENT','android.intent.action.USER_PRESENT'),
('ACTION_USER_UNLOCKED','android.intent.action.USER_UNLOCKED'),
('ACTION_VIEW','android.intent.action.VIEW'),
('ACTION_VIEW_LOCUS','android.intent.action.VIEW_LOCUS'),
('ACTION_VIEW_PERMISSION_USAGE','android.intent.action.VIEW_PERMISSION_USAGE'),
('ACTION_VOICE_COMMAND','ACTION_VOICE_COMMAND'),
('ACTION_WALLPAPER_CHANGED','android.intent.action.WALLPAPER_CHANGED'),
('ACTION_WEB_SEARCH','android.intent.action.WEB_SEARCH'),
('ACTION_BIND_SIDE_CHANNEL','android.support.BIND_NOTIFICATION_SIDE_CHANNEL'),



--For MediaStore:
('ACTION_IMAGE_CAPTURE','android.media.action.IMAGE_CAPTURE'),
('ACTION_IMAGE_CAPTURE_SECURE','android.media.action.IMAGE_CAPTURE_SECURE')
};


helper def:stringOfIntentCategory2FilterCategory :Map(OclAny,OclAny) = 
	Map{--Normal
('CATEGORY_ACCESSIBILITY_SHORTCUT_TARGET','android.intent.category.ACCESSIBILITY_SHORTCUT_TARGET'),
('CATEGORY_ALTERNATIVE','android.intent.category.ALTERNATIVE'),
('CATEGORY_APP_BROWSER','android.intent.category.APP_BROWSER'),
('CATEGORY_APP_CALCULATOR','android.intent.category.APP_CALCULATOR'),
('CATEGORY_APP_CALENDAR','android.intent.category.APP_CALENDAR'),
('CATEGORY_APP_CONTACTS','android.intent.category.APP_CONTACTS'),
('CATEGORY_APP_EMAIL','android.intent.category.APP_EMAIL'),
('CATEGORY_APP_FILES','android.intent.category.APP_FILES'),
('CATEGORY_APP_GALLERY','android.intent.category.APP_GALLERY'),
('CATEGORY_APP_MAPS','android.intent.category.APP_MAPS'),
('CATEGORY_APP_MARKET','android.intent.category.APP_MARKET'),
('CATEGORY_APP_MESSAGING','android.intent.category.APP_MESSAGING'),
('CATEGORY_APP_MUSIC','android.intent.category.APP_MUSIC'),
('CATEGORY_BROWSABLE','android.intent.category.BROWSABLE'),
('CATEGORY_CAR_DOCK','android.intent.category.CAR_DOCK'),
('CATEGORY_CAR_MODE','android.intent.category.CAR_MODE'),
('CATEGORY_DEFAULT','android.intent.category.DEFAULT'),
('CATEGORY_DESK_DOCK','android.intent.category.DESK_DOCK'),
('CATEGORY_DEVELOPMENT_PREFERENCE','android.intent.category.DEVELOPMENT_PREFERENCE'),
('CATEGORY_EMBED','android.intent.category.EMBED'),
('CATEGORY_FRAMEWORK_INSTRUMENTATION_TEST','android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST'),
('CATEGORY_HE_DESK_DOCK','android.intent.category.HE_DESK_DOCK'),
('CATEGORY_HOME','android.intent.category.HOME'),
('CATEGORY_INFO','android.intent.category.INFO'),
('CATEGORY_LAUNCHER','android.intent.category.LAUNCHER'),
('CATEGORY_LEANBACK_LAUNCHER','android.intent.category.LEANBACK_LAUNCHER'),
('CATEGORY_LE_DESK_DOCK','android.intent.category.LE_DESK_DOCK'),
('CATEGORY_MONKEY','android.intent.category.MONKEY'),
('CATEGORY_OPENABLE','android.intent.category.OPENABLE'),
('CATEGORY_PREFERENCE','android.intent.category.PREFERENCE'),
('CATEGORY_SAMPLE_CODE','android.intent.category.SAMPLE_CODE'),
('CATEGORY_SECONDARY_HOME','android.intent.category.SECONDARY_HOME'),
('CATEGORY_SELECTED_ALTERNATIVE','android.intent.category.SELECTED_ALTERNATIVE'),
('CATEGORY_TAB','android.intent.category.TAB'),
('CATEGORY_TEST','android.intent.category.TEST'),
('CATEGORY_TYPED_OPENABLE','android.intent.category.TYPED_OPENABLE'),
('CATEGORY_UNIT_TEST','android.intent.category.UNIT_TEST'),
('CATEGORY_VOICE','android.intent.category.VOICE'),
('CATEGORY_VR_HOME','android.intent.category.VR_HOME')

};

-------------------------------------------------Action Test:----------------------------------------
---test OnlyAction for Activity:
helper context ASAMM!Intent def:TestActionForActivity:Sequence(ASAMM!Activity)=
if ASAMM!Component.allInstances()->select(c | not c.oclIsTypeOf(ASAMM!ContentProvider)).notEmpty() then
  if ASAMM!Activity.allInstances()->select(c | not c.filters.oclIsUndefined()).notEmpty() then
	 if not thisModule.stringOfIntentAction2FilterAction.get(self.Action).oclIsUndefined() then
	   if not thisModule.IdentifyReceiverComponentActivity(thisModule.stringOfIntentAction2FilterAction.get(self.Action)).oclIsUndefined() then
          thisModule.IdentifyReceiverComponentActivity(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->collect(c | thisModule.createTargetComponentForActivity(c))
		else
         OclUndefined
	   endif
    else-------
	   if not thisModule.IdentifyReceiverComponentActivity(self.Action).oclIsUndefined() then
		  thisModule.IdentifyReceiverComponentActivity(self.Action)->flatten()->collect(c | thisModule.createTargetComponentForActivity(c))
		else
	   	OclUndefined
	   endif
    endif
   else
   	OclUndefined
   endif
else
OclUndefined
endif;

---test OnlyAction for Service:
helper context ASAMM!Intent def:TestActionForService:Sequence(ASAMM!Service)=
if ASAMM!Component.allInstances()->select(c | not c.oclIsTypeOf(ASAMM!ContentProvider)).notEmpty() then
  if ASAMM!Service.allInstances()->select(c | not c.filters.oclIsUndefined()).notEmpty() then
	 if not thisModule.stringOfIntentAction2FilterAction.get(self.Action).oclIsUndefined() then
	    if not thisModule.IdentifyReceiverComponentService(thisModule.stringOfIntentAction2FilterAction.get(self.Action)).oclIsUndefined() then
		  thisModule.IdentifyReceiverComponentService(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->collect(c | thisModule.createTargetComponentForService(c))
	    else
	      OclUndefined
		endif
	 else     
		 if not thisModule.IdentifyReceiverComponentService(self.Action).oclIsUndefined() then
		     thisModule.IdentifyReceiverComponentService(self.Action)->collect(c | thisModule.createTargetComponentForService(c))
		 else
		 OclUndefined
		 endif
	 endif
   else
	 OclUndefined
   endif 
else
OclUndefined
endif;

---test OnlyAction for Receiver:
helper context ASAMM!Intent def:TestActionForReceiver:Sequence(ASAMM!BroadcastReceiver)=
if ASAMM!Component.allInstances()->select(c | not c.oclIsTypeOf(ASAMM!ContentProvider)).notEmpty() then
  if ASAMM!BroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined()).notEmpty() then
	 if not thisModule.stringOfIntentAction2FilterAction.get(self.Action).oclIsUndefined() then
	    if not thisModule.IdentifyReceiverComponentBroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action)).oclIsUndefined() then
		  thisModule.IdentifyReceiverComponentBroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()
        else
          OclUndefined
		endif
	 else
          if not thisModule.IdentifyReceiverComponentBroadcastReceiver(self.Action).oclIsUndefined() then
            thisModule.IdentifyReceiverComponentBroadcastReceiver(self.Action)->flatten()
		  else
			OclUndefined
		  endif
	 endif
  else
   OclUndefined
  endif
else
 OclUndefined
endif
;

---test OnlyAction for Dynamic Receiver:
helper context ASAMM!Intent def:TestActionForDynamicReceiver:Sequence(ASAMM!DynamicRegisteredBroadcastReceiver)=
if ASAMM!DynamicRegisteredBroadcastReceiver.allInstances().notEmpty() then
	 if ASAMM!DynamicRegisteredBroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined()).notEmpty() then
	 if not thisModule.stringOfIntentAction2FilterAction.get(self.Action).oclIsUndefined() then
	    if not thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action)).oclIsUndefined() then
	       thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()	    
        else
	      OclUndefined
		endif
	 else
	      if not thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(self.Action).oclIsUndefined() then
           thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(self.Action)->flatten()
          else
          	OclUndefined
		  endif
	 endif
  else
   OclUndefined
  endif
else
OclUndefined
endif
;


-------------------------------------------------Category Test:----------------------------------------
---test OnlyCategory for Activity:
helper context ASAMM!Intent def:TestCategoryForActivity:Sequence(ASAMM!Activity)=
if ASAMM!Component.allInstances()->select(c | not c.oclIsTypeOf(ASAMM!ContentProvider)).notEmpty() then
    if ASAMM!Activity.allInstances()->select(c | not c.filters.oclIsUndefined()).notEmpty() then
        if ASAMM!Activity.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined())).notEmpty() then
	        if ASAMM!Activity.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined()))->flatten()->select(c | c.filters->exists(d | d.categories.asSequence().includesAll(self.categories.asSequence()))).notEmpty() then
			  ASAMM!Activity.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined()))->flatten()->select(c | c.filters->exists(d | d.categories.asSequence().includesAll(self.categories.asSequence())))->flatten()->collect(c | thisModule.createTargetComponentForActivity(c))
			else
			OclUndefined
			endif
	    else
		OclUndefined
	    endif
	else
    OclUndefined
	endif
else
OclUndefined
endif;

---test OnlyCategory for Service:
helper context ASAMM!Intent def:TestCategoryForService:Sequence(ASAMM!Service)=
if ASAMM!Component.allInstances()->select(c | not c.oclIsTypeOf(ASAMM!ContentProvider)).notEmpty() then
    if ASAMM!Service.allInstances()->select(c | not c.filters.oclIsUndefined()).notEmpty() then
        if ASAMM!Service.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined())).notEmpty() then
	        if ASAMM!Service.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined()))->flatten()->select(c | c.filters->exists(d | d.categories.asSequence().includesAll(self.categories.asSequence()))).notEmpty() then
			OclUndefined
			else
			OclUndefined
			endif
	    else
		OclUndefined
	    endif
	else
    OclUndefined
	endif
else
OclUndefined
endif;

---test OnlyCategory for Receiver:
helper context ASAMM!Intent def:TestCategoryForReceiver:Sequence(ASAMM!BroadcastReceiver)=
if ASAMM!Component.allInstances()->select(c | not c.oclIsTypeOf(ASAMM!ContentProvider)).notEmpty() then
    if ASAMM!BroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined()).notEmpty() then
        if ASAMM!BroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined())).notEmpty() then
	        if ASAMM!BroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined()))->flatten()->select(c | c.filters->exists(d | d.categories.asSequence().includesAll(self.categories.asSequence()))).notEmpty() then
			OclUndefined
			else
			OclUndefined
			endif
	    else
		OclUndefined
	    endif
	else
    OclUndefined
	endif
else
OclUndefined
endif;


---test OnlyCategory for Dynamic Receiver:
helper context ASAMM!Intent def:TestCategoryForDynamicReceiver:Sequence(ASAMM!DynamicRegisteredBroadcastReceiver)=
if ASAMM!Component.allInstances()->select(c | not c.oclIsTypeOf(ASAMM!ContentProvider)).notEmpty() then
    if ASAMM!DynamicRegisteredBroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined()).notEmpty() then
        if ASAMM!DynamicRegisteredBroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined())).notEmpty() then
	        if ASAMM!DynamicRegisteredBroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined()))->flatten()->select(c | c.filters->exists(d | d.categories.asSequence().includesAll(self.categories.asSequence()))).notEmpty() then
			OclUndefined
			else
			OclUndefined
			endif
	    else
		OclUndefined
	    endif
	else
    OclUndefined
	endif
else
OclUndefined
endif;
	
-------------------------------------------------Action and Category Test:----------------------------------------
helper context ASAMM!Activity def:notExistInCategoryOfActivity (nameOfCategory:String):Boolean=
if not self.filters.oclIsUndefined() then
  if self.filters->select(c | not c.categories.oclIsUndefined()).notEmpty() then
    if not thisModule.stringOfIntentCategory2FilterCategory.get(nameOfCategory).oclIsUndefined() then
       if not self.filters->select(c | c.categories->exists(a | a.Name=thisModule.stringOfIntentCategory2FilterCategory.get(nameOfCategory))).notEmpty() then
	     true
	   else
	   	false
	   endif
	else
		false
	endif
  else
  	false
  endif
else
	false
endif;

helper context ASAMM!Service def:notExistInCategoryOfService (nameOfCategory:String):Boolean=
if not self.filters.oclIsUndefined() then
  if self.filters->select(c | not c.categories.oclIsUndefined()).notEmpty() then
    if not thisModule.stringOfIntentCategory2FilterCategory.get(nameOfCategory).oclIsUndefined() then
       if not self.filters->select(c | c.categories->exists(a | a.Name=thisModule.stringOfIntentCategory2FilterCategory.get(nameOfCategory))).notEmpty() then
	     true
	   else
	   	false
	   endif
	else
		false
	endif
  else
  	false
  endif
else
	false
endif;

helper context ASAMM!BroadcastReceiver def:notExistInCategoryOfReceiver (nameOfCategory:String):Boolean=
if not self.filters.oclIsUndefined() then
  if self.filters->select(c | not c.categories.oclIsUndefined()).notEmpty() then
    if not thisModule.stringOfIntentCategory2FilterCategory.get(nameOfCategory).oclIsUndefined() then
       if not self.filters->select(c | c.categories->exists(a | a.Name=thisModule.stringOfIntentCategory2FilterCategory.get(nameOfCategory))).notEmpty() then
	     true
	   else
	   	false
	   endif
	else
		false
	endif
  else
  	false
  endif
else
	false
endif;

helper context ASAMM!DynamicRegisteredBroadcastReceiver def:notExistInCategoryOfDynamicReceiver (nameOfCategory:String):Boolean=
if not self.filters.oclIsUndefined() then
  if self.filters->select(c | not c.categories.oclIsUndefined()).notEmpty() then
    if not thisModule.stringOfIntentCategory2FilterCategory.get(nameOfCategory).oclIsUndefined() then
       if not self.filters->select(c | c.categories->exists(a | a.Name=thisModule.stringOfIntentCategory2FilterCategory.get(nameOfCategory))).notEmpty() then
	     true
	   else
	   	false
	   endif
	else
		false
	endif
  else
  	false
  endif
else
	false
endif;


 
---test Action and Category for Activity:
helper context ASAMM!Intent def:TestActionAndCategoryForActivity:Sequence(ASAMM!Activity)=
if ASAMM!Component.allInstances()->select(c | not c.oclIsTypeOf(ASAMM!ContentProvider)).notEmpty() then
  if ASAMM!Activity.allInstances()->select(c | not c.filters.oclIsUndefined()).notEmpty() then
     if ASAMM!Activity.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.actions.oclIsUndefined() and not d.categories.oclIsUndefined())).notEmpty() then
	   if not thisModule.stringOfIntentAction2FilterAction.get(self.Action).oclIsUndefined() then
	      if not thisModule.IdentifyReceiverComponentActivity(thisModule.stringOfIntentAction2FilterAction.get(self.Action)).oclIsUndefined() then 
			if thisModule.IdentifyReceiverComponentActivity(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfActivity(a.Name.toString())).notEmpty()).notEmpty() then
			     thisModule.IdentifyReceiverComponentActivity(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined()))->select(c | not self.categories->select(a |   c.notExistInCategoryOfActivity(a.Name.toString())).notEmpty())->collect(c | thisModule.createTargetComponentForActivity(c))
			    
            else
				OclUndefined
			endif
		  else
		  OclUndefined
		  endif
		else
		    if not thisModule.IdentifyReceiverComponentActivity(self.Action).oclIsUndefined() then------------------MUST BE CKECK FOR ALL SEQUECNE OF CATEGORY
               if thisModule.IdentifyReceiverComponentActivity(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfActivity(a.Name.toString())).notEmpty()).notEmpty() then
			     thisModule.IdentifyReceiverComponentActivity(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined()))->select(c | not self.categories->select(a |   c.notExistInCategoryOfActivity(a.Name.toString())).notEmpty())->collect(c | thisModule.createTargetComponentForActivity(c))
			     
			   else
			   	OclUndefined
		       endif
             else
	          OclUndefined
			endif
		endif
	 else
	 	OclUndefined
	 endif
  else
  OclUndefined
  endif
else
 OclUndefined
endif;

---test Action and Category for Service:
helper context ASAMM!Intent def:TestActionAndCategoryForService:Sequence(ASAMM!Service)=
if ASAMM!Component.allInstances()->select(c | not c.oclIsTypeOf(ASAMM!ContentProvider)).notEmpty() then
  if ASAMM!Service.allInstances()->select(c | not c.filters.oclIsUndefined()).notEmpty() then
     if ASAMM!Service.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.actions.oclIsUndefined() and not d.categories.oclIsUndefined())).notEmpty() then
	   if not thisModule.stringOfIntentAction2FilterAction.get(self.Action).oclIsUndefined() then
	      if not thisModule.IdentifyReceiverComponentService(thisModule.stringOfIntentAction2FilterAction.get(self.Action)).oclIsUndefined() then 
			if thisModule.IdentifyReceiverComponentService(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfService(a.Name.toString())).notEmpty()).notEmpty() then
			     thisModule.IdentifyReceiverComponentService(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined()))->select(c | not self.categories->select(a |   c.notExistInCategoryOfService(a.Name.toString())).notEmpty())->collect(c | thisModule.createTargetComponentForService(c))
			    
            else
				OclUndefined
			endif
		  else
		  OclUndefined
		  endif
		else
		    if not thisModule.IdentifyReceiverComponentService(self.Action).oclIsUndefined() then------------------MUST BE CKECK FOR ALL SEQUECNE OF CATEGORY
               if thisModule.IdentifyReceiverComponentService(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfService(a.Name.toString())).notEmpty()).notEmpty() then
			     thisModule.IdentifyReceiverComponentService(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined()))->select(c | not self.categories->select(a |   c.notExistInCategoryOfService(a.Name.toString())).notEmpty())->collect(c | thisModule.createTargetComponentForService(c))
			     
			   else
			   	OclUndefined
		       endif
             else
	          OclUndefined
			endif
		endif
	 else
	 	OclUndefined
	 endif
  else
  OclUndefined
  endif
else
 OclUndefined
endif;

---test Action and Category for Receiver:
helper context ASAMM!Intent def:TestActionAndCategoryForReceiver:Sequence(ASAMM!BroadcastReceiver)=
if ASAMM!Component.allInstances()->select(c | not c.oclIsTypeOf(ASAMM!ContentProvider)).notEmpty() then
  if ASAMM!BroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined()).notEmpty() then
     if ASAMM!BroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.actions.oclIsUndefined() and not d.categories.oclIsUndefined())).notEmpty() then
	   if not thisModule.stringOfIntentAction2FilterAction.get(self.Action).oclIsUndefined() then
	      if not thisModule.IdentifyReceiverComponentBroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action)).oclIsUndefined() then 
			if thisModule.IdentifyReceiverComponentBroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfReceiver(a.Name.toString())).notEmpty()).notEmpty() then
			     thisModule.IdentifyReceiverComponentBroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined()))->select(c | not self.categories->select(a |   c.notExistInCategoryOfReceiver(a.Name.toString())).notEmpty())->flatten()
			    
            else
				OclUndefined
			endif
		  else
		  OclUndefined
		  endif
		else
		    if not thisModule.IdentifyReceiverComponentBroadcastReceiver(self.Action).oclIsUndefined() then------------------MUST BE CKECK FOR ALL SEQUECNE OF CATEGORY
               if thisModule.IdentifyReceiverComponentBroadcastReceiver(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfReceiver(a.Name.toString())).notEmpty()).notEmpty() then
			     thisModule.IdentifyReceiverComponentBroadcastReceiver(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined()))->select(c | not self.categories->select(a |   c.notExistInCategoryOfReceiver(a.Name.toString())).notEmpty())->flatten()
			     
			   else
			   	OclUndefined
		       endif
             else
	          OclUndefined
			endif
		endif
	 else
	 	OclUndefined
	 endif
  else
  OclUndefined
  endif
else
 OclUndefined
endif;

---test Action and Category for Dynamic Receiver:
helper context ASAMM!Intent def:TestActionAndCategoryForDynamicReceiver:Sequence(ASAMM!DynamicRegisteredBroadcastReceiver)=
if ASAMM!Component.allInstances()->select(c | not c.oclIsTypeOf(ASAMM!ContentProvider)).notEmpty() then
  if ASAMM!DynamicRegisteredBroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined()).notEmpty() then
     if ASAMM!DynamicRegisteredBroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.actions.oclIsUndefined() and not d.categories.oclIsUndefined())).notEmpty() then
	   if not thisModule.stringOfIntentAction2FilterAction.get(self.Action).oclIsUndefined() then
	      if not thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action)).oclIsUndefined() then 
			if thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfDynamicReceiver(a.Name.toString())).notEmpty()).notEmpty() then
			     thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined()))->select(c | not self.categories->select(a |   c.notExistInCategoryOfDynamicReceiver(a.Name.toString())).notEmpty())->flatten()
			    
            else
				OclUndefined
			endif
		  else
		  OclUndefined
		  endif
		else
		    if not thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(self.Action).oclIsUndefined() then------------------MUST BE CKECK FOR ALL SEQUECNE OF CATEGORY
               if thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfDynamicReceiver(a.Name.toString())).notEmpty()).notEmpty() then
			     thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined()))->select(c | not self.categories->select(a |   c.notExistInCategoryOfDynamicReceiver(a.Name.toString())).notEmpty())->flatten()
			     
			   else
			   	OclUndefined
		       endif
             else
	          OclUndefined
			endif
		endif
	 else
	 	OclUndefined
	 endif
  else
  OclUndefined
  endif
else
 OclUndefined
endif;
	

-------------------------------------------------Action and Data Test:----------------------------------------
helper context ASAMM!Activity def:ExistInDataOfActivity (dataType:String, scheme:String, host:String ):Boolean=
if not self.filters.oclIsUndefined() then
    if self.filters->select(c | not c.data.oclIsUndefined()).notEmpty() then
        if not dataType.oclIsUndefined() and not scheme.oclIsUndefined() and not host.oclIsUndefined() then----datatype and scheme and host
	        if self.filters->select(c | c.data->exists(a | not a.DataType.oclIsUndefined() and not a.Scheme.oclIsUndefined() and not a.Host.oclIsUndefined())).notEmpty() then
	            if self.filters->select(c | c.data->exists(a | a.DataType=dataType and a.Scheme=scheme and host.startsWith(a.Host.toString()))).notEmpty() then
	               true
				else
					false
			    endif
		    else
			false
			endif
	    else
			if not dataType.oclIsUndefined() and not scheme.oclIsUndefined() and host.oclIsUndefined() then-----datatype and scheme
		 	    if self.filters->select(c | c.data->exists(a | not a.DataType.oclIsUndefined() and not a.Scheme.oclIsUndefined())).notEmpty() then
	                if self.filters->select(c | c.data->exists(a | a.DataType=dataType and a.Scheme=scheme)).notEmpty() then
	                 true
				     else
					false
			        endif
		        else
			    false
			    endif
			else
				if not dataType.oclIsUndefined() and scheme.oclIsUndefined() and not host.oclIsUndefined() then-----datatype and host--so check just datatType
		     	    if self.filters->select(c | c.data->exists(a | not a.DataType.oclIsUndefined())).notEmpty() then
	                    if self.filters->select(c | c.data->exists(a | a.DataType=dataType)).notEmpty() then
	                        true
					    else
							 false
						endif
					else
					false
					endif
					     
				else
					if dataType.oclIsUndefined() and not scheme.oclIsUndefined() and not host.oclIsUndefined() then-----sheme and host
				  	    if self.filters->select(c | c.data->exists(a | not a.Scheme.oclIsUndefined() and not a.Host.oclIsUndefined())).notEmpty() then
	                 	    if self.filters->select(c | c.data->exists(a | a.Scheme=scheme and host.startsWith(a.Host.toString()))).notEmpty() then
	                 	    true
					        else
					         false
					        endif
				        else
						    if self.filters->select(c | c.data->exists(a | not a.Scheme.oclIsUndefined())).notEmpty() then
	                 	        if self.filters->select(c | c.data->exists(a | a.Scheme=scheme)).notEmpty() then
	                 	        true
					            else
					             false
					            endif
				            else
						    false
						    endif
						endif
--					        
					else
					    if not dataType.oclIsUndefined() and scheme.oclIsUndefined() and host.oclIsUndefined() then-----datatype
				            if self.filters->select(c | c.data->exists(a | not a.DataType.oclIsUndefined())).notEmpty() then
	                            if self.filters->select(c | c.data->exists(a | a.DataType=dataType)).notEmpty() then
	                              true
							    else
							        if self.filters->select(c | c.data->exists(a | (a.DataType.toString().regexReplaceAll('.*/','').regexReplaceAll('\"','')).toString()= '*')).notEmpty() then
	                                   if self.filters->select(c | c.data->exists(a | a.DataType.toString().regexReplaceAll('.*/', '').regexReplaceAll('\"', '')='*')).flatten()->select(c | c.data->exists(a | dataType.startsWith(a.DataType.toString().regexReplaceAll('/.*', '').regexReplaceAll('\"', '')))).notEmpty() then
	                                    true
									   else
									   	false
									   endif
									else
										false
									endif
							    endif
					        else
								false
					        endif
					    else
						  
					     	if dataType.oclIsUndefined() and not scheme.oclIsUndefined() and host.oclIsUndefined() then-----sheme
				  	            if self.filters->select(c | c.data->exists(a | not a.Scheme.oclIsUndefined())).notEmpty() then
	                 	            if self.filters->select(c | c.data->exists(a | a.Scheme=scheme)).notEmpty() then
	                 	             true
					                else
					                 false
					                endif
				                else
						        false
						        endif
         					else
						    false
					        endif
					    endif
					endif
				endif
			endif
		endif
	else
	false
    endif
else
false
endif;
--true;

helper context ASAMM!Service def:ExistInDataOfService (dataType:String, scheme:String, host:String ):Boolean=
if not self.filters.oclIsUndefined() then
    if self.filters->select(c | not c.data.oclIsUndefined()).notEmpty() then
        if not dataType.oclIsUndefined() and not scheme.oclIsUndefined() and not host.oclIsUndefined() then----datatype and scheme and host
	        if self.filters->select(c | c.data->exists(a | not a.DataType.oclIsUndefined() and not a.Scheme.oclIsUndefined() and not a.Host.oclIsUndefined())).notEmpty() then
	            if self.filters->select(c | c.data->exists(a | a.DataType=dataType and a.Scheme=scheme and host.startsWith(a.Host))).notEmpty() then
	               true
				else
					false
			    endif
		    else
			false
			endif
	    else
			if not dataType.oclIsUndefined() and not scheme.oclIsUndefined() and host.oclIsUndefined() then-----datatype and scheme
		 	    if self.filters->select(c | c.data->exists(a | not a.DataType.oclIsUndefined() and not a.Scheme.oclIsUndefined())).notEmpty() then
	                if self.filters->select(c | c.data->exists(a | a.DataType=dataType and a.Scheme=scheme)).notEmpty() then
	                 true
				     else
					false
			        endif
		        else
			    false
			    endif
			else
				if not dataType.oclIsUndefined() and scheme.oclIsUndefined() and not host.oclIsUndefined() then-----datatype and host--so check just datatType
		     	    if self.filters->select(c | c.data->exists(a | not a.DataType.oclIsUndefined())).notEmpty() then
	                    if self.filters->select(c | c.data->exists(a | a.DataType=dataType)).notEmpty() then
	                        true
					    else
							 false
						endif
					else
					false
					endif
					     
				else
					if dataType.oclIsUndefined() and not scheme.oclIsUndefined() and not host.oclIsUndefined() then-----sheme and host
				  	    if self.filters->select(c | c.data->exists(a | not a.Scheme.oclIsUndefined() and not a.Host.oclIsUndefined())).notEmpty() then
	                 	    if self.filters->select(c | c.data->exists(a | a.Scheme=scheme and host.startsWith(a.Host))).notEmpty() then
	                 	    true
					        else
					         false
					        endif
				        else
						    if self.filters->select(c | c.data->exists(a | not a.Scheme.oclIsUndefined())).notEmpty() then
	                 	        if self.filters->select(c | c.data->exists(a | a.Scheme=scheme)).notEmpty() then
	                 	        true
					            else
					             false
					            endif
				            else
						    false
						    endif
						endif
					        
					else
					    if not dataType.oclIsUndefined() and scheme.oclIsUndefined() and host.oclIsUndefined() then-----datatype
				            if self.filters->select(c | c.data->exists(a | not a.DataType.oclIsUndefined())).notEmpty() then
	                            if self.filters->select(c | c.data->exists(a | a.DataType=dataType)).notEmpty() then
	                              true
							    else
							      false
							    endif
					        else
								false
					        endif
					    else  
					     	if dataType.oclIsUndefined() and not scheme.oclIsUndefined() and host.oclIsUndefined() then-----sheme
				  	            if self.filters->select(c | c.data->exists(a | not a.Scheme.oclIsUndefined())).notEmpty() then
	                 	            if self.filters->select(c | c.data->exists(a | a.Scheme=scheme)).notEmpty() then
	                 	             true
					                else
					                 false
					                endif
				                else
						        false
						        endif
         					else
						    false
					        endif
					    endif
					endif
				endif
			endif
		endif
	else
	false
    endif
else
false
endif
;

helper context ASAMM!BroadcastReceiver def:ExistInDataOfReceiver (dataType:String, scheme:String, host:String ):Boolean=
if not self.filters.oclIsUndefined() then
    if self.filters->select(c | not c.data.oclIsUndefined()).notEmpty() then
        if not dataType.oclIsUndefined() and not scheme.oclIsUndefined() and not host.oclIsUndefined() then----datatype and scheme and host
	        if self.filters->select(c | c.data->exists(a | not a.DataType.oclIsUndefined() and not a.Scheme.oclIsUndefined() and not a.Host.oclIsUndefined())).notEmpty() then
	            if self.filters->select(c | c.data->exists(a | a.DataType=dataType and a.Scheme=scheme and host.startsWith(a.Host))).notEmpty() then
	               true
				else
					false
			    endif
		    else
			false
			endif
	    else
			if not dataType.oclIsUndefined() and not scheme.oclIsUndefined() and host.oclIsUndefined() then-----datatype and scheme
		 	    if self.filters->select(c | c.data->exists(a | not a.DataType.oclIsUndefined() and not a.Scheme.oclIsUndefined())).notEmpty() then
	                if self.filters->select(c | c.data->exists(a | a.DataType=dataType and a.Scheme=scheme)).notEmpty() then
	                 true
				     else
					false
			        endif
		        else
			    false
			    endif
			else
				if not dataType.oclIsUndefined() and scheme.oclIsUndefined() and not host.oclIsUndefined() then-----datatype and host--so check just datatType
		     	    if self.filters->select(c | c.data->exists(a | not a.DataType.oclIsUndefined())).notEmpty() then
	                    if self.filters->select(c | c.data->exists(a | a.DataType=dataType)).notEmpty() then
	                        true
					    else
							 false
						endif
					else
					false
					endif
					     
				else
					if dataType.oclIsUndefined() and not scheme.oclIsUndefined() and not host.oclIsUndefined() then-----sheme and host
				  	    if self.filters->select(c | c.data->exists(a | not a.Scheme.oclIsUndefined() and not a.Host.oclIsUndefined())).notEmpty() then
	                 	    if self.filters->select(c | c.data->exists(a | a.Scheme=scheme and host.startsWith(a.Host))).notEmpty() then
	                 	    true
					        else
					         false
					        endif
				        else
						   if self.filters->select(c | c.data->exists(a | not a.Scheme.oclIsUndefined())).notEmpty() then
	                 	        if self.filters->select(c | c.data->exists(a | a.Scheme=scheme)).notEmpty() then
	                 	        true
					            else
					             false
					            endif
				            else
						    false
						    endif
						endif
					        
					else
					    if not dataType.oclIsUndefined() and scheme.oclIsUndefined() and host.oclIsUndefined() then-----datatype
				            if self.filters->select(c | c.data->exists(a | not a.DataType.oclIsUndefined())).notEmpty() then
	                            if self.filters->select(c | c.data->exists(a | a.DataType=dataType)).notEmpty() then
	                              true
							    else
							      false
							    endif
					        else
								false
					        endif
					    else
							  
					     	if dataType.oclIsUndefined() and not scheme.oclIsUndefined() and host.oclIsUndefined() then-----sheme
				  	            if self.filters->select(c | c.data->exists(a | not a.Scheme.oclIsUndefined())).notEmpty() then
	                 	            if self.filters->select(c | c.data->exists(a | a.Scheme=scheme)).notEmpty() then
	                 	             true
					                else
					                 false
					                endif
				                else
						        false
						        endif
         					else
						    false
					        endif
					    endif
					endif
				endif
			endif
		endif
	else
	false
    endif
else
false
endif;

helper context ASAMM!DynamicRegisteredBroadcastReceiver def:ExistInDataOfDynamicReceiver (dataType:String, scheme:String, host:String ):Boolean=
if not self.filters.oclIsUndefined() then
    if self.filters->select(c | not c.data.oclIsUndefined()).notEmpty() then
        if not dataType.oclIsUndefined() and not scheme.oclIsUndefined() and not host.oclIsUndefined() then----datatype and scheme and host
	        if self.filters->select(c | c.data->exists(a | not a.DataType.oclIsUndefined() and not a.Scheme.oclIsUndefined() and not a.Host.oclIsUndefined())).notEmpty() then
	            if self.filters->select(c | c.data->exists(a | a.DataType=dataType and a.Scheme=scheme and host.startsWith(a.Host))).notEmpty() then
	               true
				else
					false
			    endif
		    else
			false
			endif
	    else
			if not dataType.oclIsUndefined() and not scheme.oclIsUndefined() and host.oclIsUndefined() then-----datatype and scheme
		 	    if self.filters->select(c | c.data->exists(a | not a.DataType.oclIsUndefined() and not a.Scheme.oclIsUndefined())).notEmpty() then
	                if self.filters->select(c | c.data->exists(a | a.DataType=dataType and a.Scheme=scheme)).notEmpty() then
	                 true
				     else
					false
			        endif
		        else
			    false
			    endif
			else
				if not dataType.oclIsUndefined() and scheme.oclIsUndefined() and not host.oclIsUndefined() then-----datatype and host--so check just datatType
		     	    if self.filters->select(c | c.data->exists(a | not a.DataType.oclIsUndefined())).notEmpty() then
	                    if self.filters->select(c | c.data->exists(a | a.DataType=dataType)).notEmpty() then
	                        true
					    else
							 false
						endif
					else
					false
					endif
					     
				else
					if dataType.oclIsUndefined() and not scheme.oclIsUndefined() and not host.oclIsUndefined() then-----sheme and host
				  	    if self.filters->select(c | c.data->exists(a | not a.Scheme.oclIsUndefined() and not a.Host.oclIsUndefined())).notEmpty() then
	                 	    if self.filters->select(c | c.data->exists(a | a.Scheme=scheme and host.startsWith(a.Host))).notEmpty() then
	                 	    true
					        else
					         false
					        endif
				        else
						    if self.filters->select(c | c.data->exists(a | not a.Scheme.oclIsUndefined())).notEmpty() then
	                 	        if self.filters->select(c | c.data->exists(a | a.Scheme=scheme)).notEmpty() then
	                 	        true
					            else
					             false
					            endif
				            else
						    false
						    endif
						endif
					        
					else
					    if not dataType.oclIsUndefined() and scheme.oclIsUndefined() and host.oclIsUndefined() then-----datatype
				            if self.filters->select(c | c.data->exists(a | not a.DataType.oclIsUndefined())).notEmpty() then
	                            if self.filters->select(c | c.data->exists(a | a.DataType=dataType)).notEmpty() then
	                              true
							    else
							      false
							    endif
					        else
								false
					        endif
					    else
							  
					     	if dataType.oclIsUndefined() and not scheme.oclIsUndefined() and host.oclIsUndefined() then-----sheme
				  	            if self.filters->select(c | c.data->exists(a | not a.Scheme.oclIsUndefined())).notEmpty() then
	                 	            if self.filters->select(c | c.data->exists(a | a.Scheme=scheme)).notEmpty() then
	                 	             true
					                else
					                 false
					                endif
				                else
						        false
						        endif
         					else
						    false
					        endif
					    endif
					endif
				endif
			endif
		endif
	else
	false
    endif
else
false
endif;
			
---test Action and Data for Activity:
helper context ASAMM!Intent def:TestActionAndDataForActivity:Sequence(ASAMM!Activity)=
if ASAMM!Component.allInstances()->select(c | not c.oclIsTypeOf(ASAMM!ContentProvider)).notEmpty() then
    if ASAMM!Activity.allInstances()->select(c | not c.filters.oclIsUndefined()).notEmpty() then
        if ASAMM!Activity.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.actions.oclIsUndefined() and not d.data.oclIsUndefined())).notEmpty() then
	        if not thisModule.stringOfIntentAction2FilterAction.get(self.Action).oclIsUndefined() then
			   if not thisModule.IdentifyReceiverComponentActivity(thisModule.stringOfIntentAction2FilterAction.get(self.Action)).oclIsUndefined() then
				    if not self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then---data of intent has DataType and scheme and host
				        if thisModule.IdentifyReceiverComponentActivity(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfActivity(a.DataType, a.Scheme, a.Host))).notEmpty() then
			             thisModule.IdentifyReceiverComponentActivity(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfActivity(a.DataType, a.Scheme, a.Host)))->collect(c | thisModule.createTargetComponentForActivity(c))
			            else
			             OclUndefined
					    endif
                    else
	      	            if not self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then---data of intent has DataType and scheme
			                if thisModule.IdentifyReceiverComponentActivity(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfActivity(a.DataType, a.Scheme, OclUndefined))).notEmpty() then
			                 thisModule.IdentifyReceiverComponentActivity(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfActivity(a.DataType, a.Scheme, OclUndefined)))->collect(c | thisModule.createTargetComponentForActivity(c))
			                else
			                OclUndefined
					        endif
				        else
			  	            if not self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has DataType and host-----so check only datatype
			                    if thisModule.IdentifyReceiverComponentActivity(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfActivity(a.DataType, OclUndefined, OclUndefined))).notEmpty() then
			                    thisModule.IdentifyReceiverComponentActivity(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfActivity(a.DataType, OclUndefined, OclUndefined)))->collect(c | thisModule.createTargetComponentForActivity(c))
			                    else
			                    OclUndefined
							    endif
                            else
				   	            if self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has scheme and host
			                        if thisModule.IdentifyReceiverComponentActivity(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfActivity(OclUndefined, a.Scheme, a.Host))).notEmpty() then
			                         thisModule.IdentifyReceiverComponentActivity(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfActivity(OclUndefined, a.Scheme, a.Host))).flatten()->collect(c | thisModule.createTargetComponentForActivity(c))
			                         else
			                   	    OclUndefined
							         endif
	                            else
							        if not self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then------data of intent has DataType
			                            if thisModule.IdentifyReceiverComponentActivity(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfActivity(a.DataType, OclUndefined, OclUndefined))).notEmpty() then
			                            thisModule.IdentifyReceiverComponentActivity(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfActivity(a.DataType, OclUndefined, OclUndefined)))->collect(c | thisModule.createTargetComponentForActivity(c))
                                        else
			                            OclUndefined
						                endif
							        else
								        if self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then------data of intent has scheme
			                                if thisModule.IdentifyReceiverComponentActivity(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfActivity(OclUndefined, a.Scheme, OclUndefined))).notEmpty() then
			                                  thisModule.IdentifyReceiverComponentActivity(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfActivity(OclUndefined, a.Scheme, OclUndefined)))->collect(c | thisModule.createTargetComponentForActivity(c))
			                                else
			                                OclUndefined
										    endif
								        else
									        if self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has host---so consider just action
			                                 thisModule.IdentifyReceiverComponentActivity(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->collect(c | thisModule.createTargetComponentForActivity(c))
			                                else
										     OclUndefined
									        endif
								        endif
								    endif
						        endif
						    endif
					    endif
			         endif
			    else
				OclUndefined
				endif
			else
		        if not thisModule.IdentifyReceiverComponentActivity(self.Action).oclIsUndefined() then
	                if not self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then---data of intent has DataType and scheme and host
				       if thisModule.IdentifyReceiverComponentActivity(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfActivity(a.DataType, a.Scheme, a.Host))).notEmpty() then
			              thisModule.IdentifyReceiverComponentActivity(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfActivity(a.DataType, a.Scheme, a.Host)))->collect(c | thisModule.createTargetComponentForActivity(c))
			           else
			                OclUndefined
					   endif
                    else
	      	            if not self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then---data of intent has DataType and scheme
			                  if thisModule.IdentifyReceiverComponentActivity(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfActivity(a.DataType, a.Scheme, OclUndefined))).notEmpty() then
			                   thisModule.IdentifyReceiverComponentActivity(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfActivity(a.DataType, a.Scheme, OclUndefined)))->collect(c | thisModule.createTargetComponentForActivity(c))
			                  else
			                  OclUndefined
					          endif
				        else
			  	            if not self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has DataType and host-----so check only datatype
			                    if thisModule.IdentifyReceiverComponentActivity(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfActivity(a.DataType, OclUndefined, OclUndefined))).notEmpty() then
			                      thisModule.IdentifyReceiverComponentActivity(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfActivity(a.DataType, OclUndefined, OclUndefined)))->collect(c | thisModule.createTargetComponentForActivity(c))
			                    else
			                       OclUndefined
								endif
                            else
				   	            if self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has scheme and host
			                       if thisModule.IdentifyReceiverComponentActivity(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfActivity(OclUndefined, a.Scheme, a.Host))).notEmpty() then
			                       thisModule.IdentifyReceiverComponentActivity(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfActivity(OclUndefined, a.Scheme, a.Host))).flatten()->collect(c | thisModule.createTargetComponentForActivity(c))
								  else
			                   	     OclUndefined
							       endif
	                            else
							        if not self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then------data of intent has DataType
			                            if thisModule.IdentifyReceiverComponentActivity(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfActivity(a.DataType, OclUndefined, OclUndefined))).notEmpty() then
			                               thisModule.IdentifyReceiverComponentActivity(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfActivity(a.DataType, OclUndefined, OclUndefined)))->collect(c | thisModule.createTargetComponentForActivity(c))
			                            else
			                             OclUndefined
										endif
							        else
								        if self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then------data of intent has scheme
			                               if thisModule.IdentifyReceiverComponentActivity(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfActivity(OclUndefined, a.Scheme, OclUndefined))).notEmpty() then
			                               thisModule.IdentifyReceiverComponentActivity(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfActivity(OclUndefined, a.Scheme, OclUndefined)))->collect(c | thisModule.createTargetComponentForActivity(c))
			                               else
			                                OclUndefined
										    endif
								        else
									    	if self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has host---so consider just action
			                                 thisModule.IdentifyReceiverComponentActivity(self.Action)->flatten()->collect(c | thisModule.createTargetComponentForActivity(c))
			                               
									        else
										    OclUndefined
									        endif
								        endif
								    endif
						        endif
						    endif
					    endif
			        endif
			    else
			    OclUndefined
			    endif
		    endif	    
        else
         OclUndefined
	    endif
	else
         OclUndefined
	endif
else
OclUndefined
endif
;

---test Action and Data for Service:
helper context ASAMM!Intent def:TestActionAndDataForService:Sequence(ASAMM!Service)=
if ASAMM!Component.allInstances()->select(c | not c.oclIsTypeOf(ASAMM!ContentProvider)).notEmpty() then
    if ASAMM!Service.allInstances()->select(c | not c.filters.oclIsUndefined()).notEmpty() then
        if ASAMM!Service.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.actions.oclIsUndefined() and not d.data.oclIsUndefined())).notEmpty() then
	        if not thisModule.stringOfIntentAction2FilterAction.get(self.Action).oclIsUndefined() then
				if not self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then---data of intent has DataType and scheme and host
				    if thisModule.IdentifyReceiverComponentService(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfService(a.DataType, a.Scheme, a.Host))).notEmpty() then
			           thisModule.IdentifyReceiverComponentService(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfService(a.DataType, a.Scheme, a.Host)))->collect(c | thisModule.createReceiverComponentForService(c))
					else
			           OclUndefined
					endif
                else
	      	        if not self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then---data of intent has DataType and scheme
			            if thisModule.IdentifyReceiverComponentService(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfService(a.DataType, a.Scheme, OclUndefined))).notEmpty() then
			               thisModule.IdentifyReceiverComponentService(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfService(a.DataType, a.Scheme, OclUndefined)))->collect(c | thisModule.createReceiverComponentForService(c))
			            else
			             OclUndefined
					    endif
				    else
			  	        if not self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has DataType and host-----so check only datatype
			                if thisModule.IdentifyReceiverComponentService(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfService(a.DataType, OclUndefined, OclUndefined))).notEmpty() then
			                   thisModule.IdentifyReceiverComponentService(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfService(a.DataType, OclUndefined, OclUndefined)))->collect(c | thisModule.createReceiverComponentForService(c))
			                else
			                  OclUndefined
							endif
                        else
				   	        if self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has scheme and host
			                    if thisModule.IdentifyReceiverComponentService(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfService(OclUndefined, a.Scheme, a.Host))).notEmpty() then
			                    thisModule.IdentifyReceiverComponentService(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfService(OclUndefined, a.Scheme, a.Host))).flatten()->collect(c | thisModule.createReceiverComponentForService(c))
			                    else
			                   	  OclUndefined
							    endif
	                        else
							    if not self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then------data of intent has DataType
			                        if thisModule.IdentifyReceiverComponentService(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfService(a.DataType, OclUndefined, OclUndefined))).notEmpty() then
			                            thisModule.IdentifyReceiverComponentService(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfService(a.DataType, OclUndefined, OclUndefined)))->collect(c | thisModule.createReceiverComponentForService(c))
			                        else
			                          OclUndefined
								    endif
							    else
								    if self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then------data of intent has scheme
			                            if thisModule.IdentifyReceiverComponentService(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfService(OclUndefined, a.Scheme, OclUndefined))).notEmpty() then
			                             thisModule.IdentifyReceiverComponentService(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfService(OclUndefined, a.Scheme, OclUndefined)))->collect(c | thisModule.createReceiverComponentForService(c))
			                            else
			                             OclUndefined
										endif
								    else
									    if self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has host---so consider just action
			                             thisModule.IdentifyReceiverComponentService(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->collect(c | thisModule.createTargetComponentForActivity(c))
			                            else
										OclUndefined
									    endif
								    endif
								endif
						    endif
						endif
					endif
			    endif
			else
		        if not thisModule.IdentifyReceiverComponentService(self.Action).oclIsUndefined() then
	                if not self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then---data of intent has DataType and scheme and host
				       if thisModule.IdentifyReceiverComponentService(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfService(a.DataType, a.Scheme, a.Host))).notEmpty() then
			              thisModule.IdentifyReceiverComponentService(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfService(a.DataType, a.Scheme, a.Host)))->collect(c | thisModule.createReceiverComponentForService(c))
			           else
			                OclUndefined
					   endif
                    else
	      	            if not self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then---data of intent has DataType and scheme
			                  if thisModule.IdentifyReceiverComponentService(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfService(a.DataType, a.Scheme, OclUndefined))).notEmpty() then
			                   thisModule.IdentifyReceiverComponentService(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfService(a.DataType, a.Scheme, OclUndefined)))->collect(c | thisModule.createReceiverComponentForService(c))
			                  else
			                  OclUndefined
					          endif
				        else
			  	            if not self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has DataType and host-----so check only datatype
			                    if thisModule.IdentifyReceiverComponentService(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfService(a.DataType, OclUndefined, OclUndefined))).notEmpty() then
			                      thisModule.IdentifyReceiverComponentService(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfService(a.DataType, OclUndefined, OclUndefined)))->collect(c | thisModule.createReceiverComponentForService(c))
			                    else
			                       OclUndefined
								endif
                            else
				   	            if self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has scheme and host
			                       if thisModule.IdentifyReceiverComponentService(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfService(OclUndefined, a.Scheme, a.Host))).notEmpty() then
			                       thisModule.IdentifyReceiverComponentService(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfService(OclUndefined, a.Scheme, a.Host))).flatten()->collect(c | thisModule.createReceiverComponentForService(c))
			  
								  else
			                   	     OclUndefined
							       endif
	                            else
							        if not self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then------data of intent has DataType
			                            if thisModule.IdentifyReceiverComponentService(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfService(a.DataType, OclUndefined, OclUndefined))).notEmpty() then
			                               thisModule.IdentifyReceiverComponentService(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfService(a.DataType, OclUndefined, OclUndefined)))->collect(c | thisModule.createReceiverComponentForService(c))
			                            else
			                             OclUndefined
										endif
							        else
								        if self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then------data of intent has scheme
			                               if thisModule.IdentifyReceiverComponentService(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfService(OclUndefined, a.Scheme, OclUndefined))).notEmpty() then
			                               thisModule.IdentifyReceiverComponentService(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfService(OclUndefined, a.Scheme, OclUndefined)))->collect(c | thisModule.createReceiverComponentForService(c))
			                               else
			                                OclUndefined
										    endif
								        else
									    	if self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has host---so consider just action
			                                 thisModule.IdentifyReceiverComponentService(self.Action)->flatten()->collect(c | thisModule.createReceiverComponentForService(c))
			                               
									        else
										    OclUndefined
									        endif
								        endif
								    endif
						        endif
						    endif
					    endif
			        endif
			    else
			    OclUndefined
			    endif
		    endif	    
        else
         OclUndefined
	    endif
	else
         OclUndefined
	endif
else
OclUndefined
endif;

---test Action and Data for Receiver:
helper context ASAMM!Intent def:TestActionAndDataForReceiver:Sequence(ASAMM!BroadcastReceiver)=
if ASAMM!Component.allInstances()->select(c | not c.oclIsTypeOf(ASAMM!ContentProvider)).notEmpty() then
    if ASAMM!BroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined()).notEmpty() then
        if ASAMM!BroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.actions.oclIsUndefined() and not d.data.oclIsUndefined())).notEmpty() then
	        if not thisModule.stringOfIntentAction2FilterAction.get(self.Action).oclIsUndefined() then
			  if not thisModule.IdentifyReceiverComponentBroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action)).oclIsUndefined() then
				if not self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then---data of intent has DataType and scheme and host
				    if thisModule.IdentifyReceiverComponentBroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(a.DataType, a.Scheme, a.Host))).notEmpty() then
			           thisModule.IdentifyReceiverComponentBroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(a.DataType, a.Scheme, a.Host)))->flatten()
			        else
			           OclUndefined
					endif
                else
	      	        if not self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then---data of intent has DataType and scheme
			            if thisModule.IdentifyReceiverComponentBroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(a.DataType, a.Scheme, OclUndefined))).notEmpty() then
			               thisModule.IdentifyReceiverComponentBroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(a.DataType, a.Scheme, OclUndefined)))->flatten()
			            else
			             OclUndefined
					    endif
				    else
			  	        if not self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has DataType and host-----so check only datatype
			                if thisModule.IdentifyReceiverComponentBroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(a.DataType, OclUndefined, OclUndefined))).notEmpty() then
			                   thisModule.IdentifyReceiverComponentBroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(a.DataType, OclUndefined, OclUndefined)))->flatten()
			                else
			                  OclUndefined
							endif
                        else
				   	        if self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has scheme and host
			                    if thisModule.IdentifyReceiverComponentBroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(OclUndefined, a.Scheme, a.Host))).notEmpty() then
			                    thisModule.IdentifyReceiverComponentBroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(OclUndefined, a.Scheme, a.Host))).flatten()->flatten()
			                    else
			                   	  OclUndefined
							    endif
	                        else
							    if not self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then------data of intent has DataType
			                        if thisModule.IdentifyReceiverComponentBroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(a.DataType, OclUndefined, OclUndefined))).notEmpty() then
			                            thisModule.IdentifyReceiverComponentBroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(a.DataType, OclUndefined, OclUndefined)))->flatten()
			                        else
			                          OclUndefined
								    endif
							    else
								    if self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then------data of intent has scheme
			                            if thisModule.IdentifyReceiverComponentBroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(OclUndefined, a.Scheme, OclUndefined))).notEmpty() then
			                             thisModule.IdentifyReceiverComponentBroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(OclUndefined, a.Scheme, OclUndefined)))->flatten()
			                            else
			                             OclUndefined
										endif
								    else
									    if self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has host---so consider just action
			                             thisModule.IdentifyReceiverComponentBroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->flatten()
			                            else
										OclUndefined
									    endif
								    endif
								endif
						    endif
						endif
					endif
			    endif
			  else
			  	OclUndefined
			  endif
			else
		        if not thisModule.IdentifyReceiverComponentBroadcastReceiver(self.Action).oclIsUndefined() then
	                if not self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then---data of intent has DataType and scheme and host
				       if thisModule.IdentifyReceiverComponentBroadcastReceiver(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(a.DataType, a.Scheme, a.Host))).notEmpty() then
			              thisModule.IdentifyReceiverComponentBroadcastReceiver(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(a.DataType, a.Scheme, a.Host)))->flatten()
			           else
			                OclUndefined
					   endif
                    else
	      	            if not self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then---data of intent has DataType and scheme
			                  if thisModule.IdentifyReceiverComponentBroadcastReceiver(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(a.DataType, a.Scheme, OclUndefined))).notEmpty() then
			                   thisModule.IdentifyReceiverComponentBroadcastReceiver(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(a.DataType, a.Scheme, OclUndefined)))->flatten()
			                  else
			                  OclUndefined
					          endif
				        else
			  	            if not self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has DataType and host-----so check only datatype
			                    if thisModule.IdentifyReceiverComponentBroadcastReceiver(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(a.DataType, OclUndefined, OclUndefined))).notEmpty() then
			                      thisModule.IdentifyReceiverComponentBroadcastReceiver(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(a.DataType, OclUndefined, OclUndefined)))->flatten()
			                    else
			                       OclUndefined
								endif
                            else
				   	            if self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has scheme and host
			                       if thisModule.IdentifyReceiverComponentBroadcastReceiver(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(OclUndefined, a.Scheme, a.Host))).notEmpty() then
			                       thisModule.IdentifyReceiverComponentBroadcastReceiver(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(OclUndefined, a.Scheme, a.Host))).flatten()->flatten()
			  
								  else
			                   	     OclUndefined
							       endif
	                            else
							        if not self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then------data of intent has DataType
			                            if thisModule.IdentifyReceiverComponentBroadcastReceiver(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(a.DataType, OclUndefined, OclUndefined))).notEmpty() then
			                               thisModule.IdentifyReceiverComponentBroadcastReceiver(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(a.DataType, OclUndefined, OclUndefined)))->flatten()
			                            else
			                             OclUndefined
										endif
							        else
								        if self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then------data of intent has scheme
			                               if thisModule.IdentifyReceiverComponentBroadcastReceiver(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(OclUndefined, a.Scheme, OclUndefined))).notEmpty() then
			                               thisModule.IdentifyReceiverComponentBroadcastReceiver(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(OclUndefined, a.Scheme, OclUndefined)))->flatten()
			                               else
			                                OclUndefined
										    endif
								        else
									    	if self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has host---so consider just action
			                                 thisModule.IdentifyReceiverComponentBroadcastReceiver(self.Action)->flatten()
			                               
									        else
										    OclUndefined
									        endif
								        endif
								    endif
						        endif
						    endif
					    endif
			        endif
			    else
			    OclUndefined
			    endif
		    endif	    
        else
         OclUndefined
	    endif
	else
         OclUndefined
	endif
else
OclUndefined
endif;
  
---test Action and Data for DynamicReceiver :
helper context ASAMM!Intent def:TestActionAndDataForDynamicReceiver:Sequence(ASAMM!DynamicRegisteredBroadcastReceiver)=
if ASAMM!Component.allInstances()->select(c | not c.oclIsTypeOf(ASAMM!ContentProvider)).notEmpty() then
    if ASAMM!DynamicRegisteredBroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined()).notEmpty() then
        if ASAMM!DynamicRegisteredBroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.actions.oclIsUndefined() and not d.data.oclIsUndefined())).notEmpty() then
	        if not thisModule.stringOfIntentAction2FilterAction.get(self.Action).oclIsUndefined() then
				if not self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then---data of intent has DataType and scheme and host
				    if thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(a.DataType, a.Scheme, a.Host))).notEmpty() then
			           thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(a.DataType, a.Scheme, a.Host)))->flatten()
			        else
			           OclUndefined
					endif
                else
	      	        if not self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then---data of intent has DataType and scheme
			            if thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(a.DataType, a.Scheme, OclUndefined))).notEmpty() then
			               thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(a.DataType, a.Scheme, OclUndefined)))->flatten()
			            else
			             OclUndefined
					    endif
				    else
			  	        if not self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has DataType and host-----so check only datatype
			                if thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(a.DataType, OclUndefined, OclUndefined))).notEmpty() then
			                   thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(a.DataType, OclUndefined, OclUndefined)))->flatten()
			                else
			                  OclUndefined
							endif
                        else
				   	        if self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has scheme and host
			                    if thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(OclUndefined, a.Scheme, a.Host))).notEmpty() then
			                    thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(OclUndefined, a.Scheme, a.Host))).flatten()->flatten()
			                    else
			                   	  OclUndefined
							    endif
	                        else
							    if not self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then------data of intent has DataType
			                        if thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(a.DataType, OclUndefined, OclUndefined))).notEmpty() then
			                            thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(a.DataType, OclUndefined, OclUndefined)))->flatten()
			                        else
			                          OclUndefined
								    endif
							    else
								    if self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then------data of intent has scheme
			                            if thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(OclUndefined, a.Scheme, OclUndefined))).notEmpty() then
			                             thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(OclUndefined, a.Scheme, OclUndefined)))->flatten()
			                            else
			                             OclUndefined
										endif
								    else
									    if self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has host---so consider just action
			                             thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->flatten()
			                            else
										OclUndefined
									    endif
								    endif
								endif
						    endif
						endif
					endif
			    endif
			else
		        if not thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(self.Action).oclIsUndefined() then
	                if not self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then---data of intent has DataType and scheme and host
				       if thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(a.DataType, a.Scheme, a.Host))).notEmpty() then
			              thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(a.DataType, a.Scheme, a.Host)))->flatten()
			           else
			                OclUndefined
					   endif
                    else
	      	            if not self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then---data of intent has DataType and scheme
			                  if thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(a.DataType, a.Scheme, OclUndefined))).notEmpty() then
			                   thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(a.DataType, a.Scheme, OclUndefined)))->flatten()
			                  else
			                  OclUndefined
					          endif
				        else
			  	            if not self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has DataType and host-----so check only datatype
			                    if thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(a.DataType, OclUndefined, OclUndefined))).notEmpty() then
			                      thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(a.DataType, OclUndefined, OclUndefined)))->flatten()
			                    else
			                       OclUndefined
								endif
                            else
				   	            if self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has scheme and host
			                       if thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(OclUndefined, a.Scheme, a.Host))).notEmpty() then
			                       thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(OclUndefined, a.Scheme, a.Host))).flatten()->flatten()
			  
								  else
			                   	     OclUndefined
							       endif
	                            else
							        if not self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then------data of intent has DataType
			                            if thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(a.DataType, OclUndefined, OclUndefined))).notEmpty() then
			                               thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(a.DataType, OclUndefined, OclUndefined)))->flatten()
			                            else
			                             OclUndefined
										endif
							        else
								        if self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then------data of intent has scheme
			                               if thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(OclUndefined, a.Scheme, OclUndefined))).notEmpty() then
			                               thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(OclUndefined, a.Scheme, OclUndefined)))->flatten()
			                               else
			                                OclUndefined
										    endif
								        else
									    	if self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has host---so consider just action
			                                 thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(self.Action)->flatten()
			                               
									        else
										    OclUndefined
									        endif
								        endif
								    endif
						        endif
						    endif
					    endif
			        endif
			    else
			    OclUndefined
			    endif
		    endif	    
        else
         OclUndefined
	    endif
	else
         OclUndefined
	endif
else
OclUndefined
endif;

-------------------for Only Data Test----------------
---test Action and Data for Activity:
helper context ASAMM!Intent def:TestDataForActivity:Sequence(ASAMM!Activity)=
if ASAMM!Component.allInstances()->select(c | not c.oclIsTypeOf(ASAMM!ContentProvider)).notEmpty() then
    if ASAMM!Activity.allInstances()->select(c | not c.filters.oclIsUndefined()).notEmpty() then
        if ASAMM!Activity.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).notEmpty() then
	        if not self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then---data of intent has DataType and scheme and host
				if ASAMM!Activity.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined()))->flatten()->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfActivity(a.DataType, a.Scheme, a.Host))).notEmpty() then
			        ASAMM!Activity.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfActivity(a.DataType, a.Scheme, a.Host)))->collect(c | thisModule.createTargetComponentForActivity(c))
			    else
			      OclUndefined
				endif
            else
	      	    if not self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then---data of intent has DataType and scheme
			        if ASAMM!Activity.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfActivity(a.DataType, a.Scheme, OclUndefined))).notEmpty() then
			            ASAMM!Activity.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfActivity(a.DataType, a.Scheme, OclUndefined)))->collect(c | thisModule.createTargetComponentForActivity(c))
			        else
			          OclUndefined
					endif
				else
			  	    if not self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has DataType and host-----so check only datatype
			            if ASAMM!Activity.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfActivity(a.DataType, OclUndefined, OclUndefined))).notEmpty() then
			               ASAMM!Activity.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfActivity(a.DataType, OclUndefined, OclUndefined)))->collect(c | thisModule.createTargetComponentForActivity(c))
			            else
			            OclUndefined
						endif
                    else
				   	    if self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has scheme and host
			              if ASAMM!Activity.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfActivity(OclUndefined, a.Scheme, a.Host))).notEmpty() then
			                   ASAMM!Activity.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfActivity(OclUndefined, a.Scheme, a.Host))).flatten()->collect(c | thisModule.createTargetComponentForActivity(c))
						 else
						 	OclUndefined
						 endif
	                    else
							if not self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then------data of intent has DataType
			                    if ASAMM!Activity.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfActivity(a.DataType, OclUndefined, OclUndefined))).notEmpty() then
			                      ASAMM!Activity.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfActivity(a.DataType, OclUndefined, OclUndefined)))->collect(c | thisModule.createTargetComponentForActivity(c))
                                else
			                      OclUndefined
						         endif
							else
								if self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then------data of intent has scheme
			                        if ASAMM!Activity.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfActivity(OclUndefined, a.Scheme, OclUndefined))).notEmpty() then
			                           ASAMM!Activity.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfActivity(OclUndefined, a.Scheme, OclUndefined)))->collect(c | thisModule.createTargetComponentForActivity(c))
			                        else
			                            OclUndefined
								    endif
								else
									if self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has host---so consider just action
			                         ASAMM!Activity.allInstances()->select(c | not c.filters.oclIsUndefined())->flatten()->collect(c | thisModule.createTargetComponentForActivity(c))
			                        --OclUndefined
									 else
								      OclUndefined
									endif
								endif
						    endif
						endif
				    endif
				endif
			endif
	    else
	     OclUndefined
	    endif
	else
	OclUndefined
    endif	
else
OclUndefined
endif;

---test Action and Data for Activity:
helper context ASAMM!Intent def:TestDataForService:Sequence(ASAMM!Service)=
if ASAMM!Component.allInstances()->select(c | not c.oclIsTypeOf(ASAMM!ContentProvider)).notEmpty() then
    if ASAMM!Service.allInstances()->select(c | not c.filters.oclIsUndefined()).notEmpty() then
        if ASAMM!Service.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).notEmpty() then
	        if not self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then---data of intent has DataType and scheme and host
				if ASAMM!Service.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined()))->flatten()->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfService(a.DataType, a.Scheme, a.Host))).notEmpty() then
			        ASAMM!Service.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfService(a.DataType, a.Scheme, a.Host)))->collect(c | thisModule.createTargetComponentForService(c))
			    else
			      OclUndefined
				endif
            else
	      	    if not self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then---data of intent has DataType and scheme
			        if ASAMM!Service.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfService(a.DataType, a.Scheme, OclUndefined))).notEmpty() then
			            ASAMM!Service.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfService(a.DataType, a.Scheme, OclUndefined)))->collect(c | thisModule.createTargetComponentForService(c))
			        else
			          OclUndefined
					endif
				else
			  	    if not self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has DataType and host-----so check only datatype
			            if ASAMM!Service.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfService(a.DataType, OclUndefined, OclUndefined))).notEmpty() then
			               ASAMM!Service.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfService(a.DataType, OclUndefined, OclUndefined)))->collect(c | thisModule.createTargetComponentForService(c))
			            else
			            OclUndefined
						endif
                    else
				   	    if self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has scheme and host
			              if ASAMM!Service.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfService(OclUndefined, a.Scheme, a.Host))).notEmpty() then
			                   ASAMM!Service.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfService(OclUndefined, a.Scheme, a.Host))).flatten()->collect(c | thisModule.createTargetComponentForService(c))
						 else
						 	OclUndefined
						 endif
	                    else
							if not self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then------data of intent has DataType
			                    if ASAMM!Service.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfService(a.DataType, OclUndefined, OclUndefined))).notEmpty() then
			                      ASAMM!Service.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfService(a.DataType, OclUndefined, OclUndefined)))->collect(c | thisModule.createTargetComponentForService(c))
                                else
			                      OclUndefined
						         endif
							else
								if self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then------data of intent has scheme
			                        if ASAMM!Service.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfService(OclUndefined, a.Scheme, OclUndefined))).notEmpty() then
			                           ASAMM!Service.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfService(OclUndefined, a.Scheme, OclUndefined)))->collect(c | thisModule.createTargetComponentForService(c))
			                        else
			                            OclUndefined
								    endif
								else
									if self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has host---so consider just action
			                         ASAMM!Service.allInstances()->select(c | not c.filters.oclIsUndefined())->flatten()->collect(c | thisModule.createTargetComponentForService(c))
			                        --OclUndefined
									 else
								      OclUndefined
									endif
								endif
						    endif
						endif
				    endif
				endif
			endif
	    else
	     OclUndefined
	    endif
	else
	OclUndefined
    endif	
else
OclUndefined
endif;
	
---test Action and Data for Receiver:
helper context ASAMM!Intent def:TestDataForReceiver:Sequence(ASAMM!BroadcastReceiver)=
if ASAMM!Component.allInstances()->select(c | not c.oclIsTypeOf(ASAMM!ContentProvider)).notEmpty() then
    if ASAMM!BroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined()).notEmpty() then
        if ASAMM!BroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).notEmpty() then
	        if not self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then---data of intent has DataType and scheme and host
				if ASAMM!BroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined()))->flatten()->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(a.DataType, a.Scheme, a.Host))).notEmpty() then
			        ASAMM!BroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(a.DataType, a.Scheme, a.Host)))->flatten()
			    else
			      OclUndefined
				endif
            else
	      	    if not self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then---data of intent has DataType and scheme
			        if ASAMM!BroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(a.DataType, a.Scheme, OclUndefined))).notEmpty() then
			            ASAMM!BroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(a.DataType, a.Scheme, OclUndefined)))->flatten()
			        else
			          OclUndefined
					endif
				else
			  	    if not self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has DataType and host-----so check only datatype
			            if ASAMM!BroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(a.DataType, OclUndefined, OclUndefined))).notEmpty() then
			               ASAMM!BroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(a.DataType, OclUndefined, OclUndefined)))->flatten()
			            else
			            OclUndefined
						endif
                    else
				   	    if self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has scheme and host
			              if ASAMM!BroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(OclUndefined, a.Scheme, a.Host))).notEmpty() then
			                   ASAMM!BroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(OclUndefined, a.Scheme, a.Host))).flatten()->flatten()
						 else
						 	OclUndefined
						 endif
	                    else
							if not self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then------data of intent has DataType
			                    if ASAMM!BroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(a.DataType, OclUndefined, OclUndefined))).notEmpty() then
			                      ASAMM!BroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(a.DataType, OclUndefined, OclUndefined)))->flatten()
                                else
			                      OclUndefined
						         endif
							else
								if self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then------data of intent has scheme
			                        if ASAMM!BroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(OclUndefined, a.Scheme, OclUndefined))).notEmpty() then
			                           ASAMM!BroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(OclUndefined, a.Scheme, OclUndefined)))->flatten()
			                        else
			                            OclUndefined
								    endif
								else
									if self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has host---so consider just action
			                         ASAMM!BroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined())->flatten()
			                        --OclUndefined
									 else
								      OclUndefined
									endif
								endif
						    endif
						endif
				    endif
				endif
			endif
	    else
	     OclUndefined
	    endif
	else
	OclUndefined
    endif	
else
OclUndefined
endif;

---test Action and Data for DynamicReceiver:
helper context ASAMM!Intent def:TestDataForDynamicReceiver:Sequence(ASAMM!DynamicRegisteredBroadcastReceiver)=
if ASAMM!DynamicRegisteredComponent.allInstances().notEmpty() then
    if ASAMM!DynamicRegisteredBroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined()).notEmpty() then
        if ASAMM!DynamicRegisteredBroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).notEmpty() then
	        if not self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then---data of intent has DataType and scheme and host
				if ASAMM!DynamicRegisteredBroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined()))->flatten()->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(a.DataType, a.Scheme, a.Host))).notEmpty() then
			        ASAMM!DynamicRegisteredBroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(a.DataType, a.Scheme, a.Host)))->flatten()
			    else
			      OclUndefined
				endif
            else
	      	    if not self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then---data of intent has DataType and scheme
			        if ASAMM!DynamicRegisteredBroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(a.DataType, a.Scheme, OclUndefined))).notEmpty() then
			            ASAMM!DynamicRegisteredBroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(a.DataType, a.Scheme, OclUndefined)))->flatten()
			        else
			          OclUndefined
					endif
				else
			  	    if not self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has DataType and host-----so check only datatype
			            if ASAMM!DynamicRegisteredBroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(a.DataType, OclUndefined, OclUndefined))).notEmpty() then
			               ASAMM!DynamicRegisteredBroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(a.DataType, OclUndefined, OclUndefined)))->flatten()
			            else
			            OclUndefined
						endif
                    else
				   	    if self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has scheme and host
			              if ASAMM!DynamicRegisteredBroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(OclUndefined, a.Scheme, a.Host))).notEmpty() then
			                   ASAMM!DynamicRegisteredBroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(OclUndefined, a.Scheme, a.Host))).flatten()->flatten()
						 else
						 	OclUndefined
						 endif
	                    else
							if not self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then------data of intent has DataType
			                    if ASAMM!DynamicRegisteredBroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(a.DataType, OclUndefined, OclUndefined))).notEmpty() then
			                      ASAMM!DynamicRegisteredBroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(a.DataType, OclUndefined, OclUndefined)))->flatten()
                                else
			                      OclUndefined
						         endif
							else
								if self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then------data of intent has scheme
			                        if ASAMM!DynamicRegisteredBroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(OclUndefined, a.Scheme, OclUndefined))).notEmpty() then
			                           ASAMM!DynamicRegisteredBroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(OclUndefined, a.Scheme, OclUndefined)))->flatten()
			                        else
			                            OclUndefined
								    endif
								else
									if self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has host---so consider just action
			                         ASAMM!DynamicRegisteredBroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined())->flatten()
			                        --OclUndefined
									 else
								      OclUndefined
									endif
								endif
						    endif
						endif
				    endif
				endif
			endif
	    else
	     OclUndefined
	    endif
	else
	OclUndefined
    endif	
else
OclUndefined
endif;
	
-----------------teast Action and Category and Data--------------------------
---test Action and Category and Data for Activity:
helper context ASAMM!Intent def:TestActionAndCategoryAndDataForActivity:Sequence(ASAMM!Activity)=
if ASAMM!Component.allInstances()->select(c | not c.oclIsTypeOf(ASAMM!ContentProvider)).notEmpty() then
    if ASAMM!Activity.allInstances()->select(c | not c.filters.oclIsUndefined()).notEmpty() then
        if ASAMM!Activity.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.actions.oclIsUndefined() and not d.data.oclIsUndefined())).notEmpty() then
	        if not thisModule.stringOfIntentAction2FilterAction.get(self.Action).oclIsUndefined() then
			   if not thisModule.IdentifyReceiverComponentActivity(thisModule.stringOfIntentAction2FilterAction.get(self.Action)).oclIsUndefined() then
				    if not self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then---data of intent has DataType and scheme and host
				        if thisModule.IdentifyReceiverComponentActivity(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfActivity(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfActivity(a.DataType, a.Scheme, a.Host))).notEmpty() then
			            thisModule.IdentifyReceiverComponentActivity(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfActivity(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfActivity(a.DataType, a.Scheme, a.Host)))->collect(c | thisModule.createTargetComponentForActivity(c))
			           else
			             OclUndefined
					    endif
                    else
	      	            if not self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then---data of intent has DataType and scheme
			                if thisModule.IdentifyReceiverComponentActivity(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfActivity(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfActivity(a.DataType, a.Scheme, OclUndefined))).notEmpty() then
			                 thisModule.IdentifyReceiverComponentActivity(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfActivity(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfActivity(a.DataType, a.Scheme, OclUndefined)))->collect(c | thisModule.createTargetComponentForActivity(c))
			                else
			                OclUndefined
					        endif
				        else
			  	            if not self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has DataType and host-----so check only datatype
			                    if thisModule.IdentifyReceiverComponentActivity(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfActivity(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfActivity(a.DataType, OclUndefined, OclUndefined))).notEmpty() then
			                    thisModule.IdentifyReceiverComponentActivity(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfActivity(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfActivity(a.DataType, OclUndefined, OclUndefined)))->collect(c | thisModule.createTargetComponentForActivity(c))
			                    else
			                    OclUndefined
							    endif
                            else
				   	            if self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has scheme and host
			                        if thisModule.IdentifyReceiverComponentActivity(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfActivity(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfActivity(OclUndefined, a.Scheme, a.Host))).notEmpty() then
			                         thisModule.IdentifyReceiverComponentActivity(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfActivity(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfActivity(OclUndefined, a.Scheme, a.Host))).flatten()->collect(c | thisModule.createTargetComponentForActivity(c))
			                         else
			                   	    OclUndefined
							         endif
	                            else
							        if not self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then------data of intent has DataType
			                            if thisModule.IdentifyReceiverComponentActivity(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfActivity(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfActivity(a.DataType, OclUndefined, OclUndefined))).notEmpty() then
			                            thisModule.IdentifyReceiverComponentActivity(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfActivity(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfActivity(a.DataType, OclUndefined, OclUndefined)))->collect(c | thisModule.createTargetComponentForActivity(c))
                                        else
			                            OclUndefined
						                endif
							        else
								        if self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then------data of intent has scheme
			                                if thisModule.IdentifyReceiverComponentActivity(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfActivity(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfActivity(OclUndefined, a.Scheme, OclUndefined))).notEmpty() then
			                                  thisModule.IdentifyReceiverComponentActivity(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfActivity(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfActivity(OclUndefined, a.Scheme, OclUndefined)))->collect(c | thisModule.createTargetComponentForActivity(c))
			                                else
			                                OclUndefined
										    endif
								        else
									        if self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has host---so consider just action
			                                 thisModule.IdentifyReceiverComponentActivity(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->collect(c | thisModule.createTargetComponentForActivity(c))
			                                else
										     OclUndefined
									        endif
								        endif
								    endif
						        endif
						    endif
					    endif
			         endif
			    else
				OclUndefined
				endif
			else
		        if not thisModule.IdentifyReceiverComponentActivity(self.Action).oclIsUndefined() then
	                if not self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then---data of intent has DataType and scheme and host
				       if thisModule.IdentifyReceiverComponentActivity(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfActivity(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfActivity(a.DataType, a.Scheme, a.Host))).notEmpty() then
			              thisModule.IdentifyReceiverComponentActivity(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfActivity(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfActivity(a.DataType, a.Scheme, a.Host)))->collect(c | thisModule.createTargetComponentForActivity(c))
			          else
                     OclUndefined
			          endif
                    else
	      	            if not self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then---data of intent has DataType and scheme
			                  if thisModule.IdentifyReceiverComponentActivity(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfActivity(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfActivity(a.DataType, a.Scheme, OclUndefined))).notEmpty() then
			                   thisModule.IdentifyReceiverComponentActivity(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfActivity(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfActivity(a.DataType, a.Scheme, OclUndefined)))->collect(c | thisModule.createTargetComponentForActivity(c))
			                  else
			                  OclUndefined
					          endif
				        else
			  	            if not self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has DataType and host-----so check only datatype
			                    if thisModule.IdentifyReceiverComponentActivity(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfActivity(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfActivity(a.DataType, OclUndefined, OclUndefined))).notEmpty() then
			                      thisModule.IdentifyReceiverComponentActivity(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfActivity(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfActivity(a.DataType, OclUndefined, OclUndefined)))->collect(c | thisModule.createTargetComponentForActivity(c))
			                    else
			                       OclUndefined
								endif
                            else
				   	            if self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has scheme and host
			                       if thisModule.IdentifyReceiverComponentActivity(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfActivity(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfActivity(OclUndefined, a.Scheme, a.Host))).notEmpty() then
			                       thisModule.IdentifyReceiverComponentActivity(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfActivity(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfActivity(OclUndefined, a.Scheme, a.Host))).flatten()->collect(c | thisModule.createTargetComponentForActivity(c))
			  
								  else
			                   	     OclUndefined
							       endif
	                            else
							        if not self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then------data of intent has DataType
			                            if thisModule.IdentifyReceiverComponentActivity(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfActivity(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfActivity(a.DataType, OclUndefined, OclUndefined))).notEmpty() then
			                               thisModule.IdentifyReceiverComponentActivity(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfActivity(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfActivity(a.DataType, OclUndefined, OclUndefined)))->collect(c | thisModule.createTargetComponentForActivity(c))
			                            else
			                             OclUndefined
										endif
							        else
								        if self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then------data of intent has scheme
			                               if thisModule.IdentifyReceiverComponentActivity(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfActivity(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfActivity(OclUndefined, a.Scheme, OclUndefined))).notEmpty() then
			                               thisModule.IdentifyReceiverComponentActivity(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfActivity(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfActivity(OclUndefined, a.Scheme, OclUndefined)))->collect(c | thisModule.createTargetComponentForActivity(c))
			                               else
			                                OclUndefined
										    endif
								        else
									    	if self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has host---so consider just action
			                                 thisModule.IdentifyReceiverComponentActivity(self.Action)->flatten()->collect(c | thisModule.createTargetComponentForActivity(c))
			                               
									        else
										    OclUndefined
									        endif
								        endif
								    endif
						        endif
						    endif
					    endif
			        endif
			    else
			   OclUndefined
			    endif
		    endif	    
        else
         OclUndefined
	    endif
	else
         OclUndefined
	endif
else
OclUndefined
endif;

---test Action and Category and Data for Service:
helper context ASAMM!Intent def:TestActionAndCategoryAndDataForService:Sequence(ASAMM!Service)=
if ASAMM!Component.allInstances()->select(c | not c.oclIsTypeOf(ASAMM!ContentProvider)).notEmpty() then
    if ASAMM!Service.allInstances()->select(c | not c.filters.oclIsUndefined()).notEmpty() then
        if ASAMM!Service.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.actions.oclIsUndefined() and not d.data.oclIsUndefined())).notEmpty() then
	        if not thisModule.stringOfIntentAction2FilterAction.get(self.Action).oclIsUndefined() then
			   if not thisModule.IdentifyReceiverComponentService(thisModule.stringOfIntentAction2FilterAction.get(self.Action)).oclIsUndefined() then
				    if not self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then---data of intent has DataType and scheme and host
				        if thisModule.IdentifyReceiverComponentService(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfService(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfService(a.DataType, a.Scheme, a.Host))).notEmpty() then
			            thisModule.IdentifyReceiverComponentService(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfService(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfService(a.DataType, a.Scheme, a.Host)))->collect(c | thisModule.createTargetComponentForService(c))
			           else
			             OclUndefined
					    endif
                    else
	      	            if not self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then---data of intent has DataType and scheme
			                if thisModule.IdentifyReceiverComponentService(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfService(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfService(a.DataType, a.Scheme, OclUndefined))).notEmpty() then
			                 thisModule.IdentifyReceiverComponentService(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfService(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfService(a.DataType, a.Scheme, OclUndefined)))->collect(c | thisModule.createTargetComponentForService(c))
			                else
			                OclUndefined
					        endif
				        else
			  	            if not self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has DataType and host-----so check only datatype
			                    if thisModule.IdentifyReceiverComponentService(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfService(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfService(a.DataType, OclUndefined, OclUndefined))).notEmpty() then
			                    thisModule.IdentifyReceiverComponentService(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfService(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfService(a.DataType, OclUndefined, OclUndefined)))->collect(c | thisModule.createTargetComponentForService(c))
			                    else
			                    OclUndefined
							    endif
                            else
				   	            if self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has scheme and host
			                        if thisModule.IdentifyReceiverComponentService(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfService(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfService(OclUndefined, a.Scheme, a.Host))).notEmpty() then
			                         thisModule.IdentifyReceiverComponentService(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfService(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfService(OclUndefined, a.Scheme, a.Host))).flatten()->collect(c | thisModule.createTargetComponentForService(c))
			                         else
			                   	    OclUndefined
							         endif
	                            else
							        if not self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then------data of intent has DataType
			                            if thisModule.IdentifyReceiverComponentService(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfService(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfService(a.DataType, OclUndefined, OclUndefined))).notEmpty() then
			                            thisModule.IdentifyReceiverComponentService(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfService(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfService(a.DataType, OclUndefined, OclUndefined)))->collect(c | thisModule.createTargetComponentForService(c))
                                        else
			                            OclUndefined
						                endif
							        else
								        if self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then------data of intent has scheme
			                                if thisModule.IdentifyReceiverComponentService(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfService(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfService(OclUndefined, a.Scheme, OclUndefined))).notEmpty() then
			                                  thisModule.IdentifyReceiverComponentService(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfService(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfService(OclUndefined, a.Scheme, OclUndefined)))->collect(c | thisModule.createTargetComponentForService(c))
			                                else
			                                OclUndefined
										    endif
								        else
									        if self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has host---so consider just action
			                                 thisModule.IdentifyReceiverComponentService(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->collect(c | thisModule.createTargetComponentForService(c))
			                                else
										     OclUndefined
									        endif
								        endif
								    endif
						        endif
						    endif
					    endif
			         endif
			    else
				OclUndefined
				endif
			else
		        if not thisModule.IdentifyReceiverComponentService(self.Action).oclIsUndefined() then
	                if not self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then---data of intent has DataType and scheme and host
				       if thisModule.IdentifyReceiverComponentService(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfService(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfService(a.DataType, a.Scheme, a.Host))).notEmpty() then
			              thisModule.IdentifyReceiverComponentService(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfService(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfService(a.DataType, a.Scheme, a.Host)))->collect(c | thisModule.createTargetComponentForService(c))
			          else
                     OclUndefined
			          endif
                    else
	      	            if not self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then---data of intent has DataType and scheme
			                  if thisModule.IdentifyReceiverComponentService(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfService(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfService(a.DataType, a.Scheme, OclUndefined))).notEmpty() then
			                   thisModule.IdentifyReceiverComponentService(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfService(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfService(a.DataType, a.Scheme, OclUndefined)))->collect(c | thisModule.createTargetComponentForService(c))
			                  else
			                  OclUndefined
					          endif
				        else
			  	            if not self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has DataType and host-----so check only datatype
			                    if thisModule.IdentifyReceiverComponentService(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfService(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfService(a.DataType, OclUndefined, OclUndefined))).notEmpty() then
			                      thisModule.IdentifyReceiverComponentService(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfService(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfService(a.DataType, OclUndefined, OclUndefined)))->collect(c | thisModule.createTargetComponentForService(c))
			                    else
			                       OclUndefined
								endif
                            else
				   	            if self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has scheme and host
			                       if thisModule.IdentifyReceiverComponentService(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfService(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfService(OclUndefined, a.Scheme, a.Host))).notEmpty() then
			                       thisModule.IdentifyReceiverComponentService(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfService(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfService(OclUndefined, a.Scheme, a.Host))).flatten()->collect(c | thisModule.createTargetComponentForService(c))
			  
								  else
			                   	     OclUndefined
							       endif
	                            else
							        if not self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then------data of intent has DataType
			                            if thisModule.IdentifyReceiverComponentService(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfService(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfService(a.DataType, OclUndefined, OclUndefined))).notEmpty() then
			                               thisModule.IdentifyReceiverComponentService(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfService(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfService(a.DataType, OclUndefined, OclUndefined)))->collect(c | thisModule.createTargetComponentForService(c))
			                            else
			                             OclUndefined
										endif
							        else
								        if self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then------data of intent has scheme
			                               if thisModule.IdentifyReceiverComponentService(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfService(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfService(OclUndefined, a.Scheme, OclUndefined))).notEmpty() then
			                               thisModule.IdentifyReceiverComponentService(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfService(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfService(OclUndefined, a.Scheme, OclUndefined)))->collect(c | thisModule.createTargetComponentForService(c))
			                               else
			                                OclUndefined
										    endif
								        else
									    	if self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has host---so consider just action
			                                 thisModule.IdentifyReceiverComponentService(self.Action)->flatten()->collect(c | thisModule.createTargetComponentForService(c))
			                                else
										    OclUndefined
									        endif
								        endif
								    endif
						        endif
						    endif
					    endif
			        endif
			    else
			   OclUndefined
			    endif
		    endif	    
        else
         OclUndefined
	    endif
	else
         OclUndefined
	endif
else
OclUndefined
endif;

---test Action and Category and Data for Receiver:
helper context ASAMM!Intent def:TestActionAndCategoryAndDataForReceiver:Sequence(ASAMM!BroadcastReceiver)=
if ASAMM!Component.allInstances()->select(c | not c.oclIsTypeOf(ASAMM!ContentProvider)).notEmpty() then
    if ASAMM!BroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined()).notEmpty() then
        if ASAMM!BroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.actions.oclIsUndefined() and not d.data.oclIsUndefined())).notEmpty() then
	        if not thisModule.stringOfIntentAction2FilterAction.get(self.Action).oclIsUndefined() then
			   if not thisModule.IdentifyReceiverComponentBroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action)).oclIsUndefined() then
				    if not self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then---data of intent has DataType and scheme and host
				        if thisModule.IdentifyReceiverComponentBroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfReceiver(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(a.DataType, a.Scheme, a.Host))).notEmpty() then
			            thisModule.IdentifyReceiverComponentBroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfReceiver(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(a.DataType, a.Scheme, a.Host)))->flatten()
			           else
			             OclUndefined
					    endif
                    else
	      	            if not self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then---data of intent has DataType and scheme
			                if thisModule.IdentifyReceiverComponentBroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfReceiver(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(a.DataType, a.Scheme, OclUndefined))).notEmpty() then
			                 thisModule.IdentifyReceiverComponentBroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfReceiver(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(a.DataType, a.Scheme, OclUndefined)))->flatten()
			                else
			                OclUndefined
					        endif
				        else
			  	            if not self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has DataType and host-----so check only datatype
			                    if thisModule.IdentifyReceiverComponentBroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfReceiver(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(a.DataType, OclUndefined, OclUndefined))).notEmpty() then
			                    thisModule.IdentifyReceiverComponentBroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfReceiver(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(a.DataType, OclUndefined, OclUndefined)))->flatten()
			                    else
			                    OclUndefined
							    endif
                            else
				   	            if self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has scheme and host
			                        if thisModule.IdentifyReceiverComponentBroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfReceiver(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(OclUndefined, a.Scheme, a.Host))).notEmpty() then
			                         thisModule.IdentifyReceiverComponentBroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfReceiver(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(OclUndefined, a.Scheme, a.Host))).flatten()->flatten()
			                         else
			                   	    OclUndefined
							         endif
	                            else
							        if not self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then------data of intent has DataType
			                            if thisModule.IdentifyReceiverComponentBroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfReceiver(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(a.DataType, OclUndefined, OclUndefined))).notEmpty() then
			                            thisModule.IdentifyReceiverComponentBroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfReceiver(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(a.DataType, OclUndefined, OclUndefined)))->flatten()
                                        else
			                            OclUndefined
						                endif
							        else
								        if self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then------data of intent has scheme
			                                if thisModule.IdentifyReceiverComponentBroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfReceiver(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(OclUndefined, a.Scheme, OclUndefined))).notEmpty() then
			                                  thisModule.IdentifyReceiverComponentBroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfReceiver(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(OclUndefined, a.Scheme, OclUndefined)))->flatten()
			                                else
			                                OclUndefined
										    endif
								        else
									        if self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has host---so consider just action
			                                 thisModule.IdentifyReceiverComponentBroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->flatten()
			                                else
										     OclUndefined
									        endif
								        endif
								    endif
						        endif
						    endif
					    endif
			         endif
			    else
				OclUndefined
				endif
			else
		        if not thisModule.IdentifyReceiverComponentBroadcastReceiver(self.Action).oclIsUndefined() then
	                if not self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then---data of intent has DataType and scheme and host
				       if thisModule.IdentifyReceiverComponentBroadcastReceiver(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfReceiver(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(a.DataType, a.Scheme, a.Host))).notEmpty() then
			              thisModule.IdentifyReceiverComponentBroadcastReceiver(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfReceiver(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(a.DataType, a.Scheme, a.Host)))->flatten()
			          else
                     OclUndefined
			          endif
                    else
	      	            if not self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then---data of intent has DataType and scheme
			                  if thisModule.IdentifyReceiverComponentBroadcastReceiver(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfReceiver(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(a.DataType, a.Scheme, OclUndefined))).notEmpty() then
			                   thisModule.IdentifyReceiverComponentBroadcastReceiver(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfReceiver(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(a.DataType, a.Scheme, OclUndefined)))->flatten()
			                  else
			                  OclUndefined
					          endif
				        else
			  	            if not self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has DataType and host-----so check only datatype
			                    if thisModule.IdentifyReceiverComponentBroadcastReceiver(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfReceiver(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(a.DataType, OclUndefined, OclUndefined))).notEmpty() then
			                      thisModule.IdentifyReceiverComponentBroadcastReceiver(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfReceiver(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(a.DataType, OclUndefined, OclUndefined)))->flatten()
			                    else
			                       OclUndefined
								endif
                            else
				   	            if self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has scheme and host
			                       if thisModule.IdentifyReceiverComponentBroadcastReceiver(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfReceiver(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(OclUndefined, a.Scheme, a.Host))).notEmpty() then
			                       thisModule.IdentifyReceiverComponentBroadcastReceiver(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfReceiver(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(OclUndefined, a.Scheme, a.Host))).flatten()->flatten()
			  
								  else
			                   	     OclUndefined
							       endif
	                            else
							        if not self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then------data of intent has DataType
			                            if thisModule.IdentifyReceiverComponentBroadcastReceiver(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfReceiver(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(a.DataType, OclUndefined, OclUndefined))).notEmpty() then
			                               thisModule.IdentifyReceiverComponentBroadcastReceiver(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfReceiver(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(a.DataType, OclUndefined, OclUndefined)))->flatten()
			                            else
			                             OclUndefined
										endif
							        else
								        if self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then------data of intent has scheme
			                               if thisModule.IdentifyReceiverComponentBroadcastReceiver(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfReceiver(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(OclUndefined, a.Scheme, OclUndefined))).notEmpty() then
			                               thisModule.IdentifyReceiverComponentBroadcastReceiver(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfReceiver(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfReceiver(OclUndefined, a.Scheme, OclUndefined)))->flatten()
			                               else
			                                OclUndefined
										    endif
								        else
									    	if self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has host---so consider just action
			                                 thisModule.IdentifyReceiverComponentBroadcastReceiver(self.Action)->flatten()->flatten()
			                                else
										    OclUndefined
									        endif
								        endif
								    endif
						        endif
						    endif
					    endif
			        endif
			    else
			   OclUndefined
			    endif
		    endif	    
        else
         OclUndefined
	    endif
	else
         OclUndefined
	endif
else
OclUndefined
endif;

---test Action and Category and Data for DynamicReceiver:
helper context ASAMM!Intent def:TestActionAndCategoryAndDataForDynamicReceiver:Sequence(ASAMM!DynamicRegisteredBroadcastReceiver)=
if ASAMM!DynamicRegisteredComponent.allInstances().notEmpty() then
    if ASAMM!DynamicRegisteredBroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined()).notEmpty() then
        if ASAMM!DynamicRegisteredBroadcastReceiver.allInstances()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.actions.oclIsUndefined() and not d.data.oclIsUndefined())).notEmpty() then
	        if not thisModule.stringOfIntentAction2FilterAction.get(self.Action).oclIsUndefined() then
			   if not thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action)).oclIsUndefined() then
				    if not self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then---data of intent has DataType and scheme and host
				        if thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfDynamicReceiver(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(a.DataType, a.Scheme, a.Host))).notEmpty() then
			            thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfDynamicReceiver(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(a.DataType, a.Scheme, a.Host)))->flatten()
			           else
			             OclUndefined
					    endif
                    else
	      	            if not self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then---data of intent has DataType and scheme
			                if thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfDynamicReceiver(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(a.DataType, a.Scheme, OclUndefined))).notEmpty() then
			                 thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfDynamicReceiver(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(a.DataType, a.Scheme, OclUndefined)))->flatten()
			                else
			                OclUndefined
					        endif
				        else
			  	            if not self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has DataType and host-----so check only datatype
			                    if thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfDynamicReceiver(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(a.DataType, OclUndefined, OclUndefined))).notEmpty() then
			                    thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfDynamicReceiver(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(a.DataType, OclUndefined, OclUndefined)))->flatten()
			                    else
			                    OclUndefined
							    endif
                            else
				   	            if self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has scheme and host
			                        if thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfDynamicReceiver(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(OclUndefined, a.Scheme, a.Host))).notEmpty() then
			                         thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfDynamicReceiver(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(OclUndefined, a.Scheme, a.Host))).flatten()->flatten()
			                         else
			                   	    OclUndefined
							         endif
	                            else
							        if not self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then------data of intent has DataType
			                            if thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfDynamicReceiver(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(a.DataType, OclUndefined, OclUndefined))).notEmpty() then
			                            thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfDynamicReceiver(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(a.DataType, OclUndefined, OclUndefined)))->flatten()
                                        else
			                            OclUndefined
						                endif
							        else
								        if self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then------data of intent has scheme
			                                if thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfDynamicReceiver(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(OclUndefined, a.Scheme, OclUndefined))).notEmpty() then
			                                  thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfDynamicReceiver(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(OclUndefined, a.Scheme, OclUndefined)))->flatten()
			                                else
			                                OclUndefined
										    endif
								        else
									        if self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has host---so consider just action
			                                 thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(thisModule.stringOfIntentAction2FilterAction.get(self.Action))->flatten()->flatten()
			                                else
										     OclUndefined
									        endif
								        endif
								    endif
						        endif
						    endif
					    endif
			         endif
			    else
				OclUndefined
				endif
			else
		        if not thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(self.Action).oclIsUndefined() then
	                if not self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then---data of intent has DataType and scheme and host
				       if thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfDynamicReceiver(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(a.DataType, a.Scheme, a.Host))).notEmpty() then
			              thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfDynamicReceiver(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(a.DataType, a.Scheme, a.Host)))->flatten()
			          else
                     OclUndefined
			          endif
                    else
	      	            if not self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then---data of intent has DataType and scheme
			                  if thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfDynamicReceiver(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(a.DataType, a.Scheme, OclUndefined))).notEmpty() then
			                   thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfDynamicReceiver(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(a.DataType, a.Scheme, OclUndefined)))->flatten()
			                  else
			                  OclUndefined
					          endif
				        else
			  	            if not self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has DataType and host-----so check only datatype
			                    if thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfDynamicReceiver(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(a.DataType, OclUndefined, OclUndefined))).notEmpty() then
			                      thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfDynamicReceiver(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(a.DataType, OclUndefined, OclUndefined)))->flatten()
			                    else
			                       OclUndefined
								endif
                            else
				   	            if self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has scheme and host
			                       if thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfDynamicReceiver(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(OclUndefined, a.Scheme, a.Host))).notEmpty() then
			                       thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfDynamicReceiver(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(OclUndefined, a.Scheme, a.Host))).flatten()->flatten()
			  
								  else
			                   	     OclUndefined
							       endif
	                            else
							        if not self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then------data of intent has DataType
			                            if thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfDynamicReceiver(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(a.DataType, OclUndefined, OclUndefined))).notEmpty() then
			                               thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfDynamicReceiver(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(a.DataType, OclUndefined, OclUndefined)))->flatten()
			                            else
			                             OclUndefined
										endif
							        else
								        if self.data.first().DataType.oclIsUndefined() and not self.data.first().Scheme.oclIsUndefined() and self.data.first().Host.oclIsUndefined() then------data of intent has scheme
			                               if thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfDynamicReceiver(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(OclUndefined, a.Scheme, OclUndefined))).notEmpty() then
			                               thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(self.Action)->flatten()->select(c | not c.filters.oclIsUndefined())->select(c | c.filters->exists(d | not d.categories.oclIsUndefined() and not d.data.oclIsUndefined())).flatten()->select(c | not self.categories->select(a |   c.notExistInCategoryOfDynamicReceiver(a.Name.toString())).notEmpty())->select(c | self.data->exists(a |   c.ExistInDataOfDynamicReceiver(OclUndefined, a.Scheme, OclUndefined)))->flatten()
			                               else
			                                OclUndefined
										    endif
								        else
									    	if self.data.first().DataType.oclIsUndefined() and self.data.first().Scheme.oclIsUndefined() and not self.data.first().Host.oclIsUndefined() then------data of intent has host---so consider just action
			                                 thisModule.IdentifyReceiverComponent_In_DynamicRegistered_BroadcastReceiver(self.Action)->flatten()->flatten()
			                                else
										    OclUndefined
									        endif
								        endif
								    endif
						        endif
						    endif
					    endif
			        endif
			    else
			   OclUndefined
			    endif
		    endif	    
        else
         OclUndefined
	    endif
	else
         OclUndefined
	endif
else
OclUndefined
endif;
  
helper context OclAny def:getActivityReceiverCompForExplicitIntent(NameComp:String):ASAMM!Activity=
if not NameComp.oclIsUndefined() then
   if ASAMM!Activity.allInstances()->select(c | c.Name.endsWith(NameComp)).notEmpty() then
	   ASAMM!Activity.allInstances()->select(c | c.Name.endsWith(NameComp)).first()
   else
   	OclUndefined
   endif
else
     OclUndefined
endif
;

helper context OclAny def:getServiceReceiverCompForExplicitIntent(NameComp:String):ASAMM!Service=
if not NameComp.oclIsUndefined() then
   if ASAMM!Service.allInstances()->select(c | c.Name.endsWith(NameComp)).notEmpty() then
	   ASAMM!Service.allInstances()->select(c | c.Name.endsWith(NameComp)).first()
   else
   	OclUndefined
   endif
else
		OclUndefined
endif;

helper context OclAny def:getContainerForApplicationPolicyFile:ASAMM!ApplicationPolicyFile=
if self.oclIsTypeOf(ASAMM!ApplicationPolicyFile) then
 self
else
	self.refImmediateComposite().getContainerForApplicationPolicyFile
endif;

helper context OclAny def:getBroadcastReceiverCompForExplicitIntent(NameComp:String):ASAMM!BroadcastReceiver=
if not NameComp.oclIsUndefined() then
  if ASAMM!BroadcastReceiver.allInstances()->select(c | c.Name.endsWith(NameComp)).notEmpty() then
  ASAMM!BroadcastReceiver.allInstances()->select(c | c.Name.endsWith(NameComp)).first() 
  else
	  if ASAMM!BroadcastReceiver.allInstances()->select(c | (c.getContainerForApplicationPolicyFile.Package + c.Name).endsWith(NameComp)).notEmpty() then
	  ASAMM!BroadcastReceiver.allInstances()->select(c | (c.getContainerForApplicationPolicyFile.Package + c.Name).endsWith(NameComp)).first()
      else
		OclUndefined
	  endif
  endif
else
	OclUndefined
endif;


helper context OclAny def:getDynamicBroadcastReceiverCompForExplicitIntent(NameComp:String):ASAMM!DynamicRegisteredBroadcastReceiver=
if not NameComp.oclIsUndefined() then
   if ASAMM!DynamicRegisteredBroadcastReceiver.allInstances()->select(c | c.Name.endsWith(NameComp)).notEmpty() then
	   ASAMM!DynamicRegisteredBroadcastReceiver.allInstances()->select(c | c.Name.endsWith(NameComp)).first()
   else
		OclUndefined
   endif
else
	OclUndefined
endif;

helper context OclAny def:getAllExplicitIntent:Sequence(ASAMM!Intent)=
	if ASAMM!Intent.allInstances()->select(c | c.IntentKind=#Explicit).notEmpty() then
	    ASAMM!Intent.allInstances()->select(c | c.IntentKind=#Explicit)->flatten()
	else
		OclUndefined
	endif;

helper context OclAny def:getAllImplicitIntent:Sequence(ASAMM!Intent)=
	if ASAMM!Intent.allInstances()->select(c | c.IntentKind=#Implicit).notEmpty() then
	    ASAMM!Intent.allInstances()->select(c | c.IntentKind=#Implicit)->flatten()
	else
		OclUndefined
	endif;

  

helper context OclAny def:AllApp:Sequence(ASAMM!Application)=
	ASAMM!Application.allInstances();

-----for CompPermission------
helper context OclAny def:getAppCompPermissions:Sequence(ASAMM!AppCompPermission)=
if ASAMM!AppCompPermission.allInstances().notEmpty() then
  ASAMM!AppCompPermission.allInstances().flatten()
else
  OclUndefined
endif;


----for CompUsesPermission----

helper context OclAny def:getAllAPIPermissions:Sequence(ASAMM!APIPermission)=
if ASAMM!APIPermission.allInstances().notEmpty() then
  ASAMM!APIPermission.allInstances().flatten()
else
  OclUndefined
endif;


--------------------------------------------------------------------------------------------------------------------------------
-------For Data Access----------
helper context OclAny def:getAllDataAccessCommunications:Sequence(ASAMM!ContentURIrequest)=
if ASAMM!ContentURIrequest.allInstances()->select(c | c.RequestType=#ReadRequest and c.RequestType=#ReadOrManipulationRequest).notEmpty() then
  ASAMM!ContentURIrequest.allInstances()->select(c | c.RequestType=#ReadRequest and c.RequestType=#ReadOrManipulationRequest).flatten()
else
	if ASAMM!ContentURIrequest.allInstances()->select(c | c.RequestType=#ReadRequest).notEmpty() then
	  ASAMM!ContentURIrequest.allInstances()->select(c | c.RequestType=#ReadRequest).flatten()
	else
	   if ASAMM!ContentURIrequest.allInstances()->select(c | c.RequestType=#ReadOrManipulationRequest).notEmpty() then
	     ASAMM!ContentURIrequest.allInstances()->select(c | c.RequestType=#ReadOrManipulationRequest).flatten()
	   else
	   	OclUndefined
	   endif
	endif
endif;


helper context OclAny def: getReceiverProviderForSpecificURIrequest (uri_value : String, package_name : String) : ASAMM!ContentProvider =
if ASAMM!ContentProvider.allInstances().notEmpty()  then
   if ASAMM!ContentProvider.allInstances()->select(c | c.Exported=true).notEmpty() then
     if ASAMM!ContentProvider.allInstances()->select(c | c.Exported=true ) ->select(c | uri_value.toString().startsWith('content://' + c.authority.toString())).notEmpty() then
	   ASAMM!ContentProvider.allInstances()->select(c | c.Exported=true ) ->select(c | uri_value.startsWith('content://' + c.authority)).first() 
      else
	  	OclUndefined
	  endif
   else
	 	if ASAMM!ContentProvider.allInstances()->select(c | c.Exported=false ) ->select(c | uri_value.toString().startsWith('content://' + c.authority.toString())).notEmpty() then
		   if ASAMM!ContentProvider.allInstances()->select(c | c.Exported=false ) ->select(c | uri_value.toString().startsWith('content://' + c.authority.toString()))->select(c | (c.refImmediateComposite().refImmediateComposite().Package.toString())=(package_name)).notEmpty() then
		    ASAMM!ContentProvider.allInstances()->select(c | c.Exported=false ) ->select(c | uri_value.toString().startsWith('content://' + c.authority.toString()))->select(c | (c.refImmediateComposite().refImmediateComposite().Package.toString())=(package_name)).first()
		   else
		   	OclUndefined
		   endif
		else
			OclUndefined
		endif
      
	  
   endif
else
	OclUndefined
endif   
  ;   
     
--------For Data Manipulation--------
helper context OclAny def:getAllDataManipulationCommunications:Sequence(ASAMM!ContentURIrequest)=
if ASAMM!ContentURIrequest.allInstances()->select(c | c.RequestType=#ManipulationRequest and c.RequestType=#ReadOrManipulationRequest).notEmpty() then
  ASAMM!ContentURIrequest.allInstances()->select(c | c.RequestType=#ManipulationRequest and c.RequestType=#ReadOrManipulationRequest).flatten()
else
	if ASAMM!ContentURIrequest.allInstances()->select(c | c.RequestType=#ManipulationRequest).notEmpty() then
	  ASAMM!ContentURIrequest.allInstances()->select(c | c.RequestType=#ManipulationRequest).flatten()
	else
	   if ASAMM!ContentURIrequest.allInstances()->select(c | c.RequestType=#ReadOrManipulationRequest).notEmpty() then
	     ASAMM!ContentURIrequest.allInstances()->select(c | c.RequestType=#ReadOrManipulationRequest).flatten()
	   else
	   	OclUndefined
	   endif
	endif
endif;


rule CreateInterComponentCommunicationInBundleOfApps {
	
 from
    s:ASAMM!ApplicationPolicyFile (s.Package=ASAMM!ApplicationPolicyFile.allInstances().first().Package)
 to
    t:ICCMM!InterComponentCommunicationInBundleOfApps(

explicit_communications <- 
if not thisModule.getAllExplicitIntent.oclIsUndefined() then
thisModule.getAllExplicitIntent->collect(c | thisModule.CreateExplicitCommunication(c))
else
	OclUndefined
endif,

implicit_communications <-  
if not thisModule.getAllImplicitIntent.oclIsUndefined() then
thisModule.getAllImplicitIntent->collect(c | thisModule.CreateImplicitCommunication(c))
else
OclUndefined
endif,

dataAccess_communications <- 
if not thisModule.getAllDataAccessCommunications.oclIsUndefined() then
   thisModule.getAllDataAccessCommunications->collect(c | thisModule.CreateDataAccessCommunications(c))
else
	OclUndefined
endif,

dataManipulation_communications <- 
if not thisModule.getAllDataManipulationCommunications.oclIsUndefined() then
   thisModule.getAllDataManipulationCommunications->collect(c | thisModule.CreateDataManipulationCommunications(c))
else
	OclUndefined
endif
    )
}

--for ExplicitIntent--
lazy rule CreateExplicitCommunication {
	from
		s:ASAMM!Intent (s.IntentKind=#Explicit)
	to 
		t:ICCMM!ExplicitCommunication(
	
		sender_app <- thisModule.CreateApplicationOne(s.refImmediateComposite().app),

         receiver_app <- 
		 if not s.TargetComponentName.oclIsUndefined() then
		     if not thisModule.getApplicationTwo(s.TargetComponentName).oclIsUndefined() then
		               thisModule.CreateApplicationTwo(thisModule.getApplicationTwo(s.TargetComponentName))
					   --OclUndefined
			else
                       OclUndefined
			endif
		else
			OclUndefined
		endif,
		intent <- thisModule.CreateIntentForExplicitCommunication(s)
		)
}

lazy rule CreateIntentForExplicitCommunication{

	from 
	   s:ASAMM!Intent
	 to
	    t:ICCMM!ExplicitIntent(
	    	Name <- s.Name,
	    	SendComponentName <- s.SendComponentName,
			Receiver <- s.TargetComponentName,
			Action <- s.Action,
	
target_component <- 
if not thisModule.getActivityReceiverCompForExplicitIntent(s.TargetComponentName).oclIsUndefined() then
  thisModule.createReceiverComponentForActivity(thisModule.getActivityReceiverCompForExplicitIntent(s.TargetComponentName))
else
	if not thisModule.getServiceReceiverCompForExplicitIntent(s.TargetComponentName).oclIsUndefined() then
	 thisModule.createReceiverComponentForService(thisModule.getServiceReceiverCompForExplicitIntent(s.TargetComponentName))
    else 
    	if not thisModule.getBroadcastReceiverCompForExplicitIntent(s.TargetComponentName).oclIsUndefined() then
         thisModule.createReceiverComponentForReceiver(thisModule.getBroadcastReceiverCompForExplicitIntent(s.TargetComponentName))
        else 
        	if not thisModule.getDynamicBroadcastReceiverCompForExplicitIntent(s.TargetComponentName).oclIsUndefined() then
             thisModule.createReceiverComponentForDynamicRegisteredReceiver(thisModule.getDynamicBroadcastReceiverCompForExplicitIntent(s.TargetComponentName))
            else
          	OclUndefined
		   endif
		endif
	endif
endif
)

}


lazy rule CreateApplicationOne{
	
from
    s:ASAMM!Application
to
    t:ICCMM!SenderApp(
    	Name <- s.refImmediateComposite().Package,
		usesPermissions <- s.refImmediateComposite().usesPermissions->collect(c | thisModule.CreateUsesPermission(c))
    )

}

lazy rule CreateApplicationTwo{
	
from
    s:ASAMM!Application
to
    t:ICCMM!ReceiverApp(
    	
    	Name <- s.refImmediateComposite().Package,
		Permission <- s.Permission			    
    )

}
---------------------------------------------------------------

--for ImplicitIntent

lazy rule CreateImplicitCommunication {
	from
		s:ASAMM!Intent (s.IntentKind=#Implicit)
	to 
		t:ICCMM!ImplicitCommunication(
	
		intent <- thisModule.CreateIntentForImplicitCommunication(s),
		sender_app <- thisModule.CreateApplicationOne(s.refImmediateComposite().app)

		)			
}

lazy rule CreateIntentForImplicitCommunication{
 from 
  s:ASAMM!Intent
 to
  t:ICCMM!ImplicitIntent
  (
    Name <- s.Name,
	SendComponentName <- s.SendComponentName,
	Action <- s.Action,
	Permission <- 
	if not s.Permission.oclIsUndefined() then
	  s.Permission
	else
		OclUndefined
	endif,
	
	Data <- 
	if s.ExtraData=true then
	   true
	else
		if s.data.notEmpty() then
		  true
		else
			false
		endif
	endif,
	
	MethodForSend <- 
	if not s.MethodForSend.oclIsUndefined() then
	  s.MethodForSend
	else
		OclUndefined
	endif,
		   					
target_components <- 
if not s.Action.oclIsUndefined() and s.categories.notEmpty() and s.data.notEmpty() then---for Action and Category and Data
   if not s.TestActionAndCategoryAndDataForActivity.oclIsUndefined() then
	       s.TestActionAndCategoryAndDataForActivity
	   else
	   	   if not s.TestActionAndCategoryAndDataForService.oclIsUndefined() then
	        s.TestActionAndCategoryAndDataForService
	        else
	   	       if not s.TestActionAndCategoryAndDataForReceiver.oclIsUndefined() and not s.TestActionAndCategoryAndDataForDynamicReceiver.oclIsUndefined() then
						s.TestActionAndCategoryAndDataForReceiver->union(s.TestActionAndCategoryAndDataForDynamicReceiver)->collect(c | thisModule.createTargetComponentReceiverAndDynamicReciver(c))
		        else
		           if not s.TestActionAndCategoryAndDataForReceiver.oclIsUndefined() then
   		              s.TestActionAndCategoryAndDataForReceiver->collect(c | thisModule.createTargetComponentReceiver(c)) 
		            else
		                if not s.TestActionAndCategoryAndDataForDynamicReceiver.oclIsUndefined() then
		                 s.TestActionAndCategoryAndDataForDynamicReceiver->collect(c | thisModule.createTargetComponentDynamicRegisteredReceiver(c))
		                else
		                  OclUndefined
		                endif
				   endif
		        endif
     	     endif
		endif
else
	if not s.Action.oclIsUndefined() and s.categories.notEmpty() and not s.data.notEmpty() then ---for Action and Category
	   if not s.TestActionAndCategoryForActivity.oclIsUndefined() then
	       s.TestActionAndCategoryForActivity
	   else
	   	   if not s.TestActionAndCategoryForService.oclIsUndefined() then
	        s.TestActionAndCategoryForService
	        else
	   	       if not s.TestActionAndCategoryForReceiver.oclIsUndefined() and not s.TestActionAndCategoryForDynamicReceiver.oclIsUndefined() then
						s.TestActionAndCategoryForReceiver->union(s.TestActionAndCategoryForDynamicReceiver)->collect(c | thisModule.createTargetComponentReceiverAndDynamicReciver(c))
		        else
		           if not s.TestActionAndCategoryForReceiver.oclIsUndefined() then
   		              s.TestActionAndCategoryForReceiver->collect(c | thisModule.createTargetComponentReceiver(c)) 
		            else
		                if not s.TestActionAndCategoryForDynamicReceiver.oclIsUndefined() then
		                 s.TestActionAndCategoryForDynamicReceiver->collect(c | thisModule.createTargetComponentDynamicRegisteredReceiver(c))
		                else
		                  OclUndefined
		                endif
				   endif
		        endif
     	     endif
		endif
	else
		if not s.Action.oclIsUndefined() and not s.categories.notEmpty() and s.data.notEmpty() then ---for Action and Data
		    if not s.TestActionAndDataForActivity.oclIsUndefined() then
	         s.TestActionAndDataForActivity
	        else
	   	        if not s.TestActionAndDataForService.oclIsUndefined() then
	             s.TestActionAndDataForService
	            else
	   	            if not s.TestActionAndDataForReceiver.oclIsUndefined() and not s.TestActionAndDataForDynamicReceiver.oclIsUndefined() then
						s.TestActionAndDataForReceiver->union(s.TestActionAndDataForDynamicReceiver)->collect(c | thisModule.createTargetComponentReceiverAndDynamicReciver(c))
		            else
		                if not s.TestActionAndDataForReceiver.oclIsUndefined() then
   		                 s.TestActionAndDataForReceiver->collect(c | thisModule.createTargetComponentReceiver(c)) 
		                else
		                    if not s.TestActionAndDataForDynamicReceiver.oclIsUndefined() then
		                    s.TestActionAndDataForDynamicReceiver->collect(c | thisModule.createTargetComponentDynamicRegisteredReceiver(c))
		                    else
		                    OclUndefined
		                    endif
					    endif
		           endif
				endif
	        endif
	    else
            if not s.Action.oclIsUndefined() and not s.categories.notEmpty() and not s.data.notEmpty() then---for Only Action
				if not s.TestActionForActivity.oclIsUndefined() then
	               s.TestActionForActivity

	            else
		            if not s.TestActionForService.oclIsUndefined() then
		              s.TestActionForService
		            else
		                if not s.TestActionForReceiver.oclIsUndefined() and not s.TestActionForDynamicReceiver.oclIsUndefined() then
						 s.TestActionForReceiver->union(s.TestActionForDynamicReceiver)->collect(c | thisModule.createTargetComponentReceiverAndDynamicReciver(c))
		                else
		                    if not s.TestActionForReceiver.oclIsUndefined() then
   		                        s.TestActionForReceiver->collect(c | thisModule.createTargetComponentReceiver(c)) 
		                    else
		                        if not s.TestActionForDynamicReceiver.oclIsUndefined() then
		                          s.TestActionForDynamicReceiver->collect(c | thisModule.createTargetComponentDynamicRegisteredReceiver(c))
		                        else
		                           OclUndefined
		                        endif
							endif
		                endif
					endif
				endif
		    else
			    if s.Action.oclIsUndefined() and not s.categories.notEmpty() and s.data.notEmpty() then---for Only Data
			        if not s.TestDataForActivity.oclIsUndefined() then
	               s.TestDataForActivity
	               else
		              if not s.TestDataForService.oclIsUndefined() then
		              s.TestDataForService
		              else
		                  if not s.TestDataForReceiver.oclIsUndefined() and not s.TestDataForDynamicReceiver.oclIsUndefined() then
						   s.TestDataForReceiver->union(s.TestDataForDynamicReceiver)->collect(c | thisModule.createTargetComponentReceiverAndDynamicReciver(c))
		                  else
		                      if not s.TestDataForReceiver.oclIsUndefined() then
   		                        s.TestDataForReceiver->collect(c | thisModule.createTargetComponentReceiver(c)) 
		                      else
		                          if not s.TestDataForDynamicReceiver.oclIsUndefined() then
		                          s.TestDataForDynamicReceiver->collect(c | thisModule.createTargetComponentDynamicRegisteredReceiver(c))
		                          else
		                           OclUndefined
		                          endif
							  endif
		                  endif
					   endif
				   endif
				else
					OclUndefined
				endif
		    endif
		endif
	endif
endif
)

}

lazy rule createTargetComponentForActivity{	
from
s:ASAMM!Activity
to
t:ICCMM!ImplicitTargetComponent(
Name <- s.Name,
receiver_app <- thisModule.CreateApplicationTwo(s.refImmediateComposite()),

component_enforcedPermissions <-  
if not s.refImmediateComposite().Permission.oclIsUndefined() and not thisModule.getAppCompPermissions.oclIsUndefined() then
 if thisModule.getAppCompPermissions->select(c | s.Name.endsWith(c.AppComponentName)).notEmpty() then
    thisModule.CreateComponentEnforcedPermissionForPermissionAttributeOfApplication(s.refImmediateComposite())->union(thisModule.getAppCompPermissions->select(c | s.Name.endsWith(c.AppComponentName))->collect(c | thisModule.CreateComponentEnforcedPermissions(c)))
 else
 	OclUndefined
 endif
else
	if not thisModule.getAppCompPermissions.oclIsUndefined() then
       if thisModule.getAppCompPermissions->select(c | s.Name.endsWith(c.AppComponentName)).notEmpty() then
         thisModule.getAppCompPermissions->select(c | s.Name.endsWith(c.AppComponentName))->collect(c | thisModule.CreateComponentEnforcedPermissions(c))
	   else
	   	OclUndefined
	   endif
   else
  	 OclUndefined
   endif
endif,

component_usedPermissions <-  
if not thisModule.getAllAPIPermissions.oclIsUndefined() then
    if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=c.AppComponentName.toString()).notEmpty() then
        if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=c.AppComponentName.toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString())).notEmpty() then
            if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=c.AppComponentName.toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString()))->select(c | c.APICallPermissions.notEmpty()).notEmpty() then
             thisModule.getAllAPIPermissions->select(c | s.Name.toString()=c.AppComponentName.toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString()))->select(c | c.APICallPermissions.notEmpty())->collect(c | thisModule.CreateComponentUsedPermission(c))
            else
             OclUndefined
            endif
		else
			OclUndefined
		endif
	
    else
   	    if thisModule.getAllAPIPermissions->select(c | s.Name.toString()='.' + c.AppComponentName.toString()).notEmpty() then
		    if thisModule.getAllAPIPermissions->select(c | s.Name.toString()='.' + c.AppComponentName.toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString())).notEmpty() then 
                if thisModule.getAllAPIPermissions->select(c | s.Name.toString()= '.' + c.AppComponentName.toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString()))->select(c | c.APICallPermissions.notEmpty()).notEmpty() then
                 thisModule.getAllAPIPermissions->select(c | s.Name.toString()= '.' + c.AppComponentName.toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString()))->select(c | c.APICallPermissions.notEmpty())->collect(c | thisModule.CreateComponentUsedPermission(c))
                else
                OclUndefined
                endif
		    else
		     OclUndefined
		    endif
	    else
			if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package + '.' + c.AppComponentName).toString()).notEmpty() then 
				if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package + '.' + c.AppComponentName).toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString())).notEmpty() then 
			    	if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package.toString() + '.' + c.AppComponentName).toString())->select(c | c.APICallPermissions.notEmpty()).notEmpty() then
                    	thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package.toString() + '.' + c.AppComponentName).toString())->select(c | c.APICallPermissions.notEmpty())->collect(c | thisModule.CreateComponentUsedPermission(c))
                	else
                    	OclUndefined
					endif
				else
			 	 OclUndefined
				endif
			else
				if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package.toString() + '.activity' + '.' + c.AppComponentName).toString()).notEmpty() then 
					if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package.toString() + '.activity' + '.' + c.AppComponentName).toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString())).notEmpty() then 
				  	  	if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package.toString() + '.activity' + '.' + c.AppComponentName).toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString()))->select(c | c.APICallPermissions.notEmpty()).notEmpty() then
                       	thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package.toString() + '.activity' + '.' + c.AppComponentName).toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString()))->select(c | c.APICallPermissions.notEmpty())->collect(c | thisModule.CreateComponentUsedPermission(c))
						else
					 	OclUndefined
						endif
               	    else
                     OclUndefined
				    endif
			    else
			      OclUndefined
                endif
            endif
        endif
	endif
else
	OclUndefined
endif,

Data <- 
if s.Data then
true
else
	false
endif,

Type <- #Activity
)
}

lazy rule createReceiverComponentForActivity{	
from
s:ASAMM!Activity
to
t:ICCMM!ExplicitTargetComponent(
Name <- s.Name,
receiver_app <- thisModule.CreateApplicationTwo(s.refImmediateComposite()),

component_enforcedPermissions <-  
if not thisModule.getAppCompPermissions.oclIsUndefined() then
  if thisModule.getAppCompPermissions->select(c | s.Name.endsWith(c.AppComponentName)).notEmpty() then
     thisModule.getAppCompPermissions->select(c | s.Name.endsWith(c.AppComponentName))->collect(c | thisModule.CreateComponentEnforcedPermissions(c))
  else
  	 OclUndefined
  endif
else
	OclUndefined
endif,

component_usedPermissions <- 
if not thisModule.getAllAPIPermissions.oclIsUndefined() then
    if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=c.AppComponentName.toString()).notEmpty() then
        if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=c.AppComponentName.toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString())).notEmpty() then
            if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=c.AppComponentName.toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString()))->select(c | c.APICallPermissions.notEmpty()).notEmpty() then
             thisModule.getAllAPIPermissions->select(c | s.Name.toString()=c.AppComponentName.toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString()))->select(c | c.APICallPermissions.notEmpty())->collect(c | thisModule.CreateComponentUsedPermission(c))
            else
             OclUndefined
            endif
		else
			OclUndefined
		endif	
    else
   	    if thisModule.getAllAPIPermissions->select(c | s.Name.toString()='.' + c.AppComponentName.toString()).notEmpty() then
		    if thisModule.getAllAPIPermissions->select(c | s.Name.toString()='.' + c.AppComponentName.toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString())).notEmpty() then 
                if thisModule.getAllAPIPermissions->select(c | s.Name.toString()= '.' + c.AppComponentName.toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString()))->select(c | c.APICallPermissions.notEmpty()).notEmpty() then
			--	OclUndefined
                thisModule.getAllAPIPermissions->select(c | s.Name.toString()= '.' + c.AppComponentName.toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString()))->select(c | c.APICallPermissions.notEmpty())->collect(c | thisModule.CreateComponentUsedPermission(c))
                else
                OclUndefined
                endif
		    else
		     OclUndefined
		    endif
	    else
			if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package + '.' + c.AppComponentName).toString()).notEmpty() then 
				if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package + '.' + c.AppComponentName).toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString())).notEmpty() then 
			    	if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package.toString() + '.' + c.AppComponentName).toString())->select(c | c.APICallPermissions.notEmpty()).notEmpty() then
                    	thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package.toString() + '.' + c.AppComponentName).toString())->select(c | c.APICallPermissions.notEmpty())->collect(c | thisModule.CreateComponentUsedPermission(c))
                	else
                    	OclUndefined
					endif
				else
			 	 OclUndefined
				endif
			else
				if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package.toString() + '.activity' + '.' + c.AppComponentName).toString()).notEmpty() then 
					if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package.toString() + '.activity' + '.' + c.AppComponentName).toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString())).notEmpty() then 
				  	  	if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package.toString() + '.activity' + '.' + c.AppComponentName).toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString()))->select(c | c.APICallPermissions.notEmpty()).notEmpty() then
                       	thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package.toString() + '.activity' + '.' + c.AppComponentName).toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString()))->select(c | c.APICallPermissions.notEmpty())->collect(c | thisModule.CreateComponentUsedPermission(c))
						else
					 	OclUndefined
						endif
               	    else
                     OclUndefined
				    endif
			    else
			      OclUndefined
                endif
            endif
        endif
	endif
else
	OclUndefined
endif,

Data <- 
if s.Data then
true
else
	false
endif
,

exported <- s.Exported,
Type <- #Activity
)
}

lazy rule createTargetComponentForService{	
from
s:ASAMM!Service
to
t:ICCMM!ImplicitTargetComponent(
  Name <- s.Name,
  receiver_app <- thisModule.CreateApplicationTwo(s.refImmediateComposite()),
  
  component_enforcedPermissions <-  
if not thisModule.getAppCompPermissions.oclIsUndefined() then
  if thisModule.getAppCompPermissions->select(c | s.Name.endsWith(c.AppComponentName)).notEmpty() then
     thisModule.getAppCompPermissions->select(c | s.Name.endsWith(c.AppComponentName))->collect(c | thisModule.CreateComponentEnforcedPermissions(c))
  else
  	 OclUndefined
  endif
else
	OclUndefined
endif,
  

component_usedPermissions <- 
if not thisModule.getAllAPIPermissions.oclIsUndefined() then
    if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=c.AppComponentName.toString()).notEmpty() then
        if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=c.AppComponentName.toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString())).notEmpty() then
            if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=c.AppComponentName.toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString()))->select(c | c.APICallPermissions.notEmpty()).notEmpty() then
             thisModule.getAllAPIPermissions->select(c | s.Name.toString()=c.AppComponentName.toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString()))->select(c | c.APICallPermissions.notEmpty())->collect(c | thisModule.CreateComponentUsedPermission(c))
            else
             OclUndefined
            endif
		else
			OclUndefined
		endif
	
    else
   	    if thisModule.getAllAPIPermissions->select(c | s.Name.toString()='.' + c.AppComponentName.toString()).notEmpty() then
		    if thisModule.getAllAPIPermissions->select(c | s.Name.toString()='.' + c.AppComponentName.toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString())).notEmpty() then 
                if thisModule.getAllAPIPermissions->select(c | s.Name.toString()= '.' + c.AppComponentName.toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString()))->select(c | c.APICallPermissions.notEmpty()).notEmpty() then
                 thisModule.getAllAPIPermissions->select(c | s.Name.toString()= '.' + c.AppComponentName.toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString()))->select(c | c.APICallPermissions.notEmpty())->collect(c | thisModule.CreateComponentUsedPermission(c))
                else
                OclUndefined
                endif
		    else
		     OclUndefined
		    endif
	    else
			if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package + '.' + c.AppComponentName).toString()).notEmpty() then 
				if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package + '.' + c.AppComponentName).toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString())).notEmpty() then 
			    	if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package.toString() + '.' + c.AppComponentName).toString())->select(c | c.APICallPermissions.notEmpty()).notEmpty() then
                    	thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package.toString() + '.' + c.AppComponentName).toString())->select(c | c.APICallPermissions.notEmpty())->collect(c | thisModule.CreateComponentUsedPermission(c))
                	else
                    	OclUndefined
					endif
				else
			 	 OclUndefined
				endif
			else
				if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package.toString() + '.service' + '.' + c.AppComponentName).toString()).notEmpty() then 
					if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package.toString() + '.service' + '.' + c.AppComponentName).toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString())).notEmpty() then 
				  	  	if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package.toString() + '.service' + '.' + c.AppComponentName).toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString()))->select(c | c.APICallPermissions.notEmpty()).notEmpty() then
                       	thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package.toString() + '.service' + '.' + c.AppComponentName).toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString()))->select(c | c.APICallPermissions.notEmpty())->collect(c | thisModule.CreateComponentUsedPermission(c))
						else
					 	OclUndefined
						endif
               	    else
                     OclUndefined
				    endif
			    else
			      OclUndefined
                endif
            endif
        endif
	endif
else
	OclUndefined
endif
  

)
}

lazy rule createReceiverComponentForService{	
from
s:ASAMM!Service
to
t:ICCMM!ExplicitTargetComponent(
  Name <- s.Name,
  receiver_app <- thisModule.CreateApplicationTwo(s.refImmediateComposite()),

  component_enforcedPermissions <-  
if not thisModule.getAppCompPermissions.oclIsUndefined() then
  if thisModule.getAppCompPermissions->select(c | s.Name.endsWith(c.AppComponentName)).notEmpty() then
     thisModule.getAppCompPermissions->select(c | s.Name.endsWith(c.AppComponentName))->collect(c | thisModule.CreateComponentEnforcedPermissions(c))
  else
  	 OclUndefined
  endif
else
	OclUndefined
endif,

component_usedPermissions <-  
if not thisModule.getAllAPIPermissions.oclIsUndefined() then
    if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=c.AppComponentName.toString()).notEmpty() then
        if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=c.AppComponentName.toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString())).notEmpty() then
            if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=c.AppComponentName.toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString()))->select(c | c.APICallPermissions.notEmpty()).notEmpty() then
             thisModule.getAllAPIPermissions->select(c | s.Name.toString()=c.AppComponentName.toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString()))->select(c | c.APICallPermissions.notEmpty())->collect(c | thisModule.CreateComponentUsedPermission(c))
            else
             OclUndefined
            endif
		else
			OclUndefined
		endif
	
    else
   	    if thisModule.getAllAPIPermissions->select(c | s.Name.toString()='.' + c.AppComponentName.toString()).notEmpty() then
		    if thisModule.getAllAPIPermissions->select(c | s.Name.toString()='.' + c.AppComponentName.toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString())).notEmpty() then 
                if thisModule.getAllAPIPermissions->select(c | s.Name.toString()= '.' + c.AppComponentName.toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString()))->select(c | c.APICallPermissions.notEmpty()).notEmpty() then
                 thisModule.getAllAPIPermissions->select(c | s.Name.toString()= '.' + c.AppComponentName.toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString()))->select(c | c.APICallPermissions.notEmpty())->collect(c | thisModule.CreateComponentUsedPermission(c))
                else
                OclUndefined
                endif
		    else
		     OclUndefined
		    endif
	    else
			if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package + '.' + c.AppComponentName).toString()).notEmpty() then 
				if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package + '.' + c.AppComponentName).toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString())).notEmpty() then 
			    	if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package.toString() + '.' + c.AppComponentName).toString())->select(c | c.APICallPermissions.notEmpty()).notEmpty() then
                    	thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package.toString() + '.' + c.AppComponentName).toString())->select(c | c.APICallPermissions.notEmpty())->collect(c | thisModule.CreateComponentUsedPermission(c))
                	else
                    	OclUndefined
					endif
				else
			 	 OclUndefined
				endif
			else
				if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package.toString() + '.service' + '.' + c.AppComponentName).toString()).notEmpty() then 
					if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package.toString() + '.service' + '.' + c.AppComponentName).toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString())).notEmpty() then 
				  	  	if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package.toString() + '.service' + '.' + c.AppComponentName).toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString()))->select(c | c.APICallPermissions.notEmpty()).notEmpty() then
                       	thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package.toString() + '.service' + '.' + c.AppComponentName).toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString()))->select(c | c.APICallPermissions.notEmpty())->collect(c | thisModule.CreateComponentUsedPermission(c))
						else
					 	OclUndefined
						endif
               	    else
                     OclUndefined
				    endif
			    else
			      OclUndefined
                endif
            endif
        endif
	endif
else
	OclUndefined
endif,

Data <- 
if s.Data then
true
else
	false
endif,

exported <- s.Exported,

Type <- #Service
)
}

lazy rule createTargetComponentReceiverAndDynamicReciver{	
from
s:ASAMM!DynamicRegisteredComponent
to
t:ICCMM!ImplicitTargetComponent(
Name <- s.Name,
receiver_app <- thisModule.CreateApplicationTwo(s.refImmediateComposite()),

component_enforcedPermissions <-  
if not thisModule.getAppCompPermissions.oclIsUndefined() then
  if thisModule.getAppCompPermissions->select(c | s.Name.endsWith(c.AppComponentName)).notEmpty() then
     thisModule.getAppCompPermissions->select(c | s.Name.endsWith(c.AppComponentName))->collect(c | thisModule.CreateComponentEnforcedPermissions(c))
  else
  	 OclUndefined
  endif
else
	OclUndefined
endif,

component_usedPermissions <-  
if not thisModule.getAllAPIPermissions.oclIsUndefined() then
    if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=c.AppComponentName.toString()).notEmpty() then
        if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=c.AppComponentName.toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString())).notEmpty() then
            if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=c.AppComponentName.toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString()))->select(c | c.APICallPermissions.notEmpty()).notEmpty() then
             thisModule.getAllAPIPermissions->select(c | s.Name.toString()=c.AppComponentName.toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString()))->select(c | c.APICallPermissions.notEmpty())->collect(c | thisModule.CreateComponentUsedPermission(c))
            else
             OclUndefined
            endif
		else
			OclUndefined
		endif
	
    else
   	    if thisModule.getAllAPIPermissions->select(c | s.Name.toString()='.' + c.AppComponentName.toString()).notEmpty() then
		    if thisModule.getAllAPIPermissions->select(c | s.Name.toString()='.' + c.AppComponentName.toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString())).notEmpty() then 
                if thisModule.getAllAPIPermissions->select(c | s.Name.toString()= '.' + c.AppComponentName.toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString()))->select(c | c.APICallPermissions.notEmpty()).notEmpty() then
                 thisModule.getAllAPIPermissions->select(c | s.Name.toString()= '.' + c.AppComponentName.toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString()))->select(c | c.APICallPermissions.notEmpty())->collect(c | thisModule.CreateComponentUsedPermission(c))
                else
                OclUndefined
                endif
		    else
		     OclUndefined
		    endif
	    else
			if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package + '.' + c.AppComponentName).toString()).notEmpty() then 
				if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package + '.' + c.AppComponentName).toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString())).notEmpty() then 
			    	if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package.toString() + '.' + c.AppComponentName).toString())->select(c | c.APICallPermissions.notEmpty()).notEmpty() then
                    	thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package.toString() + '.' + c.AppComponentName).toString())->select(c | c.APICallPermissions.notEmpty())->collect(c | thisModule.CreateComponentUsedPermission(c))
                	else
                    	OclUndefined
					endif
				else
			 	 OclUndefined
				endif
			else
				if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package.toString() + '.receiver' + '.' + c.AppComponentName).toString()).notEmpty() then 
					if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package.toString() + '.receiver' + '.' + c.AppComponentName).toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString())).notEmpty() then 
				  	  	if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package.toString() + '.receiver' + '.' + c.AppComponentName).toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString()))->select(c | c.APICallPermissions.notEmpty()).notEmpty() then
                       	thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package.toString() + '.receiver' + '.' + c.AppComponentName).toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString()))->select(c | c.APICallPermissions.notEmpty())->collect(c | thisModule.CreateComponentUsedPermission(c))
						else
					 	OclUndefined
						endif
               	    else
                     OclUndefined
				    endif
			    else
			      OclUndefined
                endif
            endif
        endif
	endif
else
	OclUndefined
endif,

Type <- #DynamicRegisteredReceiver
)
}

lazy rule createTargetComponentReceiver{	
from
s:ASAMM!BroadcastReceiver
to
t:ICCMM!ImplicitTargetComponent(
Name <- s.Name,
receiver_app <- thisModule.CreateApplicationTwo(s.refImmediateComposite()),

component_enforcedPermissions <-   
if not thisModule.getAppCompPermissions.oclIsUndefined() then
  if thisModule.getAppCompPermissions->select(c | s.Name.endsWith(c.AppComponentName)).notEmpty() then
     thisModule.getAppCompPermissions->select(c | s.Name.endsWith(c.AppComponentName))->collect(c | thisModule.CreateComponentEnforcedPermissions(c))
  else
  	 OclUndefined
  endif
else
	OclUndefined
endif,

component_usedPermissions <- 
if not thisModule.getAllAPIPermissions.oclIsUndefined() then
    if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=c.AppComponentName.toString()).notEmpty() then
        if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=c.AppComponentName.toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString())).notEmpty() then
            if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=c.AppComponentName.toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString()))->select(c | c.APICallPermissions.notEmpty()).notEmpty() then
             thisModule.getAllAPIPermissions->select(c | s.Name.toString()=c.AppComponentName.toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString()))->select(c | c.APICallPermissions.notEmpty())->collect(c | thisModule.CreateComponentUsedPermission(c))
            else
             OclUndefined
            endif
		else
			OclUndefined
		endif
	
    else
   	    if thisModule.getAllAPIPermissions->select(c | s.Name.toString()='.' + c.AppComponentName.toString()).notEmpty() then
		    if thisModule.getAllAPIPermissions->select(c | s.Name.toString()='.' + c.AppComponentName.toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString())).notEmpty() then 
                if thisModule.getAllAPIPermissions->select(c | s.Name.toString()= '.' + c.AppComponentName.toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString()))->select(c | c.APICallPermissions.notEmpty()).notEmpty() then
                 thisModule.getAllAPIPermissions->select(c | s.Name.toString()= '.' + c.AppComponentName.toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString()))->select(c | c.APICallPermissions.notEmpty())->collect(c | thisModule.CreateComponentUsedPermission(c))
                else
                OclUndefined
                endif
		    else
		     OclUndefined
		    endif
	    else
			if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package + '.' + c.AppComponentName).toString()).notEmpty() then 
				if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package + '.' + c.AppComponentName).toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString())).notEmpty() then 
			    	if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package.toString() + '.' + c.AppComponentName).toString())->select(c | c.APICallPermissions.notEmpty()).notEmpty() then
                    	thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package.toString() + '.' + c.AppComponentName).toString())->select(c | c.APICallPermissions.notEmpty())->collect(c | thisModule.CreateComponentUsedPermission(c))
                	else
                    	OclUndefined
					endif
				else
			 	 OclUndefined
				endif
			else
				if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package.toString() + '.receiver' + '.' + c.AppComponentName).toString()).notEmpty() then 
					if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package.toString() + '.receiver' + '.' + c.AppComponentName).toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString())).notEmpty() then 
				  	  	if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package.toString() + '.receiver' + '.' + c.AppComponentName).toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString()))->select(c | c.APICallPermissions.notEmpty()).notEmpty() then
                       	thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package.toString() + '.receiver' + '.' + c.AppComponentName).toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString()))->select(c | c.APICallPermissions.notEmpty())->collect(c | thisModule.CreateComponentUsedPermission(c))
						else
					 	OclUndefined
						endif
               	    else
                     OclUndefined
				    endif
			    else
			      OclUndefined
                endif
            endif
        endif
	endif
else
	OclUndefined
endif,

Data <- 
if s.Data then
true
else
	false
endif,

Type <- #Receiver
)
}

lazy rule createReceiverComponentForReceiver{	
from
s:ASAMM!BroadcastReceiver
to
t:ICCMM!ExplicitTargetComponent(
Name <- s.Name,
receiver_app <- thisModule.CreateApplicationTwo(s.refImmediateComposite()),

component_enforcedPermissions <-  
if not thisModule.getAppCompPermissions.oclIsUndefined() then
  if thisModule.getAppCompPermissions->select(c | s.Name.endsWith(c.AppComponentName)).notEmpty() then
     thisModule.getAppCompPermissions->select(c | s.Name.endsWith(c.AppComponentName))->collect(c | thisModule.CreateComponentEnforcedPermissions(c))
  else
  	 OclUndefined
  endif
else
	OclUndefined
endif,

component_usedPermissions <- 
if not thisModule.getAllAPIPermissions.oclIsUndefined() then
    if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=c.AppComponentName.toString()).notEmpty() then
        if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=c.AppComponentName.toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString())).notEmpty() then
            if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=c.AppComponentName.toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString()))->select(c | c.APICallPermissions.notEmpty()).notEmpty() then
             thisModule.getAllAPIPermissions->select(c | s.Name.toString()=c.AppComponentName.toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString()))->select(c | c.APICallPermissions.notEmpty())->collect(c | thisModule.CreateComponentUsedPermission(c))
            else
             OclUndefined
            endif
		else
			OclUndefined
		endif	
    else
   	    if thisModule.getAllAPIPermissions->select(c | s.Name.toString()='.' + c.AppComponentName.toString()).notEmpty() then
		    if thisModule.getAllAPIPermissions->select(c | s.Name.toString()='.' + c.AppComponentName.toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString())).notEmpty() then 
                if thisModule.getAllAPIPermissions->select(c | s.Name.toString()= '.' + c.AppComponentName.toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString()))->select(c | c.APICallPermissions.notEmpty()).notEmpty() then
                 thisModule.getAllAPIPermissions->select(c | s.Name.toString()= '.' + c.AppComponentName.toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString()))->select(c | c.APICallPermissions.notEmpty())->collect(c | thisModule.CreateComponentUsedPermission(c))
                else
                OclUndefined
                endif
		    else
		     OclUndefined
		    endif
	    else
			if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package + '.' + c.AppComponentName).toString()).notEmpty() then 
				if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package + '.' + c.AppComponentName).toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString())).notEmpty() then 
			    	if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package.toString() + '.' + c.AppComponentName).toString())->select(c | c.APICallPermissions.notEmpty()).notEmpty() then
                    	thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package.toString() + '.' + c.AppComponentName).toString())->select(c | c.APICallPermissions.notEmpty())->collect(c | thisModule.CreateComponentUsedPermission(c))
                	else
                    	OclUndefined
					endif
				else
			 	 OclUndefined
				endif
			else
				if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package.toString() + '.receiver' + '.' + c.AppComponentName).toString()).notEmpty() then 
					if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package.toString() + '.receiver' + '.' + c.AppComponentName).toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString())).notEmpty() then 
				  	  	if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package.toString() + '.receiver' + '.' + c.AppComponentName).toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString()))->select(c | c.APICallPermissions.notEmpty()).notEmpty() then
                       	thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package.toString() + '.receiver' + '.' + c.AppComponentName).toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString()))->select(c | c.APICallPermissions.notEmpty())->collect(c | thisModule.CreateComponentUsedPermission(c))
						else
					 	OclUndefined
						endif
               	    else
                     OclUndefined
				    endif
			    else
			      OclUndefined
                endif
            endif
        endif
	endif
else
	OclUndefined
endif,
  

Data <- 
if s.Data then
true
else
	false
endif,

exported <- s.Exported,

Type <- #Receiver
)
}

lazy rule createTargetComponentDynamicRegisteredReceiver{	
from
s:ASAMM!DynamicRegisteredBroadcastReceiver
to
t:ICCMM!ImplicitTargetComponent(
Name <- s.Name,
receiver_app <- thisModule.CreateApplicationTwo(s.refImmediateComposite()),

component_enforcedPermissions <- 
if s.compPermissions.notEmpty() then
   s.compPermissions->collect(c | thisModule.CreateComponentEnforcedPermissionsForDynamicReceiver(c)) 
  
else
	OclUndefined
endif,

component_usedPermissions <-   
if not thisModule.getAllAPIPermissions.oclIsUndefined() then
   if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=c.AppComponentName.toString()).notEmpty() then
        if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=c.AppComponentName.toString())->select(c | c.APICallPermissions.notEmpty()).notEmpty() then
        thisModule.getAllAPIPermissions->select(c | s.Name.toString()=c.AppComponentName.toString())->select(c | c.APICallPermissions.notEmpty())->collect(c | thisModule.CreateComponentUsedPermission(c))
        else
        OclUndefined
        endif
   else
   	    if thisModule.getAllAPIPermissions->select(c | s.Name.toString()='.' + c.AppComponentName.toString()).notEmpty() then
           if thisModule.getAllAPIPermissions->select(c | s.Name.toString()= '.' + c.AppComponentName.toString())->select(c | c.APICallPermissions.notEmpty()).notEmpty() then
            thisModule.getAllAPIPermissions->select(c | s.Name.toString()= '.' + c.AppComponentName.toString())->select(c | c.APICallPermissions.notEmpty())->collect(c | thisModule.CreateComponentUsedPermission(c))
            else
            OclUndefined
           endif
		else
			 if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(s.refImmediateComposite().refImmediateComposite().Package.toString() + '.' + c.AppComponentName).toString()).notEmpty() then 
			    if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(s.refImmediateComposite().refImmediateComposite().Package.toString() + '.' + c.AppComponentName).toString())->select(c | c.APICallPermissions.notEmpty()).notEmpty() then
                 thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(s.refImmediateComposite().refImmediateComposite().Package.toString() + '.' + c.AppComponentName).toString())->select(c | c.APICallPermissions.notEmpty())->collect(c | thisModule.CreateComponentUsedPermission(c))
                else
               OclUndefined
				endif
			 else
			 	  if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(s.refImmediateComposite().refImmediateComposite().Package.toString() + '.receiver' + '.' + c.AppComponentName).toString()).notEmpty() then 
			         if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(s.refImmediateComposite().refImmediateComposite().Package.toString() + '.receiver' + '.' + c.AppComponentName).toString())->select(c | c.APICallPermissions.notEmpty()).notEmpty() then
                       thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(s.refImmediateComposite().refImmediateComposite().Package.toString() + '.receiver' + '.' + c.AppComponentName).toString())->select(c | c.APICallPermissions.notEmpty())->collect(c | thisModule.CreateComponentUsedPermission(c))
                     else
                     OclUndefined
				     endif
			      else
			 	    OclUndefined
                  endif
             endif
		endif
   endif
else
	OclUndefined
endif,


Type <- #DynamicRegisteredReceiver
)
}

lazy rule createReceiverComponentForDynamicRegisteredReceiver{	
from
s:ASAMM!DynamicRegisteredBroadcastReceiver
to
t:ICCMM!ExplicitTargetComponent(
Name <- s.Name,
receiver_app <- thisModule.CreateApplicationTwo(s.refImmediateComposite()),

component_enforcedPermissions <-   
if s.compPermisions.notEmpty() then
     s.compPermisions->collect(c | thisModule.CreateComponentEnforcedPermissionsForDynamicReceiver(c))  
else
	OclUndefined
endif,

component_usedPermissions <-  
if not thisModule.getAllAPIPermissions.oclIsUndefined() then
    if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=c.AppComponentName.toString()).notEmpty() then
        if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=c.AppComponentName.toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString())).notEmpty() then
            if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=c.AppComponentName.toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString()))->select(c | c.APICallPermissions.notEmpty()).notEmpty() then
             thisModule.getAllAPIPermissions->select(c | s.Name.toString()=c.AppComponentName.toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString()))->select(c | c.APICallPermissions.notEmpty())->collect(c | thisModule.CreateComponentUsedPermission(c))
            else
             OclUndefined
            endif
		else
			OclUndefined
		endif
	
    else
   	    if thisModule.getAllAPIPermissions->select(c | s.Name.toString()='.' + c.AppComponentName.toString()).notEmpty() then
		    if thisModule.getAllAPIPermissions->select(c | s.Name.toString()='.' + c.AppComponentName.toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString())).notEmpty() then 
                if thisModule.getAllAPIPermissions->select(c | s.Name.toString()= '.' + c.AppComponentName.toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString()))->select(c | c.APICallPermissions.notEmpty()).notEmpty() then
                 thisModule.getAllAPIPermissions->select(c | s.Name.toString()= '.' + c.AppComponentName.toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString()))->select(c | c.APICallPermissions.notEmpty())->collect(c | thisModule.CreateComponentUsedPermission(c))
                else
                OclUndefined
                endif
		    else
		     OclUndefined
		    endif
	    else
			if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package + '.' + c.AppComponentName).toString()).notEmpty() then 
				if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package + '.' + c.AppComponentName).toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString())).notEmpty() then 
			    	if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package.toString() + '.' + c.AppComponentName).toString())->select(c | c.APICallPermissions.notEmpty()).notEmpty() then
                    	thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package.toString() + '.' + c.AppComponentName).toString())->select(c | c.APICallPermissions.notEmpty())->collect(c | thisModule.CreateComponentUsedPermission(c))
                	else
                    	OclUndefined
					endif
				else
			 	 OclUndefined
				endif
			else
				if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package.toString() + '.receiver' + '.' + c.AppComponentName).toString()).notEmpty() then 
					if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package.toString() + '.receiver' + '.' + c.AppComponentName).toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString())).notEmpty() then 
				  	  	if thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package.toString() + '.receiver' + '.' + c.AppComponentName).toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString()))->select(c | c.APICallPermissions.notEmpty()).notEmpty() then
                       	thisModule.getAllAPIPermissions->select(c | s.Name.toString()=(c.refImmediateComposite().Package.toString() + '.receiver' + '.' + c.AppComponentName).toString())->select(c | (s.refImmediateComposite().refImmediateComposite().Package.toString())=(c.refImmediateComposite().Package.toString()))->select(c | c.APICallPermissions.notEmpty())->collect(c | thisModule.CreateComponentUsedPermission(c))
						else
					 	OclUndefined
						endif
               	    else
                     OclUndefined
				    endif
			    else
			      OclUndefined
                endif
            endif
        endif
	endif
else
	OclUndefined
endif,


exported <- s.Exported,

Type <- #DynamicRegisteredReceiver
)
}


 lazy rule CreateUsesPermission {
	
 from 
     s:ASAMM!UsesPermission
 to
     t:ICCMM!UsesPermission
	 (
	 Name <- s.Name,
	 PermissionKind <-  s.PermissionKind
	 )
}

lazy rule CreateComponentEnforcedPermissionsForDynamicReceiver {
	
 from 
     s:ASAMM!CompPermission
 to
     t:ICCMM!ComponentEnforcedPermission
	 (
	 Name <- s.Name.toString() 
	 )
}

lazy rule CreateComponentEnforcedPermissions {
	
 from 
     s:ASAMM!AppCompPermission
 to
     t:ICCMM!ComponentEnforcedPermission
	 (
	 Name <- s.Name.toString(),
	 PermissionKind <-  s.PermissionKind,
	 CustomPerm <- s.CustomPerm
	 
	 )
}

lazy rule CreateComponentEnforcedPermissionsForPermissionAttributeOfApplication {
	
 from 
     s:ASAMM!Application
 to
     t:ICCMM!ComponentEnforcedPermission
	 (
	 --Name <- s.Name.toString() 
	 )
}

lazy rule CreateComponentUsedPermission {
	
 from 
     s:ASAMM!APIPermission
 to
     t:ICCMM!ComponentUsedPermission
	 (
	 APICallPermissions <- s.APICallPermissions->collect(c | thisModule.CreateAPICallPermissions(c)),
	 AppComponentName <- s.AppComponentName,
	 Package <- s.refImmediateComposite().Package
	 )
}

lazy rule CreateAPICallPermissions {
	
 from 
     s:ASAMM!APICallPermission
 to
     t:ICCMM!APICallPermissions
	 (
	-- Name <- s.Name
	 )
}


-----for URI communications-----


lazy rule CreateDataAccessCommunications{
	from
		s:ASAMM!ContentURIrequest 
	to 
		t:ICCMM!DataAccessCommunication(
			
sender_app <- thisModule.CreateSenderApplication(s.refImmediateComposite().app),
uri_of_DBR_request <- thisModule.CreateContentURIrequest(s)
)		
}


lazy rule CreateDataManipulationCommunications{
	from
	   s:ASAMM!ContentURIrequest
	to
	   t:ICCMM!DataManipulationCommunication(
	   	
	   sender_app <- thisModule.CreateSenderApplication(s.refImmediateComposite().app),
	   uri_of_DBM_request <- thisModule.CreateContentURIrequest(s)
	   )
}

lazy rule CreateSenderApplication{
	
from
    s:ASAMM!Application
to
    t:ICCMM!SenderApp(
    	Name <- s.refImmediateComposite().Package 
    )
}


lazy rule CreateContentURIrequest {
	from
		s:ASAMM!ContentURIrequest
	to 
		t:ICCMM!ContentURIrequest(
RequestType <- s.RequestType,
URI <- s.URI,
SenderComponentName <- s.SenderComponentName,

receiver_ContentProvider <- 
if not thisModule.getReceiverProviderForSpecificURIrequest(s.URI, s.refImmediateComposite().Package.toString()).oclIsUndefined() then
 thisModule.createReceiverContentProvider(thisModule.getReceiverProviderForSpecificURIrequest(s.URI, s.refImmediateComposite().Package.toString()))
else
 OclUndefined
endif
 
)
			
}

lazy rule createReceiverContentProvider{	
from
s:ASAMM!ContentProvider
to
t:ICCMM!ReceiverContentProvider(
Exported <- s.Exported,
Name <- s.Name,
authority <- s.authority,
receiver_app <-  thisModule.CreateReceiverApplication(s.refImmediateComposite()),

permissions <- 
if s.permissions.notEmpty() then
 s.permissions->collect(c | thisModule.CreatePermission(c))
else
 OclUndefined
endif,

pathPermissions <- 
if s.pathPermissions.notEmpty() then
 s.pathPermissions->collect(c | thisModule.CreatePathPermission(c))
else
	OclUndefined
endif,

grantUriPermissions <- s.grantUriPermissions,

URIpermissions <- 
if s.URIpermissions.notEmpty() then
 s.URIpermissions->collect(c | thisModule.CreateGrantUriPermission(c)) 
else
	OclUndefined
endif


  
)
}

lazy rule CreateReceiverApplication{
	
from
    s:ASAMM!Application
to
    t:ICCMM!ReceiverApp(
    	
    	Name <- s.refImmediateComposite().Package    
 )
}

lazy rule CreatePermission{
	
from
    s:ASAMM!Permission
to
    t:ICCMM!Permission(
    	
    	Kind <- s.Kind,
		Name <- s.Name,
		PermissionKind <- s.PermissionKind    
    )
}

lazy rule CreatePathPermission{
	
from
    s:ASAMM!PathPermission
to
    t:ICCMM!PathPermission(
    	
    	Path <- s.Path,
		permissions <- 
		if s.permissions.notEmpty() then
		 s.permissions->collect(c | thisModule.CreatePermission(c))
		else
			OclUndefined
		endif
			    
    )

}

lazy rule CreateGrantUriPermission{
	
from
    s:ASAMM!grantUriPermission
to
    t:ICCMM!grantUriPermission(
    	
    	path <- s.Path
    )

}


