[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.technology.gmt] Re: oaw 4.1

Concerning the issue noted below, when I state Eclipse UML 2.0 I mean
Eclipse UML2 V2.0 which is implemented in the Java package org.eclipse.uml2.uml and is based on EMF 2.2 as opposed to Eclipse UML2 V1.0 which is implemented in the Java package
org.eclipse.uml2 and uses a prior version of EMF.

ah, ok. We'll have this ready for 4.1 (and I have it running here,
based in the CVS head content). See http://www.eclipse.org/gmt/oaw/roadmap.php
for the timeline.



The document in which you refer shows support for prior Eclipse UMl2 version.
I noticed on the project site that 4.1 has support for UML2 2.0 /EMF 2.2 / Eclipse 3.2. It is this version I would like to access if necessary from CVS. I do notice a 4.1 alpha available on the download site.

yes, but that one does not yet have the UML 2 V2 stuff in it.

Concerning the question in the related thread. The functionality in OAW
is primarily visible through the workflow nodes.
If I wished to access portions of the workflow functionality in my runtime application directly , how would this be accomplished.
Perhaps I may just have to inspect the code the implements the workflow
nodes

I am not sure I understand exactly what you want to do: * do you want to run a workflow from your own Java code? How this works is shown in the workflow reference docs. * do you just want to run a specific workflow component, such as the CheckComponent? The code below shows, e.g. how to run a CheckComponent.

package org.openarchitectureware.adapter.gmf.constraint;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;

import org.eclipse.core.runtime.IStatus;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.validation.AbstractModelConstraint;
import org.eclipse.emf.validation.IValidationContext;
import org.openarchitectureware.check.CheckFacade;
import org.openarchitectureware.expression.ExecutionContext;
import org.openarchitectureware.expression.ExecutionContextImpl;
import org.openarchitectureware.type.emf.EmfMetaModel;
import org.openarchitectureware.workflow.issues.Issue;
import org.openarchitectureware.workflow.issues.Issues;
import org.openarchitectureware.workflow.issues.IssuesImpl;
import org.openarchitectureware.workflow.util.ResourceLoaderFactory;
import org.openarchitectureware.workflow.util.ResourceLoaderImpl;


public abstract class AbstractOAWConstraints extends AbstractModelConstraint {


    public AbstractOAWConstraints() {
        super();
    }

    protected abstract String getCheckFileName();

public IStatus validate(IValidationContext ctx) {
Object target = ctx.getTarget();
Issues issues = new IssuesImpl();
ResourceLoaderFactory.setCurrentThreadResourceLoader(new ResourceLoaderImpl(getClass().getClassLoader()));
CheckFacade.checkAll( getCheckFileName(), Collections.singleton(target),
getExecutionContext(), issues);
if (issues.hasErrors()) {
StringBuffer msg = new StringBuffer();
for (int i = 0; i < issues.getErrors().length; i++) {
Issue is = issues.getErrors()[i];
msg.append(is.getMessage());
}
return ctx.createFailureStatus(new Object[] { msg.toString() });
}


        return ctx.createSuccessStatus();
    }

    private ExecutionContextImpl ctx = null;

    private ExecutionContext getExecutionContext() {
        if (ctx == null) {
            ctx = new ExecutionContextImpl();
            List l = getMetamodelPackages();
            for (Iterator iter = l.iterator(); iter.hasNext();) {
				EPackage pkg = (EPackage) iter.next();
	            ctx.registerMetaModel(new EmfMetaModel(pkg));
			}
        }
        return ctx;
    }

    protected abstract List getMetamodelPackages();

    protected List makeList(Object o) {
    	List l = new ArrayList();
    	l.add(o);
    	return l;
    }

    protected List makeList(Object o1, Object o2) {
    	List l = makeList(o1);
    	l.add(o2);
    	return l;
    }

    protected List makeList(Object o1, Object o2, Object o3) {
    	List l = makeList(o1, o2);
    	l.add(o3);
    	return l;
    }

}




Hope this helps! Markus



--
Markus Völter

voelter - ingenieurbüro für softwaretechnologie
Ziegeläcker 11, 89520 Heidenheim, Germany
Tel. +49 (0) 171 / 86 01 869
Email: voelter@xxxxxxx

Web: http://www.voelter.de
Blog: http://www.voelter.de/blog
Podcast: http://www.se-radio.net

PGP Public Key: http://www.voelter.de/data/MarkusVoelter.gpg