Package com.saperion.connector.wf
Class SaWFConnectorImpl
- java.lang.Object
-
- com.saperion.connector.wf.SaWFConnectorImpl
-
- All Implemented Interfaces:
SaWFConnector
public class SaWFConnectorImpl extends java.lang.Object implements SaWFConnector
Workflow connector implementation.- Author:
- rbo
-
-
Constructor Summary
Constructors Constructor Description SaWFConnectorImpl()
Constructs theSaWFConnectorImpl
instance which provides workflow functionalities.SaWFConnectorImpl(SaClassicConnector conn)
Constructor with given connector.SaWFConnectorImpl(java.lang.String configPath)
Constructs theSaWFConnectorImpl
instance which provides workflow functionalities.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TaskInfo
executeStartProcess(java.lang.String definition, ActorInfo nextActor, java.lang.String comment, java.lang.String attachmentUID)
Start new process.java.lang.Long
getBoxCount(int boxId)
Reads the count (number of workflow item) of the inbox identified by the given id.java.util.List<BoxDefinition>
getBoxDefinitions()
Reads the box definitions.SaClassicConnector
getClassicConnector()
Gets the classic connector behind this connector.java.util.List<HistoryInfo[]>
getDocHistories(java.lang.String documentHdoc)
Gets the document's process histories.java.util.List<java.lang.String>
getDocHistoriesXML(java.lang.String documentHdoc)
Gets the document's process histories as XML.java.util.List<java.lang.String>
getDocHistoriesXML(java.lang.String documentHdoc, java.lang.String language)
Gets the document's process histories as XML.java.util.List<java.lang.String>
getDocHistoriesXML2(java.lang.String documentHdoc, java.lang.String language)
Gets the the second variant of document's process histories as XML.java.util.List<java.lang.String>
getDocHistoriesXML2(java.lang.String documentHdoc, java.lang.String language, boolean isAscending)
Gets the the second variant of document's process histories as XML with ascending/descending switch.java.util.List<TaskInfo>
getGroupbox(int[] ids, java.lang.String filter)
Read the content of the group box.java.util.List<TaskInfo>
getInbox(java.lang.String filter)
Read the content of the inbox.WorkflowMember
getMember(WorkflowMember member, int depth, java.lang.String filter)
Reads direct workflow member tree.WorkflowMember
getMembers()
Reads the workflow member tree.java.util.List<TaskInfo>
getOrgUnitbox(int[] ids, java.lang.String filter)
Read the content of the organisation unit box.boolean
getOutOfOffice()
Get the out of office status for the logged on user.SaWFTask
getParentTask(java.lang.String taskId)
Get parent task direct by ID.java.util.List<java.lang.String>
getProcessDefinitions()
Reads all available process definitions.java.util.List<ProcessDefinitionDescriptor>
getProcessDefinitions(java.lang.String ddcName)
Returns the process definitions that are allowed to be used for documents contained in the specified DDC.java.lang.String
getSubstitute()
Get the substitute for the logged on user.java.util.List<TaskInfo>
getSubstitutebox(int[] ids, java.lang.String filter)
Read the content of the substitute box.SaWFTask
getTask(TaskInfo taskInfo)
Creates a task object from the given task information.SaWFTask
getTask(java.lang.String taskId)
Get task direct by ID.java.util.List<TaskAuditInfo>
getTaskAuditList(int[] boxIds, java.lang.String filter)
Reads the task audit for this user.java.util.List<TaskAuditInfo>
getTaskAuditList(int[] boxIds, java.lang.String filter, java.util.Map<java.lang.String,java.lang.Object> parameter)
Reads the task audit for this user.java.util.List<TaskInfo>
getTaskList(int[] boxIds, java.lang.String filter)
Reads the task for this user.java.util.List<TaskInfo>
getTaskList(int[] boxIds, java.lang.String filter, java.util.Map<java.lang.String,java.lang.Object> parameter)
Reads the task for this user.int
getUserId()
User ID for the actual user.java.lang.String
getWorkflowDdcName()
Gets the workflow ddc namejava.lang.String
getXMLTaskList(java.util.List<TaskInfo> taskList)
Converts a task list to xml.boolean
logoff()
Logoff from the backend system.int
logon(java.lang.String username, java.lang.String password, int type, java.lang.String client)
performs logon to the backend system.void
setOutOfOffice(boolean isOutOfOffice)
set the out of office status for the logged on user.void
setSubstitute(java.lang.String name)
Set the substitute for the logged on user.
-
-
-
Constructor Detail
-
SaWFConnectorImpl
public SaWFConnectorImpl() throws SaAuthenticationException, SaSystemException
Constructs theSaWFConnectorImpl
instance which provides workflow functionalities.- Throws:
SaSystemException
- System exceptionSaAuthenticationException
- Authentication exception
-
SaWFConnectorImpl
public SaWFConnectorImpl(java.lang.String configPath) throws SaAuthenticationException, SaSystemException
Constructs theSaWFConnectorImpl
instance which provides workflow functionalities.- Parameters:
configPath
- Configuration path- Throws:
SaSystemException
- System exceptionSaAuthenticationException
- Authentication exception
-
SaWFConnectorImpl
public SaWFConnectorImpl(SaClassicConnector conn) throws SaAuthenticationException, SaSystemException
Constructor with given connector.- Parameters:
conn
- Classic connector- Throws:
SaSystemException
- System exceptionSaAuthenticationException
- Authentication exception
-
-
Method Detail
-
getBoxDefinitions
public java.util.List<BoxDefinition> getBoxDefinitions() throws SaAuthenticationException, SaSystemException
Reads the box definitions.- Specified by:
getBoxDefinitions
in interfaceSaWFConnector
- Returns:
- Box definitions
- Throws:
SaAuthenticationException
- SaAuthenticationExceptionSaSystemException
- SaSystemException- See Also:
SaWFConnector.getBoxDefinitions()
-
getBoxCount
public java.lang.Long getBoxCount(int boxId) throws SaAuthenticationException, SaSystemException
Reads the count (number of workflow item) of the inbox identified by the given id. For more options (unread-count...) use invoke method of ClassicConnector withGetBoxCount
operation.- Specified by:
getBoxCount
in interfaceSaWFConnector
- Parameters:
boxId
- the workflow box id- Returns:
- the count of the inbox as Long.
- Throws:
SaAuthenticationException
- if an error occurs.SaSystemException
- if an error occurs.- See Also:
SaWFConnector.getBoxDefinitions()
-
getGroupbox
public java.util.List<TaskInfo> getGroupbox(int[] ids, java.lang.String filter) throws SaAuthenticationException, SaSystemException
Read the content of the group box.- Specified by:
getGroupbox
in interfaceSaWFConnector
- Parameters:
ids
- Filter ID'sfilter
- HQL filter- Returns:
- List of TaskInfo objects
- Throws:
SaAuthenticationException
- SaAuthenticationExceptionSaSystemException
- SaSystemException- See Also:
SaWFConnector.getGroupbox(int[], java.lang.String)
-
getInbox
public java.util.List<TaskInfo> getInbox(java.lang.String filter) throws SaAuthenticationException, SaSystemException
Read the content of the inbox.- Specified by:
getInbox
in interfaceSaWFConnector
- Parameters:
filter
- HQL filter- Returns:
- List of TaskInfo objects
- Throws:
SaAuthenticationException
- SaAuthenticationExceptionSaSystemException
- SaSystemException- See Also:
SaWFConnector.getInbox(java.lang.String)
-
getOrgUnitbox
public java.util.List<TaskInfo> getOrgUnitbox(int[] ids, java.lang.String filter) throws SaAuthenticationException, SaSystemException
Read the content of the organisation unit box.- Specified by:
getOrgUnitbox
in interfaceSaWFConnector
- Parameters:
ids
- Filter ID'sfilter
- HQL filter- Returns:
- List of TaskInfo objects
- Throws:
SaAuthenticationException
- SaAuthenticationExceptionSaSystemException
- SaSystemException- See Also:
SaWFConnector.getOrgUnitbox(int[], java.lang.String)
-
getTask
public SaWFTask getTask(TaskInfo taskInfo) throws SaAuthenticationException, SaSystemException, SaWorkflowException
Creates a task object from the given task information.- Specified by:
getTask
in interfaceSaWFConnector
- Parameters:
taskInfo
- Task information- Returns:
- Task object
- Throws:
SaAuthenticationException
- SaAuthenticationExceptionSaSystemException
- SaSystemExceptionSaWorkflowException
- Workflow exception- See Also:
SaWFConnector.getTask(com.saperion.intf.wf.TaskInfo)
-
getTask
public SaWFTask getTask(java.lang.String taskId) throws SaAuthenticationException, SaSystemException, SaWorkflowException
Get task direct by ID.- Specified by:
getTask
in interfaceSaWFConnector
- Parameters:
taskId
- Task SysRowId- Returns:
- Task information
- Throws:
SaAuthenticationException
- SaAuthenticationExceptionSaSystemException
- SaSystemExceptionSaWorkflowException
- Workflow exception- See Also:
SaWFConnector.getTask(java.lang.String)
-
getParentTask
public SaWFTask getParentTask(java.lang.String taskId) throws SaAuthenticationException, SaSystemException, SaWorkflowException
Get parent task direct by ID.- Specified by:
getParentTask
in interfaceSaWFConnector
- Parameters:
taskId
- Task SysRowId- Returns:
- Task information
- Throws:
SaAuthenticationException
- SaAuthenticationExceptionSaSystemException
- SaSystemExceptionSaWorkflowException
- Workflow exception- See Also:
SaWFConnector.getParentTask(java.lang.String)
-
getSubstitutebox
public java.util.List<TaskInfo> getSubstitutebox(int[] ids, java.lang.String filter) throws SaAuthenticationException, SaSystemException
Read the content of the substitute box.- Specified by:
getSubstitutebox
in interfaceSaWFConnector
- Parameters:
ids
- Filter ID'sfilter
- HQL filter- Returns:
- List of TaskInfo objects
- Throws:
SaAuthenticationException
- SaAuthenticationExceptionSaSystemException
- SaSystemException- See Also:
SaWFConnector.getSubstitutebox(int[], java.lang.String)
-
getTaskList
public java.util.List<TaskInfo> getTaskList(int[] boxIds, java.lang.String filter) throws SaAuthenticationException, SaSystemException
Reads the task for this user.- Specified by:
getTaskList
in interfaceSaWFConnector
- Parameters:
boxIds
- BoxIdsfilter
- HQL filter. Optional WHERE condition that will be added to the original query.
In order to add the pagination functionality like setMaxResults() and/or setFirstResult(), add the following statements to the filter:
filter_stmt;MAXRESULTS=x ;FIRSTRESULT=y.
;MAXRESULTS=x - x means the limitation of the result set output.
;FIRSTRESULT=y - y means setting the result set cursor to the y-position.
Adding pagination is optional feature that can be used without filter statement as well. In other words filter might consist of ;MAXRESULTS=x ;FIRSTRESULT=y string only.
Examples:
1. LASTUSER ='Bolt';MAXRESULTS=50 ;FIRSTRESULT=1 - hql query's where condition is enhanced with restriction LASTUSER ='Bolt' and the pagination functionality setMaxResults() and setFirstResult() is used;
2. ;MAXRESULTS=50 - only setMaxResult() will be used.
using ; ist important for applying pagination.- Returns:
- List of TaskInfo objects
- Throws:
SaAuthenticationException
- SaAuthenticationExceptionSaSystemException
- SaSystemException- See Also:
SaWFConnector.getTaskList(int[], java.lang.String)
-
getTaskList
public java.util.List<TaskInfo> getTaskList(int[] boxIds, java.lang.String filter, java.util.Map<java.lang.String,java.lang.Object> parameter) throws SaAuthenticationException, SaSystemException
Reads the task for this user.- Specified by:
getTaskList
in interfaceSaWFConnector
- Parameters:
boxIds
- BoxIdsfilter
- HQL filter. Optional WHERE condition that will be added to the original query.
In order to add the pagination functionality like setMaxResults() and/or setFirstResult(), add the following statements to the filter:
filter_stmt;MAXRESULTS=x ;FIRSTRESULT=y.
;MAXRESULTS=x - x means the limitation of the result set output.
;FIRSTRESULT=y - y means setting the result set cursor to the y-position.
Adding pagination is optional feature that can be used without filter statement as well. In other words filter might consist of ;MAXRESULTS=x ;FIRSTRESULT=y string only.
Examples:
1. LASTUSER ='Bolt';MAXRESULTS=50 ;FIRSTRESULT=1 - hql query's where condition is enhanced with restriction LASTUSER ='Bolt' and the pagination functionality setMaxResults() and setFirstResult() is used;
2. ;MAXRESULTS=50 - only setMaxResult() will be used.
using ; ist important for applying pagination.parameter
- parameters for the filter-statement, if used- Returns:
- List of TaskInfo objects
- Throws:
SaAuthenticationException
- SaAuthenticationExceptionSaSystemException
- SaSystemException- See Also:
SaWFConnector.getTaskList(int[], java.lang.String, java.util.Map)
-
getTaskAuditList
public java.util.List<TaskAuditInfo> getTaskAuditList(int[] boxIds, java.lang.String filter) throws SaAuthenticationException, SaSystemException
Reads the task audit for this user.- Specified by:
getTaskAuditList
in interfaceSaWFConnector
- Parameters:
boxIds
- BoxIdsfilter
- HQL filter- Returns:
- List of
TaskAuditInfo
objects - Throws:
SaAuthenticationException
- SaAuthenticationExceptionSaSystemException
- SaSystemException- See Also:
SaWFConnector.getTaskAuditList(int[], java.lang.String)
-
getTaskAuditList
public java.util.List<TaskAuditInfo> getTaskAuditList(int[] boxIds, java.lang.String filter, java.util.Map<java.lang.String,java.lang.Object> parameter) throws SaAuthenticationException, SaSystemException
Reads the task audit for this user.- Specified by:
getTaskAuditList
in interfaceSaWFConnector
- Parameters:
boxIds
- BoxIdsfilter
- HQL filterparameter
- Filter parameter- Returns:
- List of
TaskAuditInfo
objects - Throws:
SaAuthenticationException
- SaAuthenticationExceptionSaSystemException
- SaSystemException- See Also:
SaWFConnector.getTaskAuditList(int[], java.lang.String, java.util.Map)
-
executeStartProcess
public TaskInfo executeStartProcess(java.lang.String definition, ActorInfo nextActor, java.lang.String comment, java.lang.String attachmentUID) throws SaWorkflowException
Start new process.- Specified by:
executeStartProcess
in interfaceSaWFConnector
- Parameters:
definition
- Process definitionnextActor
- Next actorcomment
- CommentattachmentUID
- Attachment UID (a HDOC)- Returns:
- Task info of new process
- Throws:
SaWorkflowException
- Workflow exception- See Also:
SaWFConnector.executeStartProcess(java.lang.String, com.saperion.intf.wf.ActorInfo, java.lang.String, java.lang.String)
-
logoff
public boolean logoff() throws SaAuthenticationException, SaSystemException
Logoff from the backend system. This command also destroys the command thread on the java broker server.- Specified by:
logoff
in interfaceSaWFConnector
- Returns:
- boolean. True, if logoff successful.
- Throws:
SaAuthenticationException
- SaAuthenticationExceptionSaSystemException
- SaSystemException- See Also:
SaWFConnector.logoff()
-
logon
public int logon(java.lang.String username, java.lang.String password, int type, java.lang.String client) throws SaAuthenticationException, SaSystemException
performs logon to the backend system.- Specified by:
logon
in interfaceSaWFConnector
- Parameters:
username
- User's full namepassword
- Passwordtype
- User type that means client license type. There are possible the following integer values:- 1 = index
- 2 = query
- 3 = univeral administrator
- 4 = web query
- 7 = web index
- 12 = workflow
- 13 = scan
- 14 = highend scan
- 15 = API query
- 16 = API index
- 17 = API scan
- 20 = basic administrator
- 29 = web workflow
client
- client/mandant name, used in multi-client systems- Returns:
- User token for the current session.
- Throws:
SaAuthenticationException
- SaAuthenticationExceptionSaSystemException
- SaSystemException- See Also:
SaWFConnector.logon(java.lang.String, java.lang.String, int, java.lang.String)
-
getUserId
public int getUserId()
User ID for the actual user.- Specified by:
getUserId
in interfaceSaWFConnector
- Returns:
- User id
- See Also:
SaWFConnector.getUserId()
-
getXMLTaskList
public java.lang.String getXMLTaskList(java.util.List<TaskInfo> taskList)
Converts a task list to xml.- Specified by:
getXMLTaskList
in interfaceSaWFConnector
- Parameters:
taskList
- Task list- Returns:
- Task XML as String
- See Also:
SaWFConnector.getXMLTaskList(java.util.List)
-
getProcessDefinitions
public java.util.List<java.lang.String> getProcessDefinitions() throws SaAuthenticationException, SaSystemException, SaWorkflowException
Reads all available process definitions.- Specified by:
getProcessDefinitions
in interfaceSaWFConnector
- Returns:
- Process definitions
- Throws:
SaAuthenticationException
- SaAuthenticationExceptionSaSystemException
- SaSystemExceptionSaWorkflowException
- Workflow exception- See Also:
SaWFConnector.getProcessDefinitions()
-
getProcessDefinitions
public java.util.List<ProcessDefinitionDescriptor> getProcessDefinitions(java.lang.String ddcName) throws SaAuthenticationException, SaSystemException, SaWorkflowException
Returns the process definitions that are allowed to be used for documents contained in the specified DDC. If no restrictions are configured, all process definitions will be returned.- Specified by:
getProcessDefinitions
in interfaceSaWFConnector
- Parameters:
ddcName
- name of the DDC- Returns:
- Workflowdefinition list
- Throws:
SaAuthenticationException
- authentication error when loading definitionsSaSystemException
- system error when loading definitionsSaWorkflowException
- workflow error when loading definitions- See Also:
SaWFConnector.getProcessDefinitions(java.lang.String)
-
getOutOfOffice
public boolean getOutOfOffice() throws SaAuthenticationException, SaSystemException
Get the out of office status for the logged on user.- Specified by:
getOutOfOffice
in interfaceSaWFConnector
- Returns:
- is OutOfOffice
- Throws:
SaAuthenticationException
- SaAuthenticationExceptionSaSystemException
- SaSystemException- See Also:
SaWFConnector.getOutOfOffice()
-
getSubstitute
public java.lang.String getSubstitute() throws SaAuthenticationException, SaSystemException
Get the substitute for the logged on user.- Specified by:
getSubstitute
in interfaceSaWFConnector
- Returns:
- Substitute name
- Throws:
SaAuthenticationException
- SaAuthenticationExceptionSaSystemException
- SaSystemException- See Also:
SaWFConnector.getSubstitute()
-
setOutOfOffice
public void setOutOfOffice(boolean isOutOfOffice) throws SaAuthenticationException, SaSystemException
set the out of office status for the logged on user.- Specified by:
setOutOfOffice
in interfaceSaWFConnector
- Parameters:
isOutOfOffice
- True, if is OutOfOffice- Throws:
SaAuthenticationException
- SaAuthenticationExceptionSaSystemException
- SaSystemException- See Also:
SaWFConnector.setOutOfOffice(boolean)
-
setSubstitute
public void setSubstitute(java.lang.String name) throws SaAuthenticationException, SaSystemException
Set the substitute for the logged on user.- Specified by:
setSubstitute
in interfaceSaWFConnector
- Parameters:
name
- the fullname of the substitute user- Throws:
SaAuthenticationException
- SaAuthenticationExceptionSaSystemException
- SaSystemException- See Also:
SaWFConnector.setSubstitute(java.lang.String)
-
getDocHistories
public java.util.List<HistoryInfo[]> getDocHistories(java.lang.String documentHdoc) throws SaWorkflowException
Gets the document's process histories.- Specified by:
getDocHistories
in interfaceSaWFConnector
- Parameters:
documentHdoc
- Document's HDoc- Returns:
- List of arrays of history objects
- Throws:
SaWorkflowException
- Workflow exception- See Also:
SaWFConnector.getDocHistories(String)
-
getDocHistoriesXML
public java.util.List<java.lang.String> getDocHistoriesXML(java.lang.String documentHdoc) throws SaWorkflowException
Gets the document's process histories as XML.- Specified by:
getDocHistoriesXML
in interfaceSaWFConnector
- Parameters:
documentHdoc
- Document's UID- Returns:
- List of XML strings of history objects
- Throws:
SaWorkflowException
- Workflow exception- See Also:
SaWFConnector.getDocHistoriesXML(String)
-
getDocHistoriesXML
public java.util.List<java.lang.String> getDocHistoriesXML(java.lang.String documentHdoc, java.lang.String language) throws SaWorkflowException
Gets the document's process histories as XML.- Specified by:
getDocHistoriesXML
in interfaceSaWFConnector
- Parameters:
documentHdoc
- Document's UIDlanguage
- Language- Returns:
- List of XML strings of history objects
- Throws:
SaWorkflowException
- Workflow exception- See Also:
SaWFConnector.getDocHistoriesXML(java.lang.String)
-
getDocHistoriesXML2
public java.util.List<java.lang.String> getDocHistoriesXML2(java.lang.String documentHdoc, java.lang.String language) throws SaWorkflowException
Gets the the second variant of document's process histories as XML.- Specified by:
getDocHistoriesXML2
in interfaceSaWFConnector
- Parameters:
documentHdoc
- Document's UIDlanguage
- Language- Returns:
- List of XML strings of history objects
- Throws:
SaWorkflowException
- Workflow exception- See Also:
SaWFConnector.getDocHistoriesXML2(String, String)
-
getDocHistoriesXML2
public java.util.List<java.lang.String> getDocHistoriesXML2(java.lang.String documentHdoc, java.lang.String language, boolean isAscending) throws SaWorkflowException
Gets the the second variant of document's process histories as XML with ascending/descending switch.- Specified by:
getDocHistoriesXML2
in interfaceSaWFConnector
- Parameters:
documentHdoc
- Document's UIDlanguage
- LanguageisAscending
- Is ascending- Returns:
- List of XML strings of history objects
- Throws:
SaWorkflowException
- Workflow exception- See Also:
SaWFConnector.getDocHistoriesXML2(String, String, boolean)
-
getMembers
public WorkflowMember getMembers() throws SaAuthenticationException, SaSystemException
Reads the workflow member tree.- Specified by:
getMembers
in interfaceSaWFConnector
- Returns:
- Member tree
- Throws:
SaAuthenticationException
- SaAuthenticationExceptionSaSystemException
- SaSystemException- See Also:
SaWFConnector.getMembers()
-
getMember
public WorkflowMember getMember(WorkflowMember member, int depth, java.lang.String filter) throws SaAuthenticationException, SaSystemException
Reads direct workflow member tree.- Specified by:
getMember
in interfaceSaWFConnector
- Parameters:
member
- workflow member, which children have to be returned.depth
- of children.filter
- filter string- Returns:
- Member tree
- Throws:
SaAuthenticationException
- SaAuthenticationExceptionSaSystemException
- SaSystemException- See Also:
SaWFConnector.getMember(WorkflowMember, int, String)
-
getClassicConnector
public SaClassicConnector getClassicConnector()
Gets the classic connector behind this connector. ;- Specified by:
getClassicConnector
in interfaceSaWFConnector
- Returns:
- Classic connector behind this connector
- See Also:
SaWFConnector.getClassicConnector()
-
getWorkflowDdcName
public java.lang.String getWorkflowDdcName() throws SaSystemException
Gets the workflow ddc name- Specified by:
getWorkflowDdcName
in interfaceSaWFConnector
- Returns:
- the name of the workflow ddc
- Throws:
SaSystemException
- See Also:
SaWFConnector.getWorkflowDdcName()
-
-