001: /*
002: * The contents of this file are subject to the terms of the Common Development
003: * and Distribution License (the License). You may not use this file except in
004: * compliance with the License.
005: *
006: * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
007: * or http://www.netbeans.org/cddl.txt.
008: *
009: * When distributing Covered Code, include this CDDL Header Notice in each file
010: * and include the License file at http://www.netbeans.org/cddl.txt.
011: * If applicable, add the following below the CDDL Header, with the fields
012: * enclosed by brackets [] replaced by your own identifying information:
013: * "Portions Copyrighted [year] [name of copyright owner]"
014: *
015: * The Original Software is NetBeans. The Initial Developer of the Original
016: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
017: * Microsystems, Inc. All Rights Reserved.
018: */
019:
020: package org.netbeans.modules.bpel.debugger.api;
021:
022: import org.netbeans.modules.bpel.debugger.api.pem.ProcessExecutionModel;
023: import org.netbeans.modules.bpel.debugger.api.variables.Value;
024: import org.netbeans.modules.bpel.debugger.api.variables.Variable;
025:
026: /**
027: *
028: * @author Alexander Zgursky
029: * @author Kirill Sorokin
030: */
031: public interface ProcessInstance {
032:
033: //TODO:change states to enum
034:
035: /** State is unknown. */
036: int STATE_UNKNOWN = 0;
037:
038: /** Process instance is currently running. */
039: int STATE_RUNNING = 1;
040:
041: /** Process instance has been suspended. */
042: int STATE_SUSPENDED = 2;
043:
044: /** Process instance completed its execution without fault. */
045: int STATE_COMPLETED = 3;
046:
047: /** Process instance completed its execution with fault. */
048: int STATE_FAILED = 4;
049:
050: /** Process instance has been terminated. */
051: int STATE_TERMINATED = 5;
052:
053: /**
054: * Returns the name of the process instance.
055: *
056: * @return the name of the process instance;
057: */
058: String getName();
059:
060: /**
061: * Returns the state of the process instance.
062: *
063: * @return the state of the process instance
064: *
065: * @see #STATE_UNKNOWN
066: * @see #STATE_RUNNING
067: * @see #STATE_SUSPENDED
068: * @see #STATE_COMPLETED
069: * @see #STATE_FAILED
070: * @see #STATE_TERMINATED
071: */
072: int getState();
073:
074: /**
075: * Returns position at which this process instance has been suspended.
076: *
077: * @return current position at which this process instance has been
078: * suspended or <code>null</code> if it's not suspended
079: *
080: * @see #getState()
081: */
082: Position getCurrentPosition();
083:
084: BpelProcess getProcess();
085:
086: ProcessExecutionModel getProcessExecutionModel();
087:
088: void pause();
089:
090: /**
091: * Resumes process instance if it's suspended or does nothing otherwise.
092: */
093: void resume();
094:
095: void stepInto();
096:
097: void stepOver();
098:
099: void stepOut();
100:
101: void terminate();
102:
103: Variable[] getVariables();
104:
105: RuntimePartnerLink[] getRuntimePartnerLinks();
106:
107: CorrelationSet[] getCorrelationSets();
108:
109: Fault[] getFaults();
110:
111: Value evaluate(String xpathExpression)
112: throws InvalidStateException, EvaluationException;
113: }
|