]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.simulation.sequences/src/org/simantics/simulation/sequences/action/StopReason.java
Allow simulation stop handling in Simantics/Sequences
[simantics/platform.git] / bundles / org.simantics.simulation.sequences / src / org / simantics / simulation / sequences / action / StopReason.java
1 /*******************************************************************************
2  * Copyright (c) 2019 Association for Decentralized Information Management
3  * in Industry THTH ry.
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * which accompanies this distribution, and is available at
7  * http://www.eclipse.org/legal/epl-v10.html
8  *
9  * Contributors:
10  *     Semantum Oy - initial API and implementation
11  *******************************************************************************/
12 package org.simantics.simulation.sequences.action;
13
14 /**
15  * Reasons for why a simulation sequence stops.
16  * 
17  * <p>
18  * {@link ActionContext#scheduleWhenStopped(org.simantics.scl.runtime.function.Function1)}
19  * allows sequences to handle stop reasons.
20  * 
21  * @author Tuukka Lehtonen
22  * @since 1.41.0, 1.35.2
23  */
24 public enum StopReason {
25     /**
26      * Appropriately stopped by the sequence itself. This is the normal course of
27      * action if the everything works as intended. All the other enumerated cases
28      * are exceptional situations marking some kind of failure to complete the
29      * sequence normally.
30      */
31     STOPPED,
32
33     /**
34      * Means simulation did not commence at all for some reason.
35      * A few possible reasons for failure are:
36      * <ul>
37      * <li>Incompatible solver and model</li>
38      * <li>Missing required files or other dependencies such as dynamic libraries</li>
39      * <li>License issues</li>
40      * </ul>
41      */
42     SIMULATION_DID_NOT_START,
43
44     /**
45      * Simulation diverged before reaching its specified end.
46      */
47     DIVERGED,
48
49     /**
50      * Client or some other party abruptly interrupted the sequence.
51      */
52     INTERRUPTED,
53 }