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 voidaddComment(java.lang.String commentString, int level)Adds a comment to the workflow.voidaddHistory(java.lang.String descriptionString)Adds a history entry.voidexecuteActivate()Set inactive process to active.voidexecuteApprove(ActorInfo nextActor)Approve step.voidexecuteAssignToMe()Get task from absent user, the current user acts as substitute for.voidexecuteChangeOwner(ActorInfo newOwner)Change process owner.voidexecuteCommand(CommandInfo command, java.lang.String processName, ActorInfo nextActor, java.lang.String commentString, java.util.Date escalationDate, int activity)Performs the given command.voidexecuteDelegate(ActorInfo delegatee)Delegate to user.voidexecuteEscalation(java.util.Date escalationDate)Escalate step.voidexecuteForward(int transitionId, ActorInfo nextActor)Forward step.voidexecuteForward(int transitionId, ActorInfo nextActor, java.lang.String reason)Forward step.voidexecuteHold(java.util.Date holdDate)Set step to hold.voidexecuteInactivate()Set step to inactive.voidexecuteNotResponsible(java.lang.String commentString)Not responsible for this step.voidexecutePutBack()Put step back to inbox.voidexecuteReassign()Reassign task to original user after it has been taken as a substitute.voidexecuteReject(ActorInfo nextActor)Reject step.voidexecuteRemove(java.lang.String removeComment)Remove step.voidexecuteRemoveNotice()Remove notice.voidexecuteResetHold()Resets hold.voidexecuteRework(ActorInfo nextActor)Rework step.voidexecuteSetActivity(int activity)Set next activity.voidexecuteTake()Take step from task list.voidexecuteTerminate()Terminate process.java.io.InputStreamgetAttachmentContent(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.StringgetHistoryXML()Reads the process history as XML.java.lang.StringgetHistoryXML(java.lang.String language)Reads the process history as XML.java.lang.StringgetHistoryXML2(java.lang.String language)Reads the second variant of process history as XML.java.lang.StringgetHistoryXML2(java.lang.String language, boolean isAscending)Reads the second variant of process history as XML with ascending / descending switch.booleangetSync()Reads the sync status.TaskInfogetTaskInfo()Reads the task info object of this task.booleangetTrusted()Reads the trusted status.intgetWorkingTime()SaPropertyValue[]readAttachmentMetadata()Reads the metadata of the attachment.TaskUserSelectionreadSelectableUsersForTransition(int transition)Obtains the next tasksTaskUserSelectionfor the given transition.voidsetAlias(ActorInfo alias)Sets the actor to be used as alias for the next action.voidsetAliasActor(ActorInfo aliasActor)Sets the alias actor.voidsetComment(java.lang.String commentString)Set comment to the next execute.voidsetSync(boolean isSync)Set sync parameter.voidsetTrusted(boolean isTrusted)Set trusted parameter.voidsetWorkingTime(int time)SaSaveInfoupdateAttachment(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.voidupdateTask(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:
executeApprovein 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:
executeChangeOwnerin 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:
executeCommandin 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:
executeDelegatein interfaceSaWFTask- Parameters:
delegatee- Delegatee- Throws:
SaWorkflowException- Workflow exception- See Also:
SaWFTask.executeDelegate(com.saperion.intf.wf.ActorInfo)
-
executeReassign
public void executeReassign() throws SaWorkflowExceptionReassign task to original user after it has been taken as a substitute.- Specified by:
executeReassignin interfaceSaWFTask- Throws:
SaWorkflowException- Workflow exception- See Also:
SaWFTask.executeReassign()
-
executeAssignToMe
public void executeAssignToMe() throws SaWorkflowExceptionGet task from absent user, the current user acts as substitute for.- Specified by:
executeAssignToMein interfaceSaWFTask- Throws:
SaWorkflowException- Workflow exception- See Also:
SaWFTask.executeDelegate(com.saperion.intf.wf.ActorInfo)
-
executeEscalation
public void executeEscalation(java.util.Date escalationDate) throws SaWorkflowExceptionEscalate step.- Specified by:
executeEscalationin 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 SaWorkflowExceptionForward step.- Specified by:
executeForwardin 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 SaWorkflowExceptionForward step.- Specified by:
executeForwardin 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 SaWorkflowExceptionSet step to hold.- Specified by:
executeHoldin interfaceSaWFTask- Parameters:
holdDate- Hold date- Throws:
SaWorkflowException- Workflow exception- See Also:
SaWFTask.executeHold(java.util.Date)
-
executeResetHold
public void executeResetHold() throws SaWorkflowExceptionResets hold.- Specified by:
executeResetHoldin interfaceSaWFTask- Throws:
SaWorkflowException- Workflow exception- See Also:
SaWFTask.executeResetHold()
-
executeNotResponsible
public void executeNotResponsible(java.lang.String commentString) throws SaWorkflowExceptionNot responsible for this step.- Specified by:
executeNotResponsiblein interfaceSaWFTask- Parameters:
commentString- Comment- Throws:
SaWorkflowException- Workflow exception- See Also:
SaWFTask.executeNotResponsible(java.lang.String)
-
executePutBack
public void executePutBack() throws SaWorkflowExceptionPut step back to inbox.- Specified by:
executePutBackin interfaceSaWFTask- Throws:
SaWorkflowException- Workflow exception- See Also:
SaWFTask.executePutBack()
-
executeReject
public void executeReject(ActorInfo nextActor) throws SaWorkflowException
Reject step.- Specified by:
executeRejectin 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 SaWorkflowExceptionRemove step.- Specified by:
executeRemovein interfaceSaWFTask- Parameters:
removeComment- Comment- Throws:
SaWorkflowException- Workflow exception- See Also:
SaWFTask.executeRemove(java.lang.String)
-
executeRemoveNotice
public void executeRemoveNotice() throws SaWorkflowExceptionRemove notice.- Specified by:
executeRemoveNoticein interfaceSaWFTask- Throws:
SaWorkflowException- Workflow exception- See Also:
SaWFTask.executeRemoveNotice()
-
executeRework
public void executeRework(ActorInfo nextActor) throws SaWorkflowException
Rework step.- Specified by:
executeReworkin interfaceSaWFTask- Parameters:
nextActor- Rework actor- Throws:
SaWorkflowException- Workflow exception- See Also:
SaWFTask.executeRework(com.saperion.intf.wf.ActorInfo)
-
executeActivate
public void executeActivate() throws SaWorkflowExceptionSet inactive process to active.- Specified by:
executeActivatein interfaceSaWFTask- Throws:
SaWorkflowException- Workflow exception- See Also:
SaWFTask.executeActivate()
-
executeSetActivity
public void executeSetActivity(int activity) throws SaWorkflowExceptionSet next activity.- Specified by:
executeSetActivityin interfaceSaWFTask- Parameters:
activity- Activity ID- Throws:
SaWorkflowException- Workflow exception- See Also:
SaWFTask.executeSetActivity(int)
-
executeTake
public void executeTake() throws SaWorkflowExceptionTake step from task list.- Specified by:
executeTakein interfaceSaWFTask- Throws:
SaWorkflowException- Workflow exception- See Also:
SaWFTask.executeTake()
-
executeTerminate
public void executeTerminate() throws SaWorkflowExceptionTerminate process.- Specified by:
executeTerminatein interfaceSaWFTask- Throws:
SaWorkflowException- Workflow exception- See Also:
SaWFTask.executeTerminate()
-
executeInactivate
public void executeInactivate() throws SaWorkflowExceptionSet step to inactive.- Specified by:
executeInactivatein interfaceSaWFTask- Throws:
SaWorkflowException- Workflow exception- See Also:
SaWFTask.executeInactivate()
-
getAttachmentContent
public java.io.InputStream getAttachmentContent(int element) throws SaSystemException, SaAuthenticationException, SaWorkflowExceptionReads the content of the attachment.- Specified by:
getAttachmentContentin 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:
getCommandInfosin 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:
getCommandInfosin 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 tasksTaskUserSelectionfor the given transition.- Specified by:
readSelectableUsersForTransitionin interfaceSaWFTask- Parameters:
transition- The id of the transition one wants to obtain the user selection from.- Returns:
- The next tasks
TaskUserSelectionfor 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:
getCommentsin 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:
getHistoryin interfaceSaWFTask- Returns:
- List of history objects
- Throws:
SaWorkflowException- Workflow exception- See Also:
SaWFTask.getHistory()
-
getHistoryXML
public java.lang.String getHistoryXML() throws SaWorkflowExceptionReads the process history as XML.- Specified by:
getHistoryXMLin 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 SaWorkflowExceptionReads the process history as XML.- Specified by:
getHistoryXMLin 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 SaWorkflowExceptionReads the second variant of process history as XML.- Specified by:
getHistoryXML2in 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 SaWorkflowExceptionReads the second variant of process history as XML with ascending / descending switch.- Specified by:
getHistoryXML2in 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 SaWorkflowExceptionReads the sync status.- Specified by:
getSyncin interfaceSaWFTask- Returns:
- Is Synchron
- Throws:
SaWorkflowException- Workflow exception- See Also:
SaWFTask.getSync()
-
getTrusted
public boolean getTrusted() throws SaWorkflowExceptionReads the trusted status.- Specified by:
getTrustedin interfaceSaWFTask- Returns:
- Is trusted
- Throws:
SaWorkflowException- Workflow exception- See Also:
SaWFTask.getTrusted()
-
getWorkingTime
public int getWorkingTime() throws SaWorkflowException- Specified by:
getWorkingTimein 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:
getTaskInfoin 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:
readAttachmentMetadatain 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:
setAliasActorin 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:
setAliasin 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, SaWorkflowExceptionAdds a comment to the workflow.- Specified by:
addCommentin 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:
setCommentin interfaceSaWFTask- Parameters:
commentString- Comment string- See Also:
SaWFTask.setComment(java.lang.String)
-
addHistory
public void addHistory(java.lang.String descriptionString) throws SaAuthenticationException, SaSystemException, SaWorkflowExceptionAdds a history entry.- Specified by:
addHistoryin interfaceSaWFTask- Parameters:
descriptionString- Comment- Throws:
SaAuthenticationException- SaAuthenticationExceptionSaSystemException- SaSystemExceptionSaWorkflowException- Workflow exception- See Also:
SaWFTask.addHistory(java.lang.String)
-
setSync
public void setSync(boolean isSync) throws SaWorkflowExceptionSet sync parameter. Default is "true".- Specified by:
setSyncin interfaceSaWFTask- Parameters:
isSync- Synchron work- Throws:
SaWorkflowException- Workflow exception- See Also:
SaWFTask.setSync(boolean)
-
setTrusted
public void setTrusted(boolean isTrusted) throws SaWorkflowExceptionSet trusted parameter. Default is "false".- Specified by:
setTrustedin interfaceSaWFTask- Parameters:
isTrusted- Trusted work- Throws:
SaWorkflowException- Workflow exception- See Also:
SaWFTask.setTrusted(boolean)
-
setWorkingTime
public void setWorkingTime(int time) throws SaWorkflowException- Specified by:
setWorkingTimein 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:
updateAttachmentin 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 SaWorkflowExceptionUpdates the user defined fields of this task.- Specified by:
updateTaskin interfaceSaWFTask- Parameters:
values- Fieldvalues- Throws:
SaWorkflowException- Workflow exception- See Also:
SaWFTask.updateTask(java.util.Properties)
-
-