| org.concern.Controller
All known Subclasses: org.concern.controller.Controller,
Controller | public interface Controller (Code) | | The controller interface is the runtime client interface of con:cern. An implementation is responsible for
controlling the process flow and invoking the activities. It provides access to the log and the current state
information of the subjects in process.
Methods, that import the transactional context:
o createSubject
o lockSubject
o destroySubject
o getSubjects(..)
o complete
o notify
o getLog
o getArchive
o matchPrecondition
o matchPostcondition
author: hengels[at]mercatis[dot]de version: $Revision: 881 $ |
Method Summary | |
void | announceSubject(String userValue) Tell the controller, that a subjects has changed. | void | backward(String userValue, String activityName) | void | backward(String userValue, String activityName, Map<String, String> logAnnotations) | boolean | complete(String userValue, String activityName) Complete an asynchronous activtiy. | boolean | complete(String userValue, String activityName, Map<String, String> logAnnotations) Complete an asynchronous activtiy. | Integer | createSubject(String userValue) Create a new subject in the process. | void | destroySubject(String userValue) Mark the subject destroyed. | void | forward(String userValue, String activityName) | void | forward(String userValue, String activityName, Map<String, String> logAnnotations) | List<Log> | getArchive(String userValue) Subjects, that have reached been destroyed are removed from the process. | List<String> | getEnlistments(String userValue) | List<Log> | getLog(String userValue) The controller logs every successful or unsuccessful execution of an activity as well as the creation, destroyal
and stall of subjects. | List<String> | getOptions(String userValue) | org.concern.model.Process | getProcess() Return the process description. | String | getProcessName() A process is identified by a unique name. | List<String> | getSubjects(int state) Retrieve a list of all subjects, that are currently in the process. | List<String> | getSubjects(String activity) Get the ids of the subjects, that are enlisted for the specified asynchronous actvity. | List<String> | getTasks(String userValue) | boolean | isBackwardPossible(String userValue, String activityName) | boolean | isForwardPossible(String userValue, String activityName) | boolean | isKnownSubject(String userValue) Determines if
Controller.createSubject(String) has already been called
for the specified userValue . | void | lockSubject(String userValue) Write-lock the specified subject for the duration of the current transaction. | void | log(Log log) Append a message to the protocol of the specified subject. | Boolean | matchCondition(String userValue, String conditionName) Check if the subject matches the specified condition. | boolean | matchPostcondition(String userValue, String activityName) Check if the subject matches the postcondition of the specified activity. | boolean | matchPrecondition(String userValue, String activityName) Check if the subject matches the precondition of the specified activity. | boolean | notify(String userValue, String eventName) Notify the controller that an event has occured. | boolean | notify(String userValue, String eventName, Map<String, String> logAnnotations) Notify the controller that an event has occured.
If the logAnnotations property is not
null , then those annotations will be stored in the log
entry for the notification.
Parameters: userValue - Parameters: eventName - Parameters: logAnnotations - may contain client specific information to be stored with the log entry that will be created for this notification. | void | process(String userValue) Process the specified subject immediately. | void | reload() | void | reset(String userValue, String activityName) | void | resumeSubject(String userValue) | void | reviveSubject(String userValue) Restore the subject from the archive into the pool of running instances. | void | scheduleAnnouncement(String userValue, long duration) | void | start() Start the controller. | void | stop() Free all resources. | void | suspendSubject(String userValue) |
STATE_DESTROYED | final public static int STATE_DESTROYED(Code) | | |
STATE_RUNNING | final public static int STATE_RUNNING(Code) | | |
STATE_STALLED | final public static int STATE_STALLED(Code) | | |
STATE_SUSPENDED | final public static int STATE_SUSPENDED(Code) | | |
announceSubject | void announceSubject(String userValue) throws UnknownSubjectException, ControllerException(Code) | | Tell the controller, that a subjects has changed. This method has to be called in order to tell the controller,
that the particular subject should be examined for further execution.
Parameters: userValue - identifies the subject |
complete | boolean complete(String userValue, String activityName, Map<String, String> logAnnotations) throws org.concern.UnknownSubjectException, org.concern.ControllerException(Code) | | Complete an asynchronous activtiy. The controller checks the postcondition and logs the successful completion
of the activity. If the logAnnotations property is not
null , then those annotations will be stored in the log
entry for the completed activity.
Parameters: userValue - identifies the subject Parameters: activityName - the activity Parameters: logAnnotations - may contain client specific information to be stored with the log entry that will be created for this activity. This parameter may also be null . true if the postcondition is matching, false otherwise throws: org.concern.UnknownSubjectException - throws: org.concern.ControllerException - |
getProcessName | String getProcessName()(Code) | | A process is identified by a unique name. A separate controller instance is required for every process.
the name of the process that is controlled by this controller |
getSubjects | List<String> getSubjects(int state) throws ControllerException(Code) | | Retrieve a list of all subjects, that are currently in the process.
a list with the userValues of all subjects Parameters: state - one of STATE_RUNNING, STATE_IDLE, STATE_DESTROYED |
getSubjects | List<String> getSubjects(String activity) throws ControllerException(Code) | | Get the ids of the subjects, that are enlisted for the specified asynchronous actvity.
Parameters: activity - the activity name a list of subject ids |
notify | boolean notify(String userValue, String eventName, Map<String, String> logAnnotations) throws UnknownSubjectException, ControllerException(Code) | | Notify the controller that an event has occured.
If the logAnnotations property is not
null , then those annotations will be stored in the log
entry for the notification.
Parameters: userValue - Parameters: eventName - Parameters: logAnnotations - may contain client specific information to be stored with the log entry that will be created for this notification. This parameter may also be null . throws: UnknownSubjectException - |
reload | void reload()(Code) | | Reread the parameters from the parameter resolver
|
start | void start()(Code) | | Start the controller.
|
|
|