Search in sources :

Example 11 with ListBasedValidationIssueAcceptor

use of org.yakindu.base.types.validation.IValidationIssueAcceptor.ListBasedValidationIssueAcceptor in project statecharts by Yakindu.

the class AbstractTypeInferrerTest method expectNoErrors.

protected void expectNoErrors(String expression, String scope) {
    ListBasedValidationIssueAcceptor diagnostics = validate(expression, scope);
    assertNoErrors(diagnostics);
}
Also used : ListBasedValidationIssueAcceptor(org.yakindu.base.types.validation.IValidationIssueAcceptor.ListBasedValidationIssueAcceptor)

Example 12 with ListBasedValidationIssueAcceptor

use of org.yakindu.base.types.validation.IValidationIssueAcceptor.ListBasedValidationIssueAcceptor 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

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