Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [ACCELEO] Using OCL Invocation and Setting delegates
[ACCELEO] Using OCL Invocation and Setting delegates [message #813979] Mon, 05 March 2012 17:45 Go to previous message
Filip Krikava is currently offline Filip Krikava
Messages: 36
Registered: January 2012
Member
Hi,

I have a EMF model that I edited with OCLInEcore. In this model I use a lot derived properties and operations that are implemented using OCL (Pivot metamodel). When I use the model manually it all works fine, but when I use it in ACCELEO the derive properties and operations does not work.

I do the standalone setup:

   // initialize OCL
    OCLinEcoreStandaloneSetup.doSetup()
    OCLstdlib.install()
    OCL.initialize(null)

    // initialize OCL delegation
    val oclDelegateURI = OCLDelegateDomain.OCL_DELEGATE_URI_PIVOT;
    
    EOperation.Internal.InvocationDelegate.Factory.Registry.INSTANCE += 
      (oclDelegateURI -> new OCLInvocationDelegateFactory.Global())
    
    EStructuralFeature.Internal.SettingDelegate.Factory.Registry.INSTANCE += 
      (oclDelegateURI -> new OCLSettingDelegateFactory.Global());
    
    EValidator.ValidationDelegate.Registry.INSTANCE += 
      (oclDelegateURI -> new OCLValidationDelegateFactory.Global()) 


Before I invoke the doGenerate() method from ACCELEO I can navigate through the model using the OCL implemented properties and invoke OCL implemented operations, but when I access a derived property I get:

org.eclipse.acceleo.engine.AcceleoEvaluationException: Invalid loop iteration at line 87 in Module main for block for (controlSystem.mainComposites). Last recorded value of self was fr.unice.salty.core.model.salty.impl.ControlSystemImpl@2857a293.
	at main.main(ControlSystem)(main.mtl:87)
	at main.main(ControlSystem)(main.mtl:83)


If I put a breakpoint to the method that encapsulates this property - the method that has been generated by the genmodel it is not called.

Is this supported in ACCELEO? What do I need to setup in order to have it working?

Thanks a lot for help
Filip
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic:how to get a list of import packages
Next Topic:MWE: Couldn't load resource under platform:/resource
Goto Forum:
  


Current Time: Fri May 24 03:35:10 EDT 2013

Powered by FUDForum. Page generated in 0.13893 seconds