To solve my problem, I looked at the class "SaveExpressionAction" which proposes a solution approaching my goal. In the current release OCL Tools, the XMI file is almost empty! (see attached file)

And in version 4.0.0M5, there is an exception! (org.eclipse.emf.ecore.resource.Resource$IOWrappedException: The object 'dateStart : EHR4CR_IM.uml::ISODIS21090::ISODatatypes::TS' is not contained in a resource.)

A Complete OCL document complements an existing model, so when you save
the Complete OCL XMI in isolation there are a lot of dangling
references. This functionality is totally undefined in the OCL
specification and I've clearly not thought it through properly yet for
Eclipse OCL.

Perhaps it is illegal to save partial Pivot ResourceSets and that the
XMI must comprise the complete ResourceSet. Perhaps each resource should
be saved to a file of a designated folder. Perhaps ...

What problem are you trying to solve (not what solution are you
pursuing)? Maybe if I understand your use case I can be more inspired
about how Complete OCL XMI might be meaningful.

OK. That makes sense. You definitely want the full model, not just the
Complete OCL contribution.

The MetaModelManager.pivotResourceSet has one Resource for each
contribution, typically
- primary meta-model
- Complete OCL contributions
- orphanage of synthesized types
packages and types appearing in multiple contributions have additional
server/client relationships so that using reflection you can access a
composite or partitioned view.

I think the actual problem is A). This too presents problems addressed
in https://bugs.eclipse.org/bugs/show_bug.cgi?id=402830. These are
variously language and tooling issues. There is no language
specification indicating how a Complete OCL document might be loadable.
Consequently Acceleo provides no syntax to support such loading and
Eclipse OCL provides limited facilities that might assist Acceleo in
doing so.

For Acceleo there are two problems. Firstly loading the Complete OCL
document so that the editor/builder exploits it. Then loading so that
the run-time uses it. For the latter there is a semi-programmatic
workaround; user code may be added to the auto-generated Java main
program to load the Complete OCL document using the Ecore-based OCL API.
I can see no workaround for the former; https://bugs.eclipse.org/bugs/show_bug.cgi?id=402836 raised.

Regards

Ed Willink

On 09/02/2012 08:19, Ed Willink wrote:
> Hi
>
> OK. That makes sense. You definitely want the full model, not just the
> Complete OCL contribution.
>
> The MetaModelManager.pivotResourceSet has one Resource for each
> contribution, typically
> - primary meta-model
> - Complete OCL contributions
> - orphanage of synthesized types
> packages and types appearing in multiple contributions have additional
> server/client relationships so that using reflection you can access a
> composite or partitioned view.
>
> See my 'design' discussion with myself on
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=371018.
>
> Regards
>
> Ed Willink
>
> On 08/02/2012 22:57, D O wrote:
>> Hi,
>>
>> I want to use Acceleo. OCL is defined by a metamodel, it is usually
>> possible to use tools such Acceleo, does not it?
>>
>> DO
>