blob: 4cb92dd2b92236cf929b732e4c1212716e9393b9 [file] [log] [blame]
/*****************************************************************************
* Copyright (c) 2020 CEA LIST and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* CEA LIST - Initial API and implementation
*
*****************************************************************************/
package org.eclipse.papyrus.moka.engine.suml.tasks;
import org.eclipse.papyrus.moka.engine.uml.scheduling.UMLRootExecution;
import org.eclipse.papyrus.moka.engine.uml.scheduling.UMLTaskExecutionFactory;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.OpaqueBehavior;
public class SUMLTaskExecutionFactory extends UMLTaskExecutionFactory {
/**
* Factory instance
*/
private static SUMLTaskExecutionFactory FACTORY;
/**
* Create (if required) and return the factory instance
*
* @return the task factory
*/
public static SUMLTaskExecutionFactory getInstance() {
if (FACTORY == null) {
FACTORY = new SUMLTaskExecutionFactory();
}
return FACTORY;
}
@Override
public UMLRootExecution<?> createRootExecution(Element executionRoot) {
UMLRootExecution<?> rootExecution = null;
if (executionRoot instanceof OpaqueBehavior) {
rootExecution = new RootOpaqueBehaviorTaskExecution(executionLoop, (OpaqueBehavior) executionRoot);
} else {
rootExecution = super.createRootExecution(executionRoot);
}
return rootExecution;
}
}