Package com.saperion.ws
Class SaWsWorkflowService
- java.lang.Object
-
- com.saperion.ws.AbstractService
-
- com.saperion.ws.SaWsWorkflowService
-
public class SaWsWorkflowService extends AbstractService
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 Constructor Description SaWsWorkflowService()
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
execute(java.lang.String token, java.lang.String taskId, SaWsCommand command, java.lang.String nextActor, java.lang.String comment, java.util.Date escalationDate)
Executes the specified task.java.util.List<SaWsBoxDefinition>
getBoxDefinitions(java.lang.String token)
Returns a list of box definitions of the current session user.java.util.List<SaWsUser>
getMembers(java.lang.String token, MemberOptions options)
Returns the members of the current workflow of the session's user.boolean
getOutOfOffice(java.lang.String token)
Determines if current session's user is out of office.java.util.List<java.lang.String>
getProcessDefinitions(java.lang.String token)
Returns a list of process definitions as strings of the current session user.java.lang.String
getSubstitute(java.lang.String token)
Returns the substitute (username) as string.SaWsTask
getTask(java.lang.String token, java.lang.String taskId)
Retrieves and returns the task by the given id.java.util.List<SaWsTask>
getTasks(java.lang.String token, int[] boxIds, java.lang.String filter)
Returns the filtered tasks.void
setOutOfOffice(java.lang.String token, boolean outOfOffice)
Set the "out of office" state of the current session's user.void
setSubstitute(java.lang.String token, java.lang.String username)
Sets the substitute (username) for the session's user.void
start(java.lang.String token, java.lang.String processName, java.lang.String nextActor, java.lang.String comment, java.lang.String attachmentId)
Starts a workflow with the specified parameters.-
Methods inherited from class com.saperion.ws.AbstractService
addToRequest, getConnection, getSession, isConfigured
-
-
-
-
Method Detail
-
getTask
public SaWsTask getTask(java.lang.String token, java.lang.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 java.util.List<SaWsTask> getTasks(java.lang.String token, int[] boxIds, java.lang.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(java.lang.String token, java.lang.String processName, java.lang.String nextActor, java.lang.String comment, java.lang.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(java.lang.String token, java.lang.String taskId, SaWsCommand command, java.lang.String nextActor, java.lang.String comment, java.util.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 java.util.List<SaWsBoxDefinition> getBoxDefinitions(java.lang.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 java.util.List<SaWsUser> getMembers(java.lang.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 java.util.List<java.lang.String> getProcessDefinitions(java.lang.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 java.lang.String getSubstitute(java.lang.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(java.lang.String token, java.lang.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(java.lang.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(java.lang.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
-
-