STWProcess Manager
STWProcessManager
Public Class that manages all operations concerning My Business processes in the Application. Processes in the application are classified by tab, according to their states The following list presents the process tabs in App
See also
- IN_PROGRESS
- The list of processes under user control.
- SUBMITTED
- The list of processes submitted.
- COMPLETED
- The list of processes completed.
- CANCELED
- The list of processes canceled.
- NEW
- The list of processes received from other paticipant.
- DRAFT
- The list of processes created by user, but not sent yet.
This class offers several possible operations defined in the following list:
- Get the list of processes by tab
- Get process identified by process uuid
- Mark unread process as read
- Get the count of unread process
- Renew a repeat process cycle
- Synchornize the last repeat process
- Create a process filters
- Change process sort criterea
- Get the conversation linked to a specific process
- Register a listener to handle all update events
Functions
Link copied to clipboard
open fun addAttachment( @NonNull context: Context, @NonNull processUUID: String, @NonNull bitmap: Bitmap, @NonNull fileName: String, @Nullable callback: STWAddAttachmentCallback<MyBusinessError>)
Content copied to clipboard
Saves the given bitmap as an attachment in the process directory.
open fun addAttachment( @NonNull context: Context, @NonNull processUUID: String, @NonNull srcFile: File, @NonNull newFileName: String, @Nullable callback: STWAddAttachmentCallback<MyBusinessError>)
Content copied to clipboard
Saves the given file as an attachment in the process directory.
Link copied to clipboard
open fun cancelProcess( @NonNull context: Context, @NonNull processUUID: String, @Nullable processName: String, @Nullable values: JSONObject, @Nullable callback: STWOperationCallback<MyBusinessError>)
Content copied to clipboard
Cancels the given process.
Link copied to clipboard
open fun cancelRepeat( @NonNull context: Context, @NonNull processUUID: String, @Nullable callback: STWOperationCallback<MyBusinessError>)
Content copied to clipboard
Cancels the planed repetition of the given process
Link copied to clipboard
open fun completeProcess( @NonNull context: Context, @NonNull processUUID: String, @NonNull processName: String, @NonNull values: JSONObject, @Nullable recipients: Array<String>, @Nullable callback: STWOperationCallback<MyBusinessError>)
Content copied to clipboard
Saves and completes the given process to the given recipients.
Link copied to clipboard
open fun createNewProcess(@NonNull context: Context, @NonNull templateUUID: String): ProcessItem
Content copied to clipboard
open fun createNewProcess( @NonNull context: Context, @NonNull templateUUID: String, @NonNull processUUID: String): ProcessItem
Content copied to clipboard
Creates a new process using the given template.
Link copied to clipboard
Link copied to clipboard
open fun deleteProcesses( @NonNull context: Context, @NonNull processList: List<ProcessItem>, @Nullable callback: STWProcessDeleteCallback<MyBusinessError>)
Content copied to clipboard
Deletes the given process list.
Link copied to clipboard
Link copied to clipboard
open fun duplicateProcess(@NonNull context: Context, @NonNull processUUID: String): ProcessItem
Content copied to clipboard
Creates a new copy of the given process.
Link copied to clipboard
open fun forwardProcess( @NonNull context: Context, @NonNull processUUID: String, @Nullable callback: STWForwardProcessCallback<MyBusinessError>)
Content copied to clipboard
Exports process in PDF format to be forwarded as a file attachment.
Link copied to clipboard
Link copied to clipboard
open fun getAttachmentFileUri(@NonNull processUUID: String, @NonNull fileName: String): Uri
Content copied to clipboard
open fun getAttachmentFileUri( @NonNull processUUID: String, @NonNull fileName: String, @NonNull displayName: String): Uri
Content copied to clipboard
Gets the Uri of the attachment file.
Link copied to clipboard
Get or create the single instance of STWProcessManager.
Link copied to clipboard
open fun getOrCreateProcessConversation(@NonNull context: Context, @NonNull processUUID: String): ThreadItem
Content copied to clipboard
Gets or creates a new conversation linked to the given process UUID
Link copied to clipboard
open fun getProcessAttachments(@NonNull context: Context, @Nullable processUUID: String): List<ProcessAttachmentItem>
Content copied to clipboard
Retrieves the attachments linked to the given process.
Link copied to clipboard
open fun getProcessByUuid(@NonNull context: Context, @NonNull processUUID: String): ProcessItem
Content copied to clipboard
Gets the process having the given processUUID.
Link copied to clipboard
open fun getProcessConversation(@NonNull context: Context, @NonNull processUUID: String): ThreadItem
Content copied to clipboard
Retrieves the conversation linked to the given process
Link copied to clipboard
open fun getProcessDataJson(@NonNull context: Context, @NonNull processUUID: String): JSONObject
Content copied to clipboard
Loads the process data JSON, that contains all widgets data.
Link copied to clipboard
open fun getProcessDataJsonByVersion(@NonNull processUUID: String, version: Int): JSONObject
Content copied to clipboard
Loads the process data JSON for the given version, that contains all widgets data at this version.
Link copied to clipboard
open fun getProcessFilter( @NonNull context: Context, tab: Int, filter: Int): ProcessFilterItem
Content copied to clipboard
Gets the process filter added for the given tab and corresponding to the given filter type .
Link copied to clipboard
open fun getProcessHistory(@NonNull context: Context, @NonNull processUUID: String): List<STWProcessVersion>
Content copied to clipboard
Gets the history of the given process.
Link copied to clipboard
open fun getProcessListByTab( @NonNull context: Context, tab: Int, @Nullable searchKeyword: String): List<ProcessItem>
Content copied to clipboard
open fun getProcessListByTab( @NonNull context: Context, tab: Int, applyFilter: Boolean, applySort: Boolean, @Nullable searchKeyword: String): List<ProcessItem>
Content copied to clipboard
Gets the list of processes that belongs to the given tab and matching the searchKeyword.
Link copied to clipboard
open fun getProcessRecipient( @NonNull context: Context, @NonNull templateUuid: String, @Nullable processUUID: String, version: Int): Pair<ArrayList<PhoneItem>, ArrayList<ContactItem>>
Content copied to clipboard
Retrieve the list of ContactItem and PhoneItem for draft version or from last process using same template (process has no version(0)).
Link copied to clipboard
open fun getProcessTemplate(@NonNull context: Context, @NonNull processUUID: String): TemplateItem
Content copied to clipboard
Gets the the template used for the given process.
Link copied to clipboard
open fun getProcessTemplateJson(@NonNull context: Context, @NonNull processUUID: String): JSONObject
Content copied to clipboard
Loads the template JSON from the given process.
Link copied to clipboard
Link copied to clipboard
Gets the sort type for the given tab.
Link copied to clipboard
Loads the template JSON for preview from the given templateUUID.
Link copied to clipboard
Gets the count of unread versions for all processes.
Link copied to clipboard
Checks whether the given tab has filters.
Link copied to clipboard
open fun keepProcessAlive(@NonNull context: Context, @NonNull processUUID: String)
Content copied to clipboard
Requests to keep the given process alive, and do not cancel it automatically.
Link copied to clipboard
open fun loadPreviousProcessData( @NonNull context: Context, @NonNull processUUID: String, @NonNull widgetUUID: String, @NonNull widgetValue: Any, @Nullable blacklistedWidgetsUUIDs: List<String>, @Nullable callback: STWLoadProcessPreviousDataCallback<MyBusinessError>)
Content copied to clipboard
Loads last data entered in process created with same template and same data entered in the given widget.
Link copied to clipboard
open fun markProcessesAsRead( @NonNull context: Context, @NonNull processes: List<ProcessItem>, @Nullable callback: STWOperationCallback<MyBusinessError>)
Content copied to clipboard
Marks the given process list as read.
Link copied to clipboard
open fun notifyExternalSystem( @NonNull context: Context, @NonNull processUUID: String, @Nullable params: STWExternalSystemParams, @Nullable callback: STWExternalSystemCallback<MyBusinessError>)
Content copied to clipboard
Sends a notification to an external system.
Link copied to clipboard
open fun registerProcessUpdateListener(@NonNull listener: OnProcessUpdateListener)
Content copied to clipboard
Register the specified listener to be notified by any process events updates.
Link copied to clipboard
Link copied to clipboard
Releases the allocated token, for the given widget.
Link copied to clipboard
open fun releaseTheControl( @NonNull context: Context, @NonNull processUUID: String, @Nullable callback: STWOperationCallback<MyBusinessError>)
Content copied to clipboard
Requests to release the control on the given process.
Link copied to clipboard
open fun renewRepeatProcessCycle( @NonNull context: Context, @NonNull processUUID: String, @Nullable callback: STWOperationCallback<MyBusinessError>)
Content copied to clipboard
Creates a new repeat cycle for the given process.
Link copied to clipboard
open fun requestDataFromExternalSystem( @NonNull context: Context, @NonNull processUUID: String, @NonNull params: STWExternalSystemParams, @Nullable callback: STWMyBusinessExternalDBCallback)
Content copied to clipboard
Requests Data from an external system.
Link copied to clipboard
Deletes all process filters added for the given tab.
Link copied to clipboard
open fun saveProcess( @NonNull context: Context, @NonNull processUUID: String, @NonNull processName: String, @NonNull values: JSONObject, @Nullable recipients: Array<String>, @Nullable callback: STWOperationCallback<MyBusinessError>)
Content copied to clipboard
Saves the given process locally and synchronises new values with other clients.
Link copied to clipboard
open fun saveProcessOptions( @NonNull context: Context, @NonNull processUUID: String, @NonNull options: STWProcessOptions, @Nullable callback: STWOperationCallback<MyBusinessError>)
Content copied to clipboard
Saves the given process options.
Link copied to clipboard
open fun setProcessControlRevokedRead(@NonNull context: Context, @NonNull processUUID: String)
Content copied to clipboard
Sends request to inform backend that the revoke of process control information was read by user.
Link copied to clipboard
open fun setRecipientNotAllowedSeen(@NonNull context: Context, @NonNull processUUID: String)
Content copied to clipboard
Update the process to not display pop up again.
Link copied to clipboard
open fun setSortType( @NonNull context: Context, tab: Int, sortType: Int)
Content copied to clipboard
Set a new sort type on the given tab.
Link copied to clipboard
open fun startProcess( @NonNull context: Context, @NonNull processUUID: String, @Nullable callback: STWOperationCallback<MyBusinessError>)
Content copied to clipboard
Link copied to clipboard
open fun stopProcess( @NonNull context: Context, @NonNull processUUID: String, @Nullable callback: STWOperationCallback<MyBusinessError>)
Content copied to clipboard
Link copied to clipboard
open fun submitProcess( @NonNull context: Context, @NonNull processUUID: String, @NonNull processName: String, @NonNull values: JSONObject, @NonNull recipients: Array<String>, @Nullable callback: STWOperationCallback<MyBusinessError>)
Content copied to clipboard
Saves and Submits the given process to the given recipients.
Link copied to clipboard
open fun syncLastRepeatProcess( @NonNull context: Context, @NonNull processUUID: String, @Nullable callback: STWOperationCallback<MyBusinessError>)
Content copied to clipboard
Synchronize the last repeat process
Link copied to clipboard
open fun syncProcessExpirationReadRequest(@NonNull context: Context, @Nullable processUUID: String)
Content copied to clipboard
Called to synchronize that the process expiration notification was read
Link copied to clipboard
open fun takeTheLead( @NonNull context: Context, @NonNull processUUID: String, @Nullable callback: STWOperationCallback<MyBusinessError>)
Content copied to clipboard
Requests to take the lead on the given process.
Link copied to clipboard
open fun unregisterProcessUpdateListener(@NonNull listener: OnProcessUpdateListener)
Content copied to clipboard
Unregister the specified listener to not receive any more the process events updates
Link copied to clipboard