com.groiss.wf
Interface WfEngine

All Superinterfaces:
java.rmi.Remote, RemoteWfEngine

public interface WfEngine
extends RemoteWfEngine

This interface encapsulates the functionality of the @enterprise workflow engine. An object implementing this interface can be created on the server or the client.

Most methods have an implicit user parameter. This is initialized as the ThreadPrincipal from the ThreadContext when the WfEngine object is created.


Field Summary
 
Fields inherited from interface com.groiss.wf.RemoteWfEngine
INVISIBLE, MUST, NO_ADDDEL, READ_ONLY, READ_WRITE, TEXT
 
Method Summary
 void abort(ProcessInstance process)
          Abort a process.
 void abort(ProcessInstance process, java.lang.String comment)
          Abort a process and add a DMSNote with a generated Subject and a given comment.
 void abortParforSiblings(ActivityInstance parfor)
          Abort the running siblings of the current parfor instances.
 void abortSiblings(ActivityInstance join)
          Abort the siblings of the par branch.
 void addAgent(ActivityInstance ai, Agent a, OrgUnit ou, DMSNote note)
          Add an agent which receives the process after the current agent
 void addParforInstances(java.lang.String stepid, ActivityInstance previous)
          Start additional parfor branches for the given step.
 void archive(ProcessInstance process)
          Archive a process.
 ActivityInstance changeAgent(ActivityInstance ai, Agent a, OrgUnit ou, java.lang.String comment)
          Give the activity instance to another agent.
 void closePredecessor(ActivityInstance ai)
          If the predecessor of ai was not finished completely (is in status WAITING) and the necessary action is done now (for example setting the agent for ai) this method will complete it.
 ActivityInstance copyTo(ActivityInstance ai, User u)
          Send a copy to another user.
 ProcessInstance createProcessInstance(ProcessDefinition p, User u, OrgUnit d, java.util.Date duedate, java.lang.String id)
          Create a process instance.
 ProcessInstance createProcessInstance(ProcessDefinition p, User u, OrgUnit d, java.util.Date duedate, java.lang.String id, DMSForm f)
          Create a process instance.
 void finish(ActivityInstance ai)
          Finsh an activity, the engine starts the next step.
 void finishChoice(ActivityInstance ai)
          Finishs a choice branch, abort the other branches.
 java.util.List<ActivityInstance> getActiveTasks(ProcessInstance process)
          Get the list of active activities of a process instance.
 java.util.List<ActivityInstance> getActiveTasks(ProcessInstance process, User u)
          Get the list of active activities of a process instance assigned to a user.
 java.util.List<ActivityInstance> getActivities(java.lang.String condition)
          Find the activity instances with a given condition.
 ActivityInstance getActivityInstance(long oid)
          Find a activity instance from the given oid.
 java.util.List<ActivityInstance> getActivityInstances(ProcessInstance process)
          Get the list of all direct activity instances of a process instance.
 java.util.List<ActivityInstance> getActivityInstances(ProcessInstance process, java.lang.String steplabel)
          Get the list of direct activity instances of a particular step in a process.
 java.util.List<? extends ActivityInstance> getAllInteractiveTasks(ProcessInstance process)
          Get the list of ALL active, interactive activities of a process instance.
 java.util.List<java.util.List<ActivityInstance>> getChoiceSteps(ActivityInstance ai)
          Use this method to get the possible choice branches when the process execution reaches a choice.
 ActivityInstance getContext()
          Return the current activity instance.
 java.util.List<DMSObject> getDocuments(ProcessInstance process)
          Get the list of DMS objects (e.g.
 java.util.Map<java.lang.String,java.lang.Short> getFieldModes(ActivityInstance ai, DMSForm f)
          Get field modes for form fields
 java.util.Map<java.lang.String,java.lang.Short> getFieldModes(ActivityInstance ai, DMSForm form, DMSForm mainform, java.lang.String id)
          Get field modes for form fields and subforms
 DMSForm getForm(ProcessInstance pi, java.lang.String name)
          Get a form of a process.
 java.util.List<DMSForm> getForms(ProcessInstance process)
          Get the forms of a process.
 PersistentVersion getFormVersion(DMSForm form, ActivityInstance ai)
          Returns the version of the passed form in the context of the passed activity instance
 ProcessInstance getMainProcess(ActivityInstance ai)
          Get the root of the activity instance tree
 java.util.List<DMSNote> getNotes(ProcessInstance process)
          Get the notes to a process instances
 ProcessInstance getParent(ActivityInstance ai)
          Get the process instance of the given activity instance.
 ProcessInstance getProcess(DMSForm f)
          Find the process instance where the given form is attached.
 ProcessInstance getProcess(long oid)
          Find a process instance from the given oid.
 ProcessInstance getProcess(java.lang.String id)
          Find a process instance from the given id.
 ProcessDefinition getProcessDefinition(java.lang.String id)
          Find a process definition with the given id and status=active, if more than one is found, the process definition with the highest version number is returned.
 ProcessDefinition getProcessDefinition(java.lang.String id, int version)
          Find a process definition with the given id and version.
 java.util.List<ProcessInstance> getProcesses(java.lang.String condition)
          Find the process instances with a given condition.
 ProcessInstance getProcessFromForm(long formoid)
          Find a process instance from the oid of a form.
 java.util.List<ActivityInstance> getRoleSuspensionList(Application a)
          Get the role suspension list of the current user.
 java.util.List<ActivityInstance> getRoleWorklist(Application a)
          Get the role worklist of the current user.
 java.lang.String getServerProperty(java.lang.String prop)
          Returns a property from the server
 java.util.List<Pair<ProcessDefinition,java.util.List<OrgUnit>>> getStartableProcesses(Application appl)
          List the process definitions of the given application, which are startable for the user.
 Store getStore()
          Return the underlying store.
 java.util.List<ActivityInstance> getSuspensionList(Application a)
          Get the personal suspension list of the current user.
 java.util.List<Suspension> getSuspensions(ActivityInstance ai)
          Find out when and how the activity instance was in the suspension list.
 Task getTask(java.lang.String id)
          Find a task with the given id and status=active, if more than one is found, the task with the highest version number is returned.
 Task getTask(java.lang.String id, int version)
          Find a task with the given id and version.
 User getUser()
          Get the user.
 java.util.List<ActivityInstance> getWaitingList(Application a)
          Get the list of waiting activities of the current user.
 java.util.List<ActivityInstance> getWorklist(Application a, boolean withRepr)
          Get the worklist of the current user.
 ActivityInstance goBack(ActivityInstance ai, ActivityInstance ai2, java.lang.String comment)
          Go back to a previous step.
 void goBackToLastInteractive(ActivityInstance ai, java.lang.String comment)
          
 void gotoTask(ActivityInstance ai, java.lang.String stepname, Agent ag, OrgUnit ou, java.lang.String comment)
          Goto another task.
 void gotoTask(ProcessInstance process, java.lang.String taskid, Agent ag, java.lang.String comment)
          Deprecated. 
 boolean hasDocuments(ProcessInstance process)
          Has the process documents attached?
 boolean hasNotes(ProcessInstance process)
          Has the process notes attached?
 boolean hasSeen(ActivityInstance ai)
          Returns true if the ActivityInstance has been seen by the current user.
 java.util.List<PersistentVersion> listFormVersions(ActivityInstance ai)
          Returns a list of form versions (at most one for each process form) which were made in the context of the passed activity instance.
 java.util.List<ActivityInstance> listPredecessors(ActivityInstance ai)
          Return the list of predecessor steps of an activity instance.
 java.util.List<Pair<ActivityInstance,java.util.List<ActivityInstance>>> listPreviousSteps(ActivityInstance ai)
          List the previous steps of the process (possible go back targets).
 java.util.List<ProcessDefinition> listProcessDefinitions(Application appl)
          List the process definitions of the given application
 java.util.List<ActivityInstance> listSuccessors(ActivityInstance ai)
          Return the list of successor steps of an activity instance.
 ActivityInstance makeBranch(ProcessInstance process, Task t, Agent a, OrgUnit d)
          Insert a new step to the running process.
 void makeBranch(ProcessInstance process, Task t, Agent a, OrgUnit d, java.util.List forms)
          Deprecated. 
 ActivityInstance makeVersion(ActivityInstance ai, java.lang.String desc, boolean withDocs)
          Versions the passed activity instance, the process forms and the documents (optional) and returns a new activity instance which is a copy of the passed one.
 void reactivate(ProcessInstance process)
          Reactivate a process.
 void reactivate(ProcessInstance process, java.lang.String comment)
          Reactivate a process.
 void reactivateAndTake(ProcessInstance process, java.lang.String comment)
          Reactivate a process and take the reactivated tasks.
 void refreshWLCache(User u)
          Refresh the organizational data in the WorklistCache for a particular user.
 void refreshWLCacheOrgData()
          Refresh the organizational data in the worklist cache.
 void seeAgain(ActivityInstance ai)
          Move the activity instance from the suspension list to the worklist.
 void seeLater(ActivityInstance ai, java.util.Date d)
          Move the activity instance from the worklist to the suspension list.
 void seeLater(ActivityInstance ai, java.util.Date d, java.lang.String description)
          Move the activity instance from the worklist to the suspension list.
 void setAgent(ActivityInstance ai, Agent a)
          Give the activity instance to another agent.
 void setCheckedOut(ActivityInstance ai, boolean state)
          Set the activityInstance as checcked out or in (i.e.
 void setContext(ActivityInstance ai)
          
 void setDescription(ActivityInstance ai, java.lang.String descr)
          Set the description of an activity instance.
 void setDuedate(ActivityInstance ai, java.util.Date d)
          Set the duedate of the activity instance.
 void setFinished(ActivityInstance ai)
          Set the status of the activity instance to FINISHED.
 void setId(ProcessInstance pi, java.lang.String s)
          Set the id of the process instance.
 void setOrgUnit(ActivityInstance ai, OrgUnit d)
          Change the organizational unit of a process.
 void setPriority(ProcessInstance pi, int priority)
          Set the priority of the process instance.
 void setSeen(ActivityInstance ai, boolean seen)
          Set the given ActivityInstance to seen/unseen for the current user.
 void setStepAgent(ActivityInstance ai, Agent a)
          Set the step-agent of the activity instance to another agent.
 void setSubject(ProcessInstance process)
          Set the subject of the process instance according to the definition in the process definition.
 void setSubjectToString(ProcessInstance process, java.lang.String str)
          Set the subject of the process instance o the given string value.
 void setUser(User u)
          Set the user.
 void start(ProcessInstance pi)
          Start a process instance, which was previously created, but not started.
 ProcessInstance startProcess(ProcessDefinition p, User u, OrgUnit d, java.util.Date duedate, java.lang.String id)
          Start a process.
 ProcessInstance startProcess(ProcessDefinition p, User u, OrgUnit d, java.util.Date duedate, java.lang.String id, DMSForm f)
          Start a process.
 ActivityInstance take(ActivityInstance ai)
          Take an activity: move it from the role-worklist to the worklist.
 ActivityInstance untake(ActivityInstance ai)
          Put back an activity: move it from the worklist to the role-worklist.
 void updateForm(DMSForm f)
          Update the form (make the changes persistent).
 

Method Detail

setUser

void setUser(User u)
Set the user.

Specified by:
setUser in interface RemoteWfEngine
Parameters:
u - a user

getUser

User getUser()
Get the user.

Specified by:
getUser in interface RemoteWfEngine
Returns:
the user that is used for all engine operations.

getStore

Store getStore()
Return the underlying store.

Specified by:
getStore in interface RemoteWfEngine
Returns:
a store object

getProcessDefinition

ProcessDefinition getProcessDefinition(java.lang.String id)
Find a process definition with the given id and status=active, if more than one is found, the process definition with the highest version number is returned.

Specified by:
getProcessDefinition in interface RemoteWfEngine
Parameters:
id - the id of the process
Returns:
a process definition

getProcessDefinition

ProcessDefinition getProcessDefinition(java.lang.String id,
                                       int version)
Find a process definition with the given id and version.

Specified by:
getProcessDefinition in interface RemoteWfEngine
Parameters:
id - the id of the process
version - the version of the process
Returns:
a process definition

listProcessDefinitions

java.util.List<ProcessDefinition> listProcessDefinitions(Application appl)
List the process definitions of the given application

Specified by:
listProcessDefinitions in interface RemoteWfEngine
Parameters:
appl - the application
Returns:
a list of ProcessDefinition objects

getStartableProcesses

java.util.List<Pair<ProcessDefinition,java.util.List<OrgUnit>>> getStartableProcesses(Application appl)
List the process definitions of the given application, which are startable for the user. A process is startable, if it is active and the agent of the first step is either the user or a role the user has.

Specified by:
getStartableProcesses in interface RemoteWfEngine
Returns:
the list of pairs of processes and lists of OrgUnits

getTask

Task getTask(java.lang.String id)
Find a task with the given id and status=active, if more than one is found, the task with the highest version number is returned.

Specified by:
getTask in interface RemoteWfEngine
Parameters:
id - the id of the task
Returns:
a task, null if no task has the given id

getTask

Task getTask(java.lang.String id,
             int version)
Find a task with the given id and version.

Specified by:
getTask in interface RemoteWfEngine
Parameters:
id - the id of the task
version - the version of the task
Returns:
a task

startProcess

ProcessInstance startProcess(ProcessDefinition p,
                             User u,
                             OrgUnit d,
                             java.util.Date duedate,
                             java.lang.String id)
Start a process. ProcessDefinition and OrgUnit must not be null.

Specified by:
startProcess in interface RemoteWfEngine
Parameters:
p - the process definition
u - the user
d - the org. unit
duedate - the duedate
id - the id of the process instance
Returns:
the process instance

startProcess

ProcessInstance startProcess(ProcessDefinition p,
                             User u,
                             OrgUnit d,
                             java.util.Date duedate,
                             java.lang.String id,
                             DMSForm f)
Start a process. ProcessDefinition and OrgUnit must not be null. The form must be already in the database.

Specified by:
startProcess in interface RemoteWfEngine
Parameters:
p - the process definition
u - the user
d - the org. unit
duedate - the duedate
id - the id of the process instance
f - a form
Returns:
the process instance

createProcessInstance

ProcessInstance createProcessInstance(ProcessDefinition p,
                                      User u,
                                      OrgUnit d,
                                      java.util.Date duedate,
                                      java.lang.String id)
Create a process instance. ProcessDefinition and OrgUnit must not be null. The process instance waits at the begin step until this activityinstance will be finished explicitely, or until start(pi) is called.

Specified by:
createProcessInstance in interface RemoteWfEngine
Parameters:
p - the process definition
u - the user
d - the org. unit
duedate - the duedate
id - the id of the process instance
Returns:
the process instance

createProcessInstance

ProcessInstance createProcessInstance(ProcessDefinition p,
                                      User u,
                                      OrgUnit d,
                                      java.util.Date duedate,
                                      java.lang.String id,
                                      DMSForm f)
Create a process instance. ProcessDefinition and OrgUnit must not be null. The process instance waits at the begin step until this activityinstance will be finished explicitely, or until start(pi) is called.

Specified by:
createProcessInstance in interface RemoteWfEngine
Parameters:
p - the process definition
u - the user
d - the org. unit
duedate - the duedate
id - the id of the process instance
f - a form
Returns:
the process instance

start

void start(ProcessInstance pi)
Start a process instance, which was previously created, but not started.

Specified by:
start in interface RemoteWfEngine
Parameters:
pi - the process instance to start

getWorklist

java.util.List<ActivityInstance> getWorklist(Application a,
                                             boolean withRepr)
Get the worklist of the current user.

Specified by:
getWorklist in interface RemoteWfEngine
Parameters:
a - the application, if null return work items for all applications
withRepr - if true add the work items assigned to persons the user substitutes.
Returns:
a list of activity instances

getWaitingList

java.util.List<ActivityInstance> getWaitingList(Application a)
Get the list of waiting activities of the current user.

Specified by:
getWaitingList in interface RemoteWfEngine
Parameters:
a - the application, if null return waiting items for all applications
Returns:
a list of activity instances

getRoleWorklist

java.util.List<ActivityInstance> getRoleWorklist(Application a)
Get the role worklist of the current user.

Specified by:
getRoleWorklist in interface RemoteWfEngine
Parameters:
a - the application, if null return work items for all applications
Returns:
a list of activity instances

getSuspensionList

java.util.List<ActivityInstance> getSuspensionList(Application a)
Get the personal suspension list of the current user.

Specified by:
getSuspensionList in interface RemoteWfEngine
Parameters:
a - the application, if null return work items for all applications
Returns:
a list of activity instances

getRoleSuspensionList

java.util.List<ActivityInstance> getRoleSuspensionList(Application a)
Get the role suspension list of the current user.

Specified by:
getRoleSuspensionList in interface RemoteWfEngine
Parameters:
a - the application, if null return work items for all applications
Returns:
a list of activity instances

getProcess

ProcessInstance getProcess(java.lang.String id)
Find a process instance from the given id.

Specified by:
getProcess in interface RemoteWfEngine
Parameters:
id - the process instance id
Returns:
the process instance

getProcess

ProcessInstance getProcess(long oid)
Find a process instance from the given oid.

Specified by:
getProcess in interface RemoteWfEngine
Parameters:
oid - the process instance oid
Returns:
the process instance

getProcessFromForm

ProcessInstance getProcessFromForm(long formoid)
Find a process instance from the oid of a form.

Specified by:
getProcessFromForm in interface RemoteWfEngine
Parameters:
formoid - the oid of a process form
Returns:
the process instance

getActivityInstance

ActivityInstance getActivityInstance(long oid)
Find a activity instance from the given oid.

Specified by:
getActivityInstance in interface RemoteWfEngine
Parameters:
oid - the activity instance oid
Returns:
the process instance

getProcess

ProcessInstance getProcess(DMSForm f)
Find the process instance where the given form is attached. The method returns a process if and only if the form is a process form. It returns null for subforms.

Specified by:
getProcess in interface RemoteWfEngine
Parameters:
f - the form
Returns:
the process instance

getProcesses

java.util.List<ProcessInstance> getProcesses(java.lang.String condition)
Find the process instances with a given condition.

Specified by:
getProcesses in interface RemoteWfEngine
Parameters:
condition - a SQL where clause
Returns:
a list of process instances

getActivities

java.util.List<ActivityInstance> getActivities(java.lang.String condition)
Find the activity instances with a given condition.

Specified by:
getActivities in interface RemoteWfEngine
Parameters:
condition - a SQL where clause
Returns:
a list of activity instances

getAllInteractiveTasks

java.util.List<? extends ActivityInstance> getAllInteractiveTasks(ProcessInstance process)
Get the list of ALL active, interactive activities of a process instance. ATTENTION: this method returns all interactive (Type =ActivityInstance.TASK) ActivityInstances of the given ProcessInstance, even ALL children of ActivityInstance.PAR, ActivityInstance.PARFOR and ActivityInstance.SCOPE will be returned

Specified by:
getAllInteractiveTasks in interface RemoteWfEngine
Parameters:
process - the process instance
Returns:
a list of activity instances

getActiveTasks

java.util.List<ActivityInstance> getActiveTasks(ProcessInstance process)
Get the list of active activities of a process instance. ATTENTION: this method returns all types of ActivityInstance, but doesn't return ALL ActivityInstances of the given ProcessInstance. children of ActivityInstance.PAR, ActivityInstance.PARFOR and ActivityInstance.SCOPE will not be returned

Specified by:
getActiveTasks in interface RemoteWfEngine
Parameters:
process - the process instance
Returns:
a list of activity instances

getActiveTasks

java.util.List<ActivityInstance> getActiveTasks(ProcessInstance process,
                                                User u)
Get the list of active activities of a process instance assigned to a user. ATTENTION: this method returns all types of ActivityInstance, but doesn't return ALL ActivityInstances of the given ProcessInstance. children of ActivityInstance.PAR, ActivityInstance.PARFOR and ActivityInstance.SCOPE will not be returned

Specified by:
getActiveTasks in interface RemoteWfEngine
Parameters:
process - the process instance
u - the user
Returns:
a list of activity instances

getActivityInstances

java.util.List<ActivityInstance> getActivityInstances(ProcessInstance process)
Get the list of all direct activity instances of a process instance.

ATTENTION: this method doesn't return ALL ActivityInstances of the given ProcessInstance. children of ActivityInstance.PROCESS, ActivityInstance.PARFOR and ActivityInstance.SCOPE will not be returned

Specified by:
getActivityInstances in interface RemoteWfEngine
Parameters:
process - the process instance
Returns:
a list of activity instances

getActivityInstances

java.util.List<ActivityInstance> getActivityInstances(ProcessInstance process,
                                                      java.lang.String steplabel)
Get the list of direct activity instances of a particular step in a process.

ATTENTION: this method doesn't return ALL ActivityInstances of the given ProcessInstance. children of ActivityInstance.PROCESS, ActivityInstance.PARFOR and ActivityInstance.SCOPE will not be returned

Specified by:
getActivityInstances in interface RemoteWfEngine
Parameters:
process - the process instance
steplabel - the label of the step
Returns:
a list of activity instances

getDocuments

java.util.List<DMSObject> getDocuments(ProcessInstance process)
Get the list of DMS objects (e.g. documents, folders) attached to a process.

Specified by:
getDocuments in interface RemoteWfEngine
Parameters:
process - the process instance
Returns:
a list of DMSObject

getForm

DMSForm getForm(ProcessInstance pi,
                java.lang.String name)
Get a form of a process.

Specified by:
getForm in interface RemoteWfEngine
Parameters:
pi - the process instance
Returns:
the form

getForms

java.util.List<DMSForm> getForms(ProcessInstance process)
Get the forms of a process.

Specified by:
getForms in interface RemoteWfEngine
Parameters:
process - the process instance
Returns:
the forms (DMSForm objects)

getMainProcess

ProcessInstance getMainProcess(ActivityInstance ai)
Get the root of the activity instance tree

Specified by:
getMainProcess in interface RemoteWfEngine
Parameters:
ai - an activity instance
Returns:
the process instance of the main process of the given activity instance.

getParent

ProcessInstance getParent(ActivityInstance ai)
Get the process instance of the given activity instance.

Specified by:
getParent in interface RemoteWfEngine
Parameters:
ai - an activity instance
Returns:
the process instance

getNotes

java.util.List<DMSNote> getNotes(ProcessInstance process)
Get the notes to a process instances

Specified by:
getNotes in interface RemoteWfEngine
Parameters:
process - a process instance
Returns:
a list of notes (DMSNote objects)

hasDocuments

boolean hasDocuments(ProcessInstance process)
Has the process documents attached?

Specified by:
hasDocuments in interface RemoteWfEngine
Parameters:
process - a process instance
Returns:
true if documents are present

hasNotes

boolean hasNotes(ProcessInstance process)
Has the process notes attached?

Specified by:
hasNotes in interface RemoteWfEngine
Parameters:
process - a process instance
Returns:
true if notes are present

getFieldModes

java.util.Map<java.lang.String,java.lang.Short> getFieldModes(ActivityInstance ai,
                                                              DMSForm f)
Get field modes for form fields

Specified by:
getFieldModes in interface RemoteWfEngine
Parameters:
ai - an activity instance
f - the form
Returns:
A map where the keys are the attribute names, the values are INVISIBLE, READ_ONLY, and READ_WRITE as short objects

getFieldModes

java.util.Map<java.lang.String,java.lang.Short> getFieldModes(ActivityInstance ai,
                                                              DMSForm form,
                                                              DMSForm mainform,
                                                              java.lang.String id)
Get field modes for form fields and subforms

Specified by:
getFieldModes in interface RemoteWfEngine
Parameters:
ai - activity instance
form - form or sub form, may be null if mainform is set
mainform - main form, may be null if form is already contain mainform
id - subform relation id
Returns:
Map of FormFieldMode2 objects

getSuspensions

java.util.List<Suspension> getSuspensions(ActivityInstance ai)
Find out when and how the activity instance was in the suspension list.

Specified by:
getSuspensions in interface RemoteWfEngine
Returns:
a list of Suspensions

take

ActivityInstance take(ActivityInstance ai)
Take an activity: move it from the role-worklist to the worklist.

Specified by:
take in interface RemoteWfEngine
Parameters:
ai - an activity instance
Returns:
the activity instance now active, this may be the same as as the parameter but can alos be another object

finish

void finish(ActivityInstance ai)
Finsh an activity, the engine starts the next step.

Specified by:
finish in interface RemoteWfEngine
Parameters:
ai - an activity instance

getChoiceSteps

java.util.List<java.util.List<ActivityInstance>> getChoiceSteps(ActivityInstance ai)
Use this method to get the possible choice branches when the process execution reaches a choice. The method returns a list of lists, each inner list contains the choice branches belonging to one choice.

Specified by:
getChoiceSteps in interface RemoteWfEngine
Returns:
a list of lists of ActivityInstances

finishChoice

void finishChoice(ActivityInstance ai)
Finishs a choice branch, abort the other branches.

Specified by:
finishChoice in interface RemoteWfEngine
Parameters:
ai - the choice step on the branch you want to follows

closePredecessor

void closePredecessor(ActivityInstance ai)
If the predecessor of ai was not finished completely (is in status WAITING) and the necessary action is done now (for example setting the agent for ai) this method will complete it. If the predecessor is in another state it does nothing.

Specified by:
closePredecessor in interface RemoteWfEngine

listPreviousSteps

java.util.List<Pair<ActivityInstance,java.util.List<ActivityInstance>>> listPreviousSteps(ActivityInstance ai)
List the previous steps of the process (possible go back targets).

Specified by:
listPreviousSteps in interface RemoteWfEngine
Parameters:
ai - current activity instance
Returns:
a list of Pairs. The first element of the pair is a previous activity instance, the second is a list of activities that must be aborted when going back to this step (for example siblings in a parallelism).

goBack

ActivityInstance goBack(ActivityInstance ai,
                        ActivityInstance ai2,
                        java.lang.String comment)
Go back to a previous step. A clone of the given previous activity instance of this process instance is created, the comment is added to the new activity.

Specified by:
goBack in interface RemoteWfEngine
Parameters:
ai - an activity instance
ai2 - a finished activity instance
comment - a comment
Returns:
the activity instance now active

untake

ActivityInstance untake(ActivityInstance ai)
Put back an activity: move it from the worklist to the role-worklist.

Specified by:
untake in interface RemoteWfEngine
Parameters:
ai - an activity instance
Returns:
the activity instance now active

seeLater

void seeLater(ActivityInstance ai,
              java.util.Date d)
Move the activity instance from the worklist to the suspension list.

Specified by:
seeLater in interface RemoteWfEngine
Parameters:
ai - an activity instance
d - the date, when the item should reappear in the worklist

seeLater

void seeLater(ActivityInstance ai,
              java.util.Date d,
              java.lang.String description)
Move the activity instance from the worklist to the suspension list.

Specified by:
seeLater in interface RemoteWfEngine
Parameters:
ai - an activity instance
d - the date, when the item should reappear in the worklist
description - an optional comment

seeAgain

void seeAgain(ActivityInstance ai)
Move the activity instance from the suspension list to the worklist.

Specified by:
seeAgain in interface RemoteWfEngine
Parameters:
ai - an activity instance

setAgent

void setAgent(ActivityInstance ai,
              Agent a)
Give the activity instance to another agent. Please note that this method does not set the step agent (which is needed e.g. for untake operation)!

Specified by:
setAgent in interface RemoteWfEngine
Parameters:
ai - an activity instance
a - an agent (user or role)

changeAgent

ActivityInstance changeAgent(ActivityInstance ai,
                             Agent a,
                             OrgUnit ou,
                             java.lang.String comment)
Give the activity instance to another agent. Change is visible in process history

Specified by:
changeAgent in interface RemoteWfEngine
Parameters:
ai - an activity instance
a - an agent (user or role)
ou - an org-unit, may be null
comment - optional comment to the next agent

setStepAgent

void setStepAgent(ActivityInstance ai,
                  Agent a)
Set the step-agent of the activity instance to another agent. This is the agent where a untake of the activity instance

Specified by:
setStepAgent in interface RemoteWfEngine
Parameters:
ai - an activity instance
a - an agent (user or role)

gotoTask

@Deprecated
void gotoTask(ProcessInstance process,
                         java.lang.String taskid,
                         Agent ag,
                         java.lang.String comment)
Deprecated. 

Goto another task. The process flow leaves the defined route and jumps to the given task. The id of the task, an agent and a comment is given.

Specified by:
gotoTask in interface RemoteWfEngine
Parameters:
process - an processinstance instance
taskid - id of a task
ag - an agent (user or role)
comment - a comment string

gotoTask

void gotoTask(ActivityInstance ai,
              java.lang.String stepname,
              Agent ag,
              OrgUnit ou,
              java.lang.String comment)
Goto another task. The process flow leaves the defined route and jumps to the given task.

Specified by:
gotoTask in interface RemoteWfEngine
Parameters:
ai - an activity instance
stepname - the name of a step to jump to, set the name in the process definition (editor or WDL).
ag - an agent (user or role), may be null
ou - the org.unit (may be null)
comment - a comment string

copyTo

ActivityInstance copyTo(ActivityInstance ai,
                        User u)
Send a copy to another user.

Specified by:
copyTo in interface RemoteWfEngine
Parameters:
ai - an activity instance
u - a user
Returns:
the copy activity instance

makeBranch

@Deprecated
void makeBranch(ProcessInstance process,
                           Task t,
                           Agent a,
                           OrgUnit d,
                           java.util.List forms)
Deprecated. 

Insert a new step - subprocess or task - to the running process. The step is added as a branch and can be completed independent of the process.

Specified by:
makeBranch in interface RemoteWfEngine

makeBranch

ActivityInstance makeBranch(ProcessInstance process,
                            Task t,
                            Agent a,
                            OrgUnit d)
Insert a new step to the running process. The step is added as a branch and can be completed independent of the process.

Specified by:
makeBranch in interface RemoteWfEngine
Parameters:
process - instance of the process
t - a task assigned to the process
a - a user or role
d - an optional department

addParforInstances

void addParforInstances(java.lang.String stepid,
                        ActivityInstance previous)
Start additional parfor branches for the given step. Branches are only started if there are already running branches.

Specified by:
addParforInstances in interface RemoteWfEngine
Parameters:
stepid - the id of the parfor step
previous - an activity instance of the same process instance

setOrgUnit

void setOrgUnit(ActivityInstance ai,
                OrgUnit d)
Change the organizational unit of a process.

Specified by:
setOrgUnit in interface RemoteWfEngine
Parameters:
ai - an activity instance
d - the OrgUnit

setDescription

void setDescription(ActivityInstance ai,
                    java.lang.String descr)
Set the description of an activity instance.

Specified by:
setDescription in interface RemoteWfEngine
Parameters:
ai - an activity instance
descr - the new desription

setSubject

void setSubject(ProcessInstance process)
Set the subject of the process instance according to the definition in the process definition.

Specified by:
setSubject in interface RemoteWfEngine
Parameters:
process - the process instance

setSubjectToString

void setSubjectToString(ProcessInstance process,
                        java.lang.String str)
Set the subject of the process instance o the given string value.

Specified by:
setSubjectToString in interface RemoteWfEngine
Parameters:
process - the process instance
str - the new subject

updateForm

void updateForm(DMSForm f)
Update the form (make the changes persistent).

Specified by:
updateForm in interface RemoteWfEngine
Parameters:
f - the form

setDuedate

void setDuedate(ActivityInstance ai,
                java.util.Date d)
Set the duedate of the activity instance.

Specified by:
setDuedate in interface RemoteWfEngine
Parameters:
ai - an activity instance
d - the new due date

setId

void setId(ProcessInstance pi,
           java.lang.String s)
Set the id of the process instance.

Specified by:
setId in interface RemoteWfEngine
Parameters:
pi - a process instance
s - the new id

setPriority

void setPriority(ProcessInstance pi,
                 int priority)
Set the priority of the process instance.

Specified by:
setPriority in interface RemoteWfEngine
Parameters:
pi - a process instance
priority - the new priority, two digit integer, starting with 0 (means lowest priority).

abort

void abort(ProcessInstance process)
Abort a process.

Specified by:
abort in interface RemoteWfEngine
Parameters:
process - the process instance

reactivate

void reactivate(ProcessInstance process)
Reactivate a process.

Specified by:
reactivate in interface RemoteWfEngine
Parameters:
process - the process instance

archive

void archive(ProcessInstance process)
Archive a process. Remove it from the database.

Specified by:
archive in interface RemoteWfEngine
Parameters:
process - the process instance

abort

void abort(ProcessInstance process,
           java.lang.String comment)
Abort a process and add a DMSNote with a generated Subject and a given comment.

Specified by:
abort in interface RemoteWfEngine
Parameters:
process - the process instance
comment - a comment, why the process is aborted

reactivate

void reactivate(ProcessInstance process,
                java.lang.String comment)
Reactivate a process.

Specified by:
reactivate in interface RemoteWfEngine
Parameters:
process - the process instance
comment - a comment, why the process is reactivated

reactivateAndTake

void reactivateAndTake(ProcessInstance process,
                       java.lang.String comment)
Reactivate a process and take the reactivated tasks.

Specified by:
reactivateAndTake in interface RemoteWfEngine
Parameters:
process - the process instance
comment - a comment, why the process is reactivated

getContext

ActivityInstance getContext()
Return the current activity instance. This method returns a non-null value when called from a postcondition, preprocessing, compensation method of a task of from a system step or a condition in a process definition.

Specified by:
getContext in interface RemoteWfEngine
Returns:
an activity instance

setContext

void setContext(ActivityInstance ai)

Specified by:
setContext in interface RemoteWfEngine

getServerProperty

java.lang.String getServerProperty(java.lang.String prop)
Returns a property from the server

Specified by:
getServerProperty in interface RemoteWfEngine
Returns:
the property, null if the property is unknown.

listSuccessors

java.util.List<ActivityInstance> listSuccessors(ActivityInstance ai)
Return the list of successor steps of an activity instance.

Specified by:
listSuccessors in interface RemoteWfEngine
Returns:
a list of activity instances

listPredecessors

java.util.List<ActivityInstance> listPredecessors(ActivityInstance ai)
Return the list of predecessor steps of an activity instance.

Specified by:
listPredecessors in interface RemoteWfEngine
Returns:
a list of activity instances

addAgent

void addAgent(ActivityInstance ai,
              Agent a,
              OrgUnit ou,
              DMSNote note)
Add an agent which receives the process after the current agent

Specified by:
addAgent in interface RemoteWfEngine
Parameters:
ai - the activity instance
a - a user or role
ou - an organizational unit, if null the ou of the previous activity instance is used
note - an (optional) note to the agent of the activity

setCheckedOut

void setCheckedOut(ActivityInstance ai,
                   boolean state)
Set the activityInstance as checcked out or in (i.e. is on mobile server)

Specified by:
setCheckedOut in interface RemoteWfEngine
Parameters:
ai - the activity instance
state - if true we check it out

goBackToLastInteractive

void goBackToLastInteractive(ActivityInstance ai,
                             java.lang.String comment)

Specified by:
goBackToLastInteractive in interface RemoteWfEngine

makeVersion

ActivityInstance makeVersion(ActivityInstance ai,
                             java.lang.String desc,
                             boolean withDocs)
Versions the passed activity instance, the process forms and the documents (optional) and returns a new activity instance which is a copy of the passed one.

Specified by:
makeVersion in interface RemoteWfEngine
Parameters:
ai - the activity instance to version
desc - a comment for this version
withDocs - if true all the documents are also versioned
Returns:
the new activity instance

refreshWLCacheOrgData

void refreshWLCacheOrgData()
Refresh the organizational data in the worklist cache.

Specified by:
refreshWLCacheOrgData in interface RemoteWfEngine

refreshWLCache

void refreshWLCache(User u)
Refresh the organizational data in the WorklistCache for a particular user.

Specified by:
refreshWLCache in interface RemoteWfEngine
Parameters:
u - - the user

setFinished

void setFinished(ActivityInstance ai)
Set the status of the activity instance to FINISHED. This method should be used only in the expressions in an andjoin or end parfor node. In case of parfor set the state of the parent of the current activity instance. In both cases if you set the state to finished the engine will continue the process after the parallelism.

Specified by:
setFinished in interface RemoteWfEngine
Parameters:
ai - the activity instance to be finished

abortSiblings

void abortSiblings(ActivityInstance join)
Abort the siblings of the par branch. The activity instance must be an instance of the andjoin node. Note that you must assure that the process continues after the andjoin, you can do this by calling wfEngine.setFinished(join) - otherwise the process will hang in the andjoin

Specified by:
abortSiblings in interface RemoteWfEngine

abortParforSiblings

void abortParforSiblings(ActivityInstance parfor)
Abort the running siblings of the current parfor instances. Note that you must assure that the process continues after the parfor, you can do this by calling wfEngine.setFinished(parfor) - otherwise the process will hang in the end parfor node

Specified by:
abortParforSiblings in interface RemoteWfEngine
Parameters:
parfor - an instance of the parfor step (a parent of an activityinstance inside the parfor)

setSeen

void setSeen(ActivityInstance ai,
             boolean seen)
Set the given ActivityInstance to seen/unseen for the current user.

Specified by:
setSeen in interface RemoteWfEngine

hasSeen

boolean hasSeen(ActivityInstance ai)
Returns true if the ActivityInstance has been seen by the current user.

Specified by:
hasSeen in interface RemoteWfEngine

getFormVersion

PersistentVersion getFormVersion(DMSForm form,
                                 ActivityInstance ai)
Returns the version of the passed form in the context of the passed activity instance

Specified by:
getFormVersion in interface RemoteWfEngine
Parameters:
form - the form which version is wanted
ai - the activity instance determining the context of the version
Returns:
the requested version or null if there is no such version

listFormVersions

java.util.List<PersistentVersion> listFormVersions(ActivityInstance ai)
Returns a list of form versions (at most one for each process form) which were made in the context of the passed activity instance.

Specified by:
listFormVersions in interface RemoteWfEngine
Parameters:
ai - the activity instance determining the context of the versions
Returns:
the requested versions or an empty list if there are no such versions


@enterprise 8.0.22989 Copyright © 2001-2017 Groiss Informatics GmbH. All Rights Reserved.