Search in sources :

Example 1 with InitializationException

use of org.yakindu.sct.simulation.core.launch.AbstractSCTLaunchConfigurationDelegate.InitializationException in project statecharts by Yakindu.

the class AbstractExecutionFlowSimulationEngine method init.

@Override
public void init() {
    try {
        ListBasedValidationIssueAcceptor acceptor = new ListBasedValidationIssueAcceptor();
        ExecutionFlow flow = sequencer.transform(statechart, acceptor);
        if (acceptor.getTraces(Severity.ERROR).size() > 0) {
            Status errorStatus = new Status(Status.ERROR, SimulationCoreActivator.PLUGIN_ID, ERROR_DURING_SIMULATION, acceptor.getTraces(Severity.ERROR).iterator().next().toString(), null);
            IStatusHandler statusHandler = DebugPlugin.getDefault().getStatusHandler(errorStatus);
            try {
                statusHandler.handleStatus(errorStatus, getDebugTarget());
            } catch (CoreException e) {
                e.printStackTrace();
            }
        }
        if (!context.isSnapshot()) {
            contextInitializer.initialize(context, flow);
        }
        interpreter.initialize(flow, context, useInternalEventQueue());
    } catch (Exception ex) {
        handleException(ex);
        throw new InitializationException(ex.getMessage());
    }
}
Also used : ListBasedValidationIssueAcceptor(org.yakindu.base.types.validation.IValidationIssueAcceptor.ListBasedValidationIssueAcceptor) Status(org.eclipse.core.runtime.Status) CoreException(org.eclipse.core.runtime.CoreException) IStatusHandler(org.eclipse.debug.core.IStatusHandler) ExecutionFlow(org.yakindu.sct.model.sexec.ExecutionFlow) InitializationException(org.yakindu.sct.simulation.core.launch.AbstractSCTLaunchConfigurationDelegate.InitializationException) InitializationException(org.yakindu.sct.simulation.core.launch.AbstractSCTLaunchConfigurationDelegate.InitializationException) CoreException(org.eclipse.core.runtime.CoreException)

Aggregations

CoreException (org.eclipse.core.runtime.CoreException)1 Status (org.eclipse.core.runtime.Status)1 IStatusHandler (org.eclipse.debug.core.IStatusHandler)1 ListBasedValidationIssueAcceptor (org.yakindu.base.types.validation.IValidationIssueAcceptor.ListBasedValidationIssueAcceptor)1 ExecutionFlow (org.yakindu.sct.model.sexec.ExecutionFlow)1 InitializationException (org.yakindu.sct.simulation.core.launch.AbstractSCTLaunchConfigurationDelegate.InitializationException)1