STWProcessManager

open class STWProcessManager
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>)
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>)
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>)
Cancels the given process.
Link copied to clipboard
open fun cancelRepeat(    @NonNull context: Context,     @NonNull processUUID: String,     @Nullable callback: STWOperationCallback<MyBusinessError>)
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>)
Saves and completes the given process to the given recipients.
Link copied to clipboard
open fun createNewProcess(@NonNull context: Context, @NonNull templateUUID: String): ProcessItem
open fun createNewProcess(    @NonNull context: Context,     @NonNull templateUUID: String,     @NonNull processUUID: String): ProcessItem
Creates a new process using the given template.
Link copied to clipboard
open fun deleteAttachment(    @NonNull context: Context,     @NonNull processUUID: String,     @NonNull attachmentPath: String): Boolean
Deletes the given attachment from process directory.
Link copied to clipboard
open fun deleteProcesses(    @NonNull context: Context,     @NonNull processList: List<ProcessItem>,     @Nullable callback: STWProcessDeleteCallback<MyBusinessError>)
Deletes the given process list.
Link copied to clipboard
open fun downloadFileFromExternalSystem(    @NonNull context: Context,     @NonNull fileUrl: String,     @NonNull processUUID: String,     @NonNull desFileName: String,     @Nullable callback: STWOperationCallback)
Downloads file from from given fileUrl in the process directory.
Link copied to clipboard
open fun duplicateProcess(@NonNull context: Context, @NonNull processUUID: String): ProcessItem
Creates a new copy of the given process.
Link copied to clipboard
open fun filter(    @NonNull context: Context,     tab: Int,     filterType: Int,     @Nullable data: String): Boolean
Adds/updates/removes filter on the given tab.
Link copied to clipboard
open fun forwardProcess(    @NonNull context: Context,     @NonNull processUUID: String,     @Nullable callback: STWForwardProcessCallback<MyBusinessError>)
Exports process in PDF format to be forwarded as a file attachment.
Link copied to clipboard
open fun getAttachmentFilePath(@NonNull processUUID: String, @NonNull fileName: String): String
Gets the path of the attachment file.
Link copied to clipboard
open fun getAttachmentFileUri(@NonNull processUUID: String, @NonNull fileName: String): Uri
open fun getAttachmentFileUri(    @NonNull processUUID: String,     @NonNull fileName: String,     @NonNull displayName: String): Uri
Gets the Uri of the attachment file.
Link copied to clipboard
open fun getInstance(): STWProcessManager
Get or create the single instance of STWProcessManager.
Link copied to clipboard
open fun getOrCreateProcessConversation(@NonNull context: Context, @NonNull processUUID: String): ThreadItem
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>
Retrieves the attachments linked to the given process.
Link copied to clipboard
open fun getProcessByUuid(@NonNull context: Context, @NonNull processUUID: String): ProcessItem
Gets the process having the given processUUID.
Link copied to clipboard
open fun getProcessConversation(@NonNull context: Context, @NonNull processUUID: String): ThreadItem
Retrieves the conversation linked to the given process
Link copied to clipboard
open fun getProcessDataJson(@NonNull context: Context, @NonNull processUUID: String): JSONObject
Loads the process data JSON, that contains all widgets data.
Link copied to clipboard
open fun getProcessDataJsonByVersion(@NonNull processUUID: String, version: Int): JSONObject
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
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>
Gets the history of the given process.
Link copied to clipboard
open fun getProcessListByTab(    @NonNull context: Context,     tab: Int,     @Nullable searchKeyword: String): List<ProcessItem>
open fun getProcessListByTab(    @NonNull context: Context,     tab: Int,     applyFilter: Boolean,     applySort: Boolean,     @Nullable searchKeyword: String): List<ProcessItem>
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>>
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
Gets the the template used for the given process.
Link copied to clipboard
open fun getProcessTemplateJson(@NonNull context: Context, @NonNull processUUID: String): JSONObject
Loads the template JSON from the given process.
Link copied to clipboard
open fun getSignatureFilePath(@NonNull processUUID: String, @NonNull signatureFileName: String): String
Gets the path of the signature file.
Link copied to clipboard
open fun getSortType(@NonNull context: Context, tab: Int): Int
Gets the sort type for the given tab.
Link copied to clipboard
open fun getTemplatePreview(@NonNull templateUUID: String): JSONObject
Loads the template JSON for preview from the given templateUUID.
Link copied to clipboard
open fun getUnreadProcessCount(@NonNull context: Context): Int
Gets the count of unread versions for all processes.
Link copied to clipboard
open fun hasFilters(@NonNull context: Context, tab: Int): Boolean
Checks whether the given tab has filters.
Link copied to clipboard
open fun keepProcessAlive(@NonNull context: Context, @NonNull processUUID: String)
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>)
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>)
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>)
Sends a notification to an external system.
Link copied to clipboard
open fun registerProcessUpdateListener(@NonNull listener: OnProcessUpdateListener)
Register the specified listener to be notified by any process events updates.
Link copied to clipboard
open fun registerStartStopWidgetToLocationService(    @NonNull context: Context,     @NonNull processUUID: String,     @NonNull widgetUUID: String)
Register StartStop widget to the location service in order to collect location information such as distance traveled ...etc.
Link copied to clipboard
open fun releaseExternalSystemToken(@NonNull widgetUUID: String)
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>)
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>)
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)
Requests Data from an external system.
Link copied to clipboard
open fun resetTabFilters(@NonNull context: Context, tab: Int)
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>)
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>)
Saves the given process options.
Link copied to clipboard
open fun setProcessControlRevokedRead(@NonNull context: Context, @NonNull processUUID: String)
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)
Update the process to not display pop up again.
Link copied to clipboard
open fun setSortType(    @NonNull context: Context,     tab: Int,     sortType: Int)
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>)
Link copied to clipboard
open fun stopProcess(    @NonNull context: Context,     @NonNull processUUID: String,     @Nullable callback: STWOperationCallback<MyBusinessError>)
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>)
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>)
Synchronize the last repeat process
Link copied to clipboard
open fun syncProcessExpirationReadRequest(@NonNull context: Context, @Nullable processUUID: String)
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>)
Requests to take the lead on the given process.
Link copied to clipboard
open fun unregisterProcessUpdateListener(@NonNull listener: OnProcessUpdateListener)
Unregister the specified listener to not receive any more the process events updates
open fun unregisterStartStopWidgetToLocationService(    @NonNull context: Context,     @NonNull processUUID: String,     @NonNull widgetUUID: String): StartStopDistance
Unregister StartStop widget from location service and get collected location information.