Package com.saperion.connector.wf
Class SaWFTaskImpl
- java.lang.Object
-
- com.saperion.connector.wf.SaWFTaskImpl
-
-
Constructor Summary
Constructors Constructor Description SaWFTaskImpl(SaClassicConnectorImpl connector, TaskInfo taskInfo, java.lang.String user)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addComment(java.lang.String commentString, int level)
Adds a comment to the workflow.void
addHistory(java.lang.String descriptionString)
Adds a history entry.void
executeActivate()
Set inactive process to active.void
executeApprove(ActorInfo nextActor)
Approve step.void
executeAssignToMe()
Get task from absent user, the current user acts as substitute for.void
executeChangeOwner(ActorInfo newOwner)
Change process owner.void
executeCommand(CommandInfo command, java.lang.String processName, ActorInfo nextActor, java.lang.String commentString, java.util.Date escalationDate, int activity)
Performs the given command.void
executeDelegate(ActorInfo delegatee)
Delegate to user.void
executeEscalation(java.util.Date escalationDate)
Escalate step.void
executeForward(int transitionId, ActorInfo nextActor)
Forward step.void
executeForward(int transitionId, ActorInfo nextActor, java.lang.String reason)
Forward step.void
executeHold(java.util.Date holdDate)
Set step to hold.void
executeInactivate()
Set step to inactive.void
executeNotResponsible(java.lang.String commentString)
Not responsible for this step.void
executePutBack()
Put step back to inbox.void
executeReassign()
Reassign task to original user after it has been taken as a substitute.void
executeReject(ActorInfo nextActor)
Reject step.void
executeRemove(java.lang.String removeComment)
Remove step.void
executeRemoveNotice()
Remove notice.void
executeResetHold()
Resets hold.void
executeRework(ActorInfo nextActor)
Rework step.void
executeSetActivity(int activity)
Set next activity.void
executeTake()
Take step from task list.void
executeTerminate()
Terminate process.java.io.InputStream
getAttachmentContent(int element)
Reads the content of the attachment.CommandInfo[]
getCommandInfos()
Reads all possible transitions for this task.CommandInfo[]
getCommandInfos(boolean transitionsOnly)
Reads all possible transitions and optional other possible commands for this task.CommentInfo[]
getComments()
Reads the comments.HistoryInfo[]
getHistory()
Reads the process history.java.lang.String
getHistoryXML()
Reads the process history as XML.java.lang.String
getHistoryXML(java.lang.String language)
Reads the process history as XML.java.lang.String
getHistoryXML2(java.lang.String language)
Reads the second variant of process history as XML.java.lang.String
getHistoryXML2(java.lang.String language, boolean isAscending)
Reads the second variant of process history as XML with ascending / descending switch.boolean
getSync()
Reads the sync status.TaskInfo
getTaskInfo()
Reads the task info object of this task.boolean
getTrusted()
Reads the trusted status.int
getWorkingTime()
SaPropertyValue[]
readAttachmentMetadata()
Reads the metadata of the attachment.TaskUserSelection
readSelectableUsersForTransition(int transition)
Obtains the next tasksTaskUserSelection
for the given transition.void
setAlias(ActorInfo alias)
Sets the actor to be used as alias for the next action.void
setAliasActor(ActorInfo aliasActor)
Sets the alias actor.void
setComment(java.lang.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)
SaSaveInfo
updateAttachment(java.util.Properties namevaluePairs, java.io.InputStream[] content, java.lang.String versionComment, java.lang.String acls)
Updates the attachment in the backend system with the given metadata, acls and content.void
updateTask(java.util.Properties values)
Updates the user defined fields of this task.
-
-
-
Constructor Detail
-
SaWFTaskImpl
public SaWFTaskImpl(SaClassicConnectorImpl connector, TaskInfo taskInfo, java.lang.String user) throws SaAuthenticationException, SaSystemException, SaWorkflowException
Constructor.- Parameters:
connector
- Connector instancetaskInfo
- Task infouser
- User name- Throws:
SaWorkflowException
- Workflow exceptionSaSystemException
- System exceptionSaAuthenticationException
- Authentication exception
-
-
Method Detail
-
executeApprove
public void executeApprove(ActorInfo nextActor) throws SaWorkflowException
Approve step.- Specified by:
executeApprove
in interfaceSaWFTask
- Parameters:
nextActor
- Next actor- Throws:
SaWorkflowException
- Workflow exception- See Also:
SaWFTask.executeApprove(com.saperion.intf.wf.ActorInfo)
-
executeChangeOwner
public void executeChangeOwner(ActorInfo newOwner) throws SaWorkflowException
Change process owner.- Specified by:
executeChangeOwner
in interfaceSaWFTask
- Parameters:
newOwner
- New owner- Throws:
SaWorkflowException
- Workflow exception- See Also:
SaWFTask.executeChangeOwner(com.saperion.intf.wf.ActorInfo)
-
executeCommand
public void executeCommand(CommandInfo command, java.lang.String processName, ActorInfo nextActor, java.lang.String commentString, java.util.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:
SaWFTask.executeCommand(com.saperion.intf.wf.CommandInfo, java.lang.String, com.saperion.intf.wf.ActorInfo, java.lang.String, java.util.Date, int)
-
executeDelegate
public void executeDelegate(ActorInfo delegatee) throws SaWorkflowException
Delegate to user.- Specified by:
executeDelegate
in interfaceSaWFTask
- Parameters:
delegatee
- Delegatee- Throws:
SaWorkflowException
- Workflow exception- See Also:
SaWFTask.executeDelegate(com.saperion.intf.wf.ActorInfo)
-
executeReassign
public void executeReassign() throws SaWorkflowException
Reassign task to original user after it has been taken as a substitute.- Specified by:
executeReassign
in interfaceSaWFTask
- Throws:
SaWorkflowException
- Workflow exception- See Also:
SaWFTask.executeReassign()
-
executeAssignToMe
public void executeAssignToMe() throws SaWorkflowException
Get task from absent user, the current user acts as substitute for.- Specified by:
executeAssignToMe
in interfaceSaWFTask
- Throws:
SaWorkflowException
- Workflow exception- See Also:
SaWFTask.executeDelegate(com.saperion.intf.wf.ActorInfo)
-
executeEscalation
public void executeEscalation(java.util.Date escalationDate) throws SaWorkflowException
Escalate step.- Specified by:
executeEscalation
in interfaceSaWFTask
- Parameters:
escalationDate
- Escalation date- Throws:
SaWorkflowException
- Workflow exception- See Also:
SaWFTask.executeEscalation(java.util.Date)
-
executeForward
public void executeForward(int transitionId, ActorInfo nextActor) throws SaWorkflowException
Forward step.- Specified by:
executeForward
in interfaceSaWFTask
- Parameters:
transitionId
- Transition IDnextActor
- Next actor- Throws:
SaWorkflowException
- Workflow exception- See Also:
SaWFTask.executeForward(int, com.saperion.intf.wf.ActorInfo)
-
executeForward
public void executeForward(int transitionId, ActorInfo nextActor, java.lang.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:
SaWFTask.executeForward(int, com.saperion.intf.wf.ActorInfo, String)
-
executeHold
public void executeHold(java.util.Date holdDate) throws SaWorkflowException
Set step to hold.- Specified by:
executeHold
in interfaceSaWFTask
- Parameters:
holdDate
- Hold date- Throws:
SaWorkflowException
- Workflow exception- See Also:
SaWFTask.executeHold(java.util.Date)
-
executeResetHold
public void executeResetHold() throws SaWorkflowException
Resets hold.- Specified by:
executeResetHold
in interfaceSaWFTask
- Throws:
SaWorkflowException
- Workflow exception- See Also:
SaWFTask.executeResetHold()
-
executeNotResponsible
public void executeNotResponsible(java.lang.String commentString) throws SaWorkflowException
Not responsible for this step.- Specified by:
executeNotResponsible
in interfaceSaWFTask
- Parameters:
commentString
- Comment- Throws:
SaWorkflowException
- Workflow exception- See Also:
SaWFTask.executeNotResponsible(java.lang.String)
-
executePutBack
public void executePutBack() throws SaWorkflowException
Put step back to inbox.- Specified by:
executePutBack
in interfaceSaWFTask
- Throws:
SaWorkflowException
- Workflow exception- See Also:
SaWFTask.executePutBack()
-
executeReject
public void executeReject(ActorInfo nextActor) throws SaWorkflowException
Reject step.- Specified by:
executeReject
in interfaceSaWFTask
- Parameters:
nextActor
- Reject actor- Throws:
SaWorkflowException
- Workflow exception- See Also:
SaWFTask.executeReject(com.saperion.intf.wf.ActorInfo)
-
executeRemove
public void executeRemove(java.lang.String removeComment) throws SaWorkflowException
Remove step.- Specified by:
executeRemove
in interfaceSaWFTask
- Parameters:
removeComment
- Comment- Throws:
SaWorkflowException
- Workflow exception- See Also:
SaWFTask.executeRemove(java.lang.String)
-
executeRemoveNotice
public void executeRemoveNotice() throws SaWorkflowException
Remove notice.- Specified by:
executeRemoveNotice
in interfaceSaWFTask
- Throws:
SaWorkflowException
- Workflow exception- See Also:
SaWFTask.executeRemoveNotice()
-
executeRework
public void executeRework(ActorInfo nextActor) throws SaWorkflowException
Rework step.- Specified by:
executeRework
in interfaceSaWFTask
- Parameters:
nextActor
- Rework actor- Throws:
SaWorkflowException
- Workflow exception- See Also:
SaWFTask.executeRework(com.saperion.intf.wf.ActorInfo)
-
executeActivate
public void executeActivate() throws SaWorkflowException
Set inactive process to active.- Specified by:
executeActivate
in interfaceSaWFTask
- Throws:
SaWorkflowException
- Workflow exception- See Also:
SaWFTask.executeActivate()
-
executeSetActivity
public void executeSetActivity(int activity) throws SaWorkflowException
Set next activity.- Specified by:
executeSetActivity
in interfaceSaWFTask
- Parameters:
activity
- Activity ID- Throws:
SaWorkflowException
- Workflow exception- See Also:
SaWFTask.executeSetActivity(int)
-
executeTake
public void executeTake() throws SaWorkflowException
Take step from task list.- Specified by:
executeTake
in interfaceSaWFTask
- Throws:
SaWorkflowException
- Workflow exception- See Also:
SaWFTask.executeTake()
-
executeTerminate
public void executeTerminate() throws SaWorkflowException
Terminate process.- Specified by:
executeTerminate
in interfaceSaWFTask
- Throws:
SaWorkflowException
- Workflow exception- See Also:
SaWFTask.executeTerminate()
-
executeInactivate
public void executeInactivate() throws SaWorkflowException
Set step to inactive.- Specified by:
executeInactivate
in interfaceSaWFTask
- Throws:
SaWorkflowException
- Workflow exception- See Also:
SaWFTask.executeInactivate()
-
getAttachmentContent
public java.io.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:
SaWFTask.getAttachmentContent(int)
-
getCommandInfos
public CommandInfo[] getCommandInfos() throws SaAuthenticationException, SaSystemException, SaWorkflowException
Reads all possible transitions for this task.- Specified by:
getCommandInfos
in interfaceSaWFTask
- Returns:
- Command list
- Throws:
SaAuthenticationException
- Authentication exceptionSaSystemException
- System exceptionSaWorkflowException
- Workflow exception- See Also:
SaWFTask.getCommandInfos()
-
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:
SaWFTask.getCommandInfos(boolean)
-
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
public CommentInfo[] getComments() throws SaWorkflowException
Reads the comments.- Specified by:
getComments
in interfaceSaWFTask
- Returns:
- Array of comment objects
- Throws:
SaWorkflowException
- Workflow exception- See Also:
SaWFTask.getComments()
-
getHistory
public HistoryInfo[] getHistory() throws SaWorkflowException
Reads the process history.- Specified by:
getHistory
in interfaceSaWFTask
- Returns:
- List of history objects
- Throws:
SaWorkflowException
- Workflow exception- See Also:
SaWFTask.getHistory()
-
getHistoryXML
public java.lang.String getHistoryXML() throws SaWorkflowException
Reads the process history as XML.- Specified by:
getHistoryXML
in interfaceSaWFTask
- Returns:
- XML string of history objects
- Throws:
SaWorkflowException
- Workflow exception- See Also:
SaWFTask.getHistoryXML()
-
getHistoryXML
public java.lang.String getHistoryXML(java.lang.String language) throws SaWorkflowException
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:
SaWFTask.getHistoryXML(java.lang.String)
-
getHistoryXML2
public java.lang.String getHistoryXML2(java.lang.String language) throws SaWorkflowException
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:
SaWFTask.getHistoryXML2(java.lang.String)
-
getHistoryXML2
public java.lang.String getHistoryXML2(java.lang.String language, boolean isAscending) throws SaWorkflowException
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:
SaWFTask.getHistoryXML2(java.lang.String, boolean)
-
getSync
public boolean getSync() throws SaWorkflowException
Reads the sync status.- Specified by:
getSync
in interfaceSaWFTask
- Returns:
- Is Synchron
- Throws:
SaWorkflowException
- Workflow exception- See Also:
SaWFTask.getSync()
-
getTrusted
public boolean getTrusted() throws SaWorkflowException
Reads the trusted status.- Specified by:
getTrusted
in interfaceSaWFTask
- Returns:
- Is trusted
- Throws:
SaWorkflowException
- Workflow exception- See Also:
SaWFTask.getTrusted()
-
getWorkingTime
public int getWorkingTime() throws SaWorkflowException
- Specified by:
getWorkingTime
in interfaceSaWFTask
- Returns:
- the workingTime
- Throws:
SaWorkflowException
- Workflow exception- See Also:
SaWFTask.getWorkingTime()
-
getTaskInfo
public TaskInfo getTaskInfo() throws SaWorkflowException
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:
SaWFTask.getTaskInfo()
-
readAttachmentMetadata
public SaPropertyValue[] readAttachmentMetadata() throws SaSystemException, SaAuthenticationException, SaDDCException, SaWorkflowException
Reads the metadata of the attachment.- Specified by:
readAttachmentMetadata
in interfaceSaWFTask
- Returns:
- Metadata array of attachment
- Throws:
SaSystemException
- SaSystemExceptionSaAuthenticationException
- SaAuthenticationExceptionSaDDCException
- SaDDCExceptionSaWorkflowException
- Workflow exception- See Also:
SaWFTask.readAttachmentMetadata()
-
setAliasActor
public void setAliasActor(ActorInfo aliasActor) throws SaWorkflowException
Sets the alias actor.- Specified by:
setAliasActor
in interfaceSaWFTask
- Parameters:
aliasActor
- Alias actor- Throws:
SaWorkflowException
- Workflow exception- See Also:
SaWFTask.setAliasActor(com.saperion.intf.wf.ActorInfo)
-
setAlias
public void setAlias(ActorInfo alias) throws SaWorkflowException
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:
SaWFTask.setAlias(com.saperion.intf.wf.ActorInfo)
-
addComment
public void addComment(java.lang.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:
SaWFTask.addComment(java.lang.String, int)
-
setComment
public void setComment(java.lang.String commentString)
Set comment to the next execute.- Specified by:
setComment
in interfaceSaWFTask
- Parameters:
commentString
- Comment string- See Also:
SaWFTask.setComment(java.lang.String)
-
addHistory
public void addHistory(java.lang.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:
SaWFTask.addHistory(java.lang.String)
-
setSync
public void setSync(boolean isSync) throws SaWorkflowException
Set sync parameter. Default is "true".- Specified by:
setSync
in interfaceSaWFTask
- Parameters:
isSync
- Synchron work- Throws:
SaWorkflowException
- Workflow exception- See Also:
SaWFTask.setSync(boolean)
-
setTrusted
public void setTrusted(boolean isTrusted) throws SaWorkflowException
Set trusted parameter. Default is "false".- Specified by:
setTrusted
in interfaceSaWFTask
- Parameters:
isTrusted
- Trusted work- Throws:
SaWorkflowException
- Workflow exception- See Also:
SaWFTask.setTrusted(boolean)
-
setWorkingTime
public void setWorkingTime(int time) throws SaWorkflowException
- Specified by:
setWorkingTime
in interfaceSaWFTask
- Parameters:
time
- the workingTime to set- Throws:
SaWorkflowException
- Workflow exception- See Also:
SaWFTask.setWorkingTime(int)
-
updateAttachment
public SaSaveInfo updateAttachment(java.util.Properties namevaluePairs, java.io.InputStream[] content, java.lang.String versionComment, java.lang.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:
SaWFTask.updateAttachment(java.util.Properties, java.io.InputStream[], java.lang.String, java.lang.String)
-
updateTask
public void updateTask(java.util.Properties values) throws SaWorkflowException
Updates the user defined fields of this task.- Specified by:
updateTask
in interfaceSaWFTask
- Parameters:
values
- Fieldvalues- Throws:
SaWorkflowException
- Workflow exception- See Also:
SaWFTask.updateTask(java.util.Properties)
-
-