Package com.saperion.connector.wf
Class SaWFTaskImpl
java.lang.Object
com.saperion.connector.wf.SaWFTaskImpl
- All Implemented Interfaces:
SaWFTask
Implementation of the @link
Implements the handling of all step related tasks for a
SaWFTask
interface.
Implements the handling of all step related tasks for a
TaskInfo
- Author:
- rbo
-
Constructor Summary
ConstructorsConstructorDescriptionSaWFTaskImpl
(SaClassicConnectorImpl connector, TaskInfo taskInfo, String user) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addComment
(String commentString, int level) Adds a comment to the workflow.void
addHistory
(String descriptionString) Adds a history entry.void
Set inactive process to active.void
executeApprove
(ActorInfo nextActor) Approve step.void
Get task from absent user, the current user acts as substitute for.void
executeChangeOwner
(ActorInfo newOwner) Change process owner.void
executeCommand
(CommandInfo command, String processName, ActorInfo nextActor, String commentString, Date escalationDate, int activity) Performs the given command.void
executeDelegate
(ActorInfo delegatee) Delegate to user.void
executeEscalation
(Date escalationDate) Escalate step.void
executeForward
(int transitionId, ActorInfo nextActor) Forward step.void
executeForward
(int transitionId, ActorInfo nextActor, String reason) Forward step.void
executeHold
(Date holdDate) Set step to hold.void
Set step to inactive.void
executeNotResponsible
(String commentString) Not responsible for this step.void
Put step back to inbox.void
Reassign task to original user after it has been taken as a substitute.void
executeReject
(ActorInfo nextActor) Reject step.void
executeRemove
(String removeComment) Remove step.void
Remove notice.void
Resets hold.void
executeRework
(ActorInfo nextActor) Rework step.void
executeSetActivity
(int activity) Set next activity.void
Take step from task list.void
Terminate process.getAttachmentContent
(int element) Reads the content of the attachment.Reads all possible transitions for this task.getCommandInfos
(boolean transitionsOnly) Reads all possible transitions and optional other possible commands for this task.Reads the comments.Reads the process history.Reads the process history as XML.getHistoryXML
(String language) Reads the process history as XML.getHistoryXML2
(String language) Reads the second variant of process history as XML.getHistoryXML2
(String language, boolean isAscending) Reads the second variant of process history as XML with ascending / descending switch.boolean
getSync()
Reads the sync status.Reads the task info object of this task.boolean
Reads the trusted status.int
Reads the metadata of the attachment.readSelectableUsersForTransition
(int transition) Obtains the next tasksTaskUserSelection
for the given transition.void
Sets the actor to be used as alias for the next action.void
setAliasActor
(ActorInfo aliasActor) Sets the alias actor.void
setComment
(String commentString) Set comment to the next execute.void
setSync
(boolean isSync) Set sync parameter.void
setTrusted
(boolean isTrusted) Set trusted parameter.void
setWorkingTime
(int time) updateAttachment
(Properties namevaluePairs, InputStream[] content, String versionComment, String acls) Updates the attachment in the backend system with the given metadata, acls and content.void
updateTask
(Properties values) Updates the user defined fields of this task.
-
Constructor Details
-
SaWFTaskImpl
public SaWFTaskImpl(SaClassicConnectorImpl connector, TaskInfo taskInfo, String user) throws SaAuthenticationException, SaSystemException, SaWorkflowException Constructor.- Parameters:
connector
- Connector instancetaskInfo
- Task infouser
- User name- Throws:
SaWorkflowException
- Workflow exceptionSaSystemException
- System exceptionSaAuthenticationException
- Authentication exception
-
-
Method Details
-
executeApprove
Approve step.- Specified by:
executeApprove
in interfaceSaWFTask
- Parameters:
nextActor
- Next actor- Throws:
SaWorkflowException
- Workflow exception- See Also:
-
executeChangeOwner
Change process owner.- Specified by:
executeChangeOwner
in interfaceSaWFTask
- Parameters:
newOwner
- New owner- Throws:
SaWorkflowException
- Workflow exception- See Also:
-
executeCommand
public void executeCommand(CommandInfo command, String processName, ActorInfo nextActor, String commentString, Date escalationDate, int activity) throws SaWorkflowException Performs the given command. The parameters must fit to the given parameter. Unneeded parameters can be set to null.- Specified by:
executeCommand
in interfaceSaWFTask
- Parameters:
command
- Required. Command object.processName
- Optional. Process definition name.nextActor
- Optional. Next actor / delegateecommentString
- Optional. CommentescalationDate
- Optional. Escalation dateactivity
- Optional. Activity- Throws:
SaWorkflowException
- Workflow exception- See Also:
-
executeDelegate
Delegate to user.- Specified by:
executeDelegate
in interfaceSaWFTask
- Parameters:
delegatee
- Delegatee- Throws:
SaWorkflowException
- Workflow exception- See Also:
-
executeReassign
Reassign task to original user after it has been taken as a substitute.- Specified by:
executeReassign
in interfaceSaWFTask
- Throws:
SaWorkflowException
- Workflow exception- See Also:
-
executeAssignToMe
Get task from absent user, the current user acts as substitute for.- Specified by:
executeAssignToMe
in interfaceSaWFTask
- Throws:
SaWorkflowException
- Workflow exception- See Also:
-
executeEscalation
Escalate step.- Specified by:
executeEscalation
in interfaceSaWFTask
- Parameters:
escalationDate
- Escalation date- Throws:
SaWorkflowException
- Workflow exception- See Also:
-
executeForward
Forward step.- Specified by:
executeForward
in interfaceSaWFTask
- Parameters:
transitionId
- Transition IDnextActor
- Next actor- Throws:
SaWorkflowException
- Workflow exception- See Also:
-
executeForward
public void executeForward(int transitionId, ActorInfo nextActor, String reason) throws SaWorkflowException Forward step.- Specified by:
executeForward
in interfaceSaWFTask
- Parameters:
transitionId
- Transition IDnextActor
- Next actorreason
- reason for forward- Throws:
SaWorkflowException
- Workflow exception- See Also:
-
executeHold
Set step to hold.- Specified by:
executeHold
in interfaceSaWFTask
- Parameters:
holdDate
- Hold date- Throws:
SaWorkflowException
- Workflow exception- See Also:
-
executeResetHold
Resets hold.- Specified by:
executeResetHold
in interfaceSaWFTask
- Throws:
SaWorkflowException
- Workflow exception- See Also:
-
executeNotResponsible
Not responsible for this step.- Specified by:
executeNotResponsible
in interfaceSaWFTask
- Parameters:
commentString
- Comment- Throws:
SaWorkflowException
- Workflow exception- See Also:
-
executePutBack
Put step back to inbox.- Specified by:
executePutBack
in interfaceSaWFTask
- Throws:
SaWorkflowException
- Workflow exception- See Also:
-
executeReject
Reject step.- Specified by:
executeReject
in interfaceSaWFTask
- Parameters:
nextActor
- Reject actor- Throws:
SaWorkflowException
- Workflow exception- See Also:
-
executeRemove
Remove step.- Specified by:
executeRemove
in interfaceSaWFTask
- Parameters:
removeComment
- Comment- Throws:
SaWorkflowException
- Workflow exception- See Also:
-
executeRemoveNotice
Remove notice.- Specified by:
executeRemoveNotice
in interfaceSaWFTask
- Throws:
SaWorkflowException
- Workflow exception- See Also:
-
executeRework
Rework step.- Specified by:
executeRework
in interfaceSaWFTask
- Parameters:
nextActor
- Rework actor- Throws:
SaWorkflowException
- Workflow exception- See Also:
-
executeActivate
Set inactive process to active.- Specified by:
executeActivate
in interfaceSaWFTask
- Throws:
SaWorkflowException
- Workflow exception- See Also:
-
executeSetActivity
Set next activity.- Specified by:
executeSetActivity
in interfaceSaWFTask
- Parameters:
activity
- Activity ID- Throws:
SaWorkflowException
- Workflow exception- See Also:
-
executeTake
Take step from task list.- Specified by:
executeTake
in interfaceSaWFTask
- Throws:
SaWorkflowException
- Workflow exception- See Also:
-
executeTerminate
Terminate process.- Specified by:
executeTerminate
in interfaceSaWFTask
- Throws:
SaWorkflowException
- Workflow exception- See Also:
-
executeInactivate
Set step to inactive.- Specified by:
executeInactivate
in interfaceSaWFTask
- Throws:
SaWorkflowException
- Workflow exception- See Also:
-
getAttachmentContent
public InputStream getAttachmentContent(int element) throws SaSystemException, SaAuthenticationException, SaWorkflowException Reads the content of the attachment.- Specified by:
getAttachmentContent
in interfaceSaWFTask
- Parameters:
element
- position in the document structure; 0 if the document is unstructured.- Returns:
- Content stream of base document
- Throws:
SaSystemException
- SaSystemExceptionSaAuthenticationException
- SaAuthenticationExceptionSaWorkflowException
- Workflow exception- See Also:
-
getCommandInfos
public CommandInfo[] getCommandInfos() throws SaAuthenticationException, SaSystemException, SaWorkflowExceptionReads all possible transitions for this task.- Specified by:
getCommandInfos
in interfaceSaWFTask
- Returns:
- Command list
- Throws:
SaAuthenticationException
- Authentication exceptionSaSystemException
- System exceptionSaWorkflowException
- Workflow exception- See Also:
-
getCommandInfos
public CommandInfo[] getCommandInfos(boolean transitionsOnly) throws SaAuthenticationException, SaSystemException, SaWorkflowException Reads all possible transitions and optional other possible commands for this task.- Specified by:
getCommandInfos
in interfaceSaWFTask
- Parameters:
transitionsOnly
- if true, only transition commands will be returned- Returns:
- Command list
- Throws:
SaAuthenticationException
- Authentication exceptionSaSystemException
- System exceptionSaWorkflowException
- Workflow exception- See Also:
-
readSelectableUsersForTransition
public TaskUserSelection readSelectableUsersForTransition(int transition) throws SaAuthenticationException, SaSystemException, SaWorkflowException Obtains the next tasksTaskUserSelection
for the given transition.- Specified by:
readSelectableUsersForTransition
in interfaceSaWFTask
- Parameters:
transition
- The id of the transition one wants to obtain the user selection from.- Returns:
- The next tasks
TaskUserSelection
for the given transition. - Throws:
SaAuthenticationException
- if the session is not valid anymoreSaSystemException
- if an error occurred on the serverSaWorkflowException
- if a workflow specific error occurred
-
getComments
Reads the comments.- Specified by:
getComments
in interfaceSaWFTask
- Returns:
- Array of comment objects
- Throws:
SaWorkflowException
- Workflow exception- See Also:
-
getHistory
Reads the process history.- Specified by:
getHistory
in interfaceSaWFTask
- Returns:
- List of history objects
- Throws:
SaWorkflowException
- Workflow exception- See Also:
-
getHistoryXML
Reads the process history as XML.- Specified by:
getHistoryXML
in interfaceSaWFTask
- Returns:
- XML string of history objects
- Throws:
SaWorkflowException
- Workflow exception- See Also:
-
getHistoryXML
Reads the process history as XML.- Specified by:
getHistoryXML
in interfaceSaWFTask
- Parameters:
language
- Language- Returns:
- XML string of history objects
- Throws:
SaWorkflowException
- Workflow exception- See Also:
-
getHistoryXML2
Reads the second variant of process history as XML.- Specified by:
getHistoryXML2
in interfaceSaWFTask
- Parameters:
language
- Language- Returns:
- XML string of history objects
- Throws:
SaWorkflowException
- Workflow exception- See Also:
-
getHistoryXML2
Reads the second variant of process history as XML with ascending / descending switch.- Specified by:
getHistoryXML2
in interfaceSaWFTask
- Parameters:
language
- LanguageisAscending
- Is ascending- Returns:
- XML string of history objects
- Throws:
SaWorkflowException
- Workflow exception- See Also:
-
getSync
Reads the sync status.- Specified by:
getSync
in interfaceSaWFTask
- Returns:
- Is Synchron
- Throws:
SaWorkflowException
- Workflow exception- See Also:
-
getTrusted
Reads the trusted status.- Specified by:
getTrusted
in interfaceSaWFTask
- Returns:
- Is trusted
- Throws:
SaWorkflowException
- Workflow exception- See Also:
-
getWorkingTime
- Specified by:
getWorkingTime
in interfaceSaWFTask
- Returns:
- the workingTime
- Throws:
SaWorkflowException
- Workflow exception- See Also:
-
getTaskInfo
Reads the task info object of this task.- Specified by:
getTaskInfo
in interfaceSaWFTask
- Returns:
- TaskInfo object for this task
- Throws:
SaWorkflowException
- Workflow exception- See Also:
-
readAttachmentMetadata
public SaPropertyValue[] readAttachmentMetadata() throws SaSystemException, SaAuthenticationException, SaDDCException, SaWorkflowExceptionReads the metadata of the attachment.- Specified by:
readAttachmentMetadata
in interfaceSaWFTask
- Returns:
- Metadata array of attachment
- Throws:
SaSystemException
- SaSystemExceptionSaAuthenticationException
- SaAuthenticationExceptionSaDDCException
- SaDDCExceptionSaWorkflowException
- Workflow exception- See Also:
-
setAliasActor
Sets the alias actor.- Specified by:
setAliasActor
in interfaceSaWFTask
- Parameters:
aliasActor
- Alias actor- Throws:
SaWorkflowException
- Workflow exception- See Also:
-
setAlias
Sets the actor to be used as alias for the next action.- Specified by:
setAlias
in interfaceSaWFTask
- Parameters:
alias
- alias actor- Throws:
SaWorkflowException
- workflow exception- See Also:
-
addComment
public void addComment(String commentString, int level) throws SaAuthenticationException, SaSystemException, SaWorkflowException Adds a comment to the workflow.- Specified by:
addComment
in interfaceSaWFTask
- Parameters:
commentString
- Commentlevel
- Level- Throws:
SaAuthenticationException
- SaAuthenticationExceptionSaSystemException
- SaSystemExceptionSaWorkflowException
- Workflow exception- See Also:
-
setComment
Set comment to the next execute.- Specified by:
setComment
in interfaceSaWFTask
- Parameters:
commentString
- Comment string- See Also:
-
addHistory
public void addHistory(String descriptionString) throws SaAuthenticationException, SaSystemException, SaWorkflowException Adds a history entry.- Specified by:
addHistory
in interfaceSaWFTask
- Parameters:
descriptionString
- Comment- Throws:
SaAuthenticationException
- SaAuthenticationExceptionSaSystemException
- SaSystemExceptionSaWorkflowException
- Workflow exception- See Also:
-
setSync
Set sync parameter. Default is "true".- Specified by:
setSync
in interfaceSaWFTask
- Parameters:
isSync
- Synchron work- Throws:
SaWorkflowException
- Workflow exception- See Also:
-
setTrusted
Set trusted parameter. Default is "false".- Specified by:
setTrusted
in interfaceSaWFTask
- Parameters:
isTrusted
- Trusted work- Throws:
SaWorkflowException
- Workflow exception- See Also:
-
setWorkingTime
- Specified by:
setWorkingTime
in interfaceSaWFTask
- Parameters:
time
- the workingTime to set- Throws:
SaWorkflowException
- Workflow exception- See Also:
-
updateAttachment
public SaSaveInfo updateAttachment(Properties namevaluePairs, InputStream[] content, String versionComment, String acls) throws SaSystemException, SaAuthenticationException, SaDDCException, SaWorkflowException Updates the attachment in the backend system with the given metadata, acls and content. Only the attached metadata and elements are changed. If the document was checked out, it will be automatically checked in.- Specified by:
updateAttachment
in interfaceSaWFTask
- Parameters:
namevaluePairs
- A properties object containing the metadatacontent
- Multiple content dataversionComment
- The comment for the versionacls
- ACL name string- Returns:
- SaSaveInfo SaSaveInfo object describing the document
- Throws:
SaSystemException
- SaSystemExceptionSaAuthenticationException
- SaAuthenticationExceptionSaDDCException
- SaDDCExceptionSaWorkflowException
- Workflow exception- See Also:
-
updateTask
Updates the user defined fields of this task.- Specified by:
updateTask
in interfaceSaWFTask
- Parameters:
values
- Fieldvalues- Throws:
SaWorkflowException
- Workflow exception- See Also:
-