Package com.saperion.ws
Class SaWsWorkflowService
java.lang.Object
com.saperion.ws.AbstractService
com.saperion.ws.SaWsWorkflowService
This class wraps all methods of the SaClassicConnector. It parses the information, which is
fetched from the server to classes useable for web services. JAX-B requires classes to be
JavaBeans, because it uses the set/get-Methods.
You need a token for calling the methods to perform searches and modifications. For getting a
token the logon method has to be called. If the thread is timed out on the back end or if you
aren't logged in you will get an exception.
- Author:
- Daniel Manzke(dam)
-
Field Summary
Fields inherited from class com.saperion.ws.AbstractService
configured
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
execute
(String token, String taskId, SaWsCommand command, String nextActor, String comment, Date escalationDate) Executes the specified task.getBoxDefinitions
(String token) Returns a list of box definitions of the current session user.getMembers
(String token, MemberOptions options) Returns the members of the current workflow of the session's user.boolean
getOutOfOffice
(String token) Determines if current session's user is out of office.getProcessDefinitions
(String token) Returns a list of process definitions as strings of the current session user.getSubstitute
(String token) Returns the substitute (username) as string.Retrieves and returns the task by the given id.Returns the filtered tasks.void
setOutOfOffice
(String token, boolean outOfOffice) Set the "out of office" state of the current session's user.void
setSubstitute
(String token, String username) Sets the substitute (username) for the session's user.void
Starts a workflow with the specified parameters.Methods inherited from class com.saperion.ws.AbstractService
addToRequest, getConnection, getSession, isConfigured
-
Constructor Details
-
SaWsWorkflowService
public SaWsWorkflowService()Constructor.
-
-
Method Details
-
getTask
public SaWsTask getTask(String token, String taskId) throws SaWsAuthenticationException, SaWsWorkflowException, SaWsRepositoryException, SaWsException Retrieves and returns the task by the given id.- Parameters:
token
- identifies the session.taskId
- identifies the task.- Returns:
- the requested task if existing
- Throws:
SaWsWorkflowException
- if a workflow error occurs.SaWsAuthenticationException
- if an authentication error occurs.SaWsRepositoryException
- if a repository error occurs.SaWsException
-
getTasks
public List<SaWsTask> getTasks(String token, int[] boxIds, String filter) throws SaWsAuthenticationException, SaWsWorkflowException, SaWsRepositoryException, SaWsException Returns the filtered tasks.- Parameters:
token
- identifies the session.boxIds
- the ids of the workflow inboxes to get the tasks from.filter
- to filter the tasks.- Returns:
- the list of task objects.
- Throws:
SaWsWorkflowException
- if a workflow error occurs.SaWsAuthenticationException
- if an authentication error occurs.SaWsRepositoryException
- if a repository error occurs.SaWsException
-
start
public void start(String token, String processName, String nextActor, String comment, String attachmentId) throws SaWsAuthenticationException, SaWsWorkflowException, SaWsRepositoryException, SaWsException Starts a workflow with the specified parameters.- Parameters:
token
- identifies the session.processName
- the name of the workflow to start.nextActor
- the name of the next actor (username).comment
- the starting comment.attachmentId
- the attachmentId (xhdoc of the document the workflow operates on).- Throws:
SaWsWorkflowException
- if a workflow error occurs.SaWsAuthenticationException
- if an authentication error occurs.SaWsRepositoryException
- if a repository error occurs.SaWsException
-
execute
public void execute(String token, String taskId, SaWsCommand command, String nextActor, String comment, Date escalationDate) throws SaWsAuthenticationException, SaWsWorkflowException, SaWsRepositoryException, SaWsException Executes the specified task.- Parameters:
token
- identifies the session.taskId
- identifies the task.command
- the command to execute.nextActor
- the name of the next actor.comment
- comment for this task execution.escalationDate
- the date of escalation.- Throws:
SaWsWorkflowException
- if a workflow error occurs.SaWsAuthenticationException
- if an authentication error occurs.SaWsRepositoryException
- if a repository error occurs.SaWsException
-
getBoxDefinitions
public List<SaWsBoxDefinition> getBoxDefinitions(String token) throws SaWsAuthenticationException, SaWsRepositoryException, SaWsException Returns a list of box definitions of the current session user.- Parameters:
token
- identifies the session.- Returns:
- a list of box definitions of the current session user.
- Throws:
SaWsAuthenticationException
- if an authentication error occurs.SaWsRepositoryException
- if a repository error occurs.SaWsException
-
getMembers
public List<SaWsUser> getMembers(String token, MemberOptions options) throws SaWsAuthenticationException, SaWsRepositoryException, SaWsException Returns the members of the current workflow of the session's user.- Parameters:
token
- identifies the session.options
- the member options of the workflow.- Returns:
- a list of workflow members.
- Throws:
SaWsAuthenticationException
- if an authentication error occurs.SaWsRepositoryException
- if a repository error occurs.SaWsException
-
getProcessDefinitions
public List<String> getProcessDefinitions(String token) throws SaWsAuthenticationException, SaWsWorkflowException, SaWsRepositoryException, SaWsException Returns a list of process definitions as strings of the current session user.- Parameters:
token
- identifies the session.- Returns:
- a list of process definitions as strings of the current session user.
- Throws:
SaWsWorkflowException
- if a workflow error occurs.SaWsAuthenticationException
- if an authentication error occurs.SaWsRepositoryException
- if a repository error occurs.SaWsException
-
getSubstitute
public String getSubstitute(String token) throws SaWsAuthenticationException, SaWsRepositoryException, SaWsException Returns the substitute (username) as string.- Parameters:
token
- identifies the session.- Returns:
- the substitute as string.
- Throws:
SaWsAuthenticationException
- if an authentication error occurs.SaWsRepositoryException
- if a repository error occurs.SaWsException
-
setSubstitute
public void setSubstitute(String token, String username) throws SaWsAuthenticationException, SaWsRepositoryException, SaWsException Sets the substitute (username) for the session's user.- Parameters:
token
- identifies the session.username
- The username of the substitute.- Throws:
SaWsAuthenticationException
- if an authentication error occurs.SaWsRepositoryException
- if a repository error occurs.SaWsException
-
getOutOfOffice
public boolean getOutOfOffice(String token) throws SaWsAuthenticationException, SaWsRepositoryException, SaWsException Determines if current session's user is out of office.- Parameters:
token
- identifies the session.- Returns:
- true if the current session's user is out of office, false otherwise.
- Throws:
SaWsAuthenticationException
- if an authentication error occurs.SaWsRepositoryException
- if a repository error occurs.SaWsException
-
setOutOfOffice
public void setOutOfOffice(String token, boolean outOfOffice) throws SaWsAuthenticationException, SaWsRepositoryException, SaWsException Set the "out of office" state of the current session's user.- Parameters:
token
- identifies the session.outOfOffice
- the "out of office" state- Throws:
SaWsAuthenticationException
- if an authentication error occurs.SaWsRepositoryException
- if a repository error occurs.SaWsException
-