STWProcessApi

object STWProcessApi : ObservableApi

Properties

Link copied to clipboard
const val CLASS_NAME: String

Functions

Link copied to clipboard
suspend fun cancelProcess(    context: Context,     processUUID: String,     processName: String?,     values: JSONObject?,     onSuccess: () -> Unit? = null,     onError: (MyBusinessError) -> Unit? = null)

Cancels the given process. PS: If the process is scheduled it will be deleted as it was never created, otherwise it will be canceled and moved to the list of canceled processes.

Link copied to clipboard
suspend fun completeProcess(    context: Context,     processUUID: String,     processName: String,     values: JSONObject,     recipients: Array<String>?,     onSuccess: () -> Unit?,     onError: (MyBusinessError) -> Unit?)

Saves and completes the given process to the given recipients.

Link copied to clipboard
suspend fun createNewProcess(context: Context, templateUUID: String): ApiResult<STWProcess>

Creates a new process using the given template.

Link copied to clipboard
fun deleteProcess(    context: Context,     processList: List<STWProcess>?,     callback: STWProcessDeleteCallback?)

Deletes the given process list.

Link copied to clipboard
suspend fun duplicateProcess(context: Context, processUUID: String): ApiResult<STWProcess>

Creates a new copy of the given process. The copy will contain all values of the original process except signatures.

Link copied to clipboard
suspend fun forwardProcess(    context: Context,     processUUID: String,     callback: STWForwardProcessCallback?)

Exports process in PDF format to be forwarded as a file attachment.

Link copied to clipboard
suspend fun getAllProcess(context: Context, keyWord: String? = null): List<STWProcess>?

Get the full list processes and matching the keyWord. This function should be called only from a coroutine or another suspend function

Link copied to clipboard
fun getAllProcessAsFlow(context: Context, keyWord: String? = null): Flow<List<STWProcess>?>

Get the full list processes and matching the keyWord.

Link copied to clipboard
fun getAllProcessAsLiveData(context: Context, keyWord: String? = null): LiveData<List<STWProcess>?>

Get the full list processes and matching the keyWord.

Link copied to clipboard
suspend fun getGroupParticipants(context: Context, processUUID: String): List<STWGroup>?

Call this method to retrieve participants groups in the given process and it should be called only from a coroutine or another suspend function

Link copied to clipboard
fun getGroupParticipantsAsLiveData(context: Context, processUUID: String): LiveData<List<STWGroup>?>

Call this method to retrieve participants groups in the given process

Link copied to clipboard
fun getProcessByUUID(context: Context, processUUID: String): STWProcess?

Gets the process having the given processUUID.

Link copied to clipboard
suspend fun getProcessHistory(context: Context, processUUID: String): List<STWProcessVersion>?

Gets the history of the given process. The history contains: 1-All process versions 2-Called processes started by current process 3-All escalation done

Link copied to clipboard
suspend fun getProcessListByTab(    context: Context,     tab: Int,     keyWord: String? = null): List<STWProcess>?

Gets the list of processes that belongs to the given tab and matching the keyWord.

Link copied to clipboard
fun getProcessListByTabAsFlow(    context: Context,     tab: Int,     keyWord: String? = null): Flow<List<STWProcess>?>

Gets the list of processes that belongs to the given tab and matching the keyWord.

Link copied to clipboard
fun getProcessListByTabAsLiveData(    context: Context,     tab: Int,     keyWord: String? = null): LiveData<List<STWProcess>?>

Gets the list of processes that belongs to the given tab and matching the keyWord.

Link copied to clipboard
suspend fun getProcessParticipants(context: Context, processUUID: String): List<STWContact>

Gets the list of participants in the given processes.

Link copied to clipboard
fun getProcessParticipantsAsLiveData(context: Context, processUUID: String): LiveData<List<STWContact>?>

Gets the list of participants in the given processes.

Link copied to clipboard
fun getProcessRecipient(context: Context, processUUID: String): Array<String>?

Retrieve the list of Recipients for draft version or from last process using same template (process has no version(0)). if you pass a null process uuid, you can retrieve the list of recipients in first version for the last process created by the same template.

Link copied to clipboard
suspend fun getSingleParticipants(context: Context, processUUID: String): List<STWSingleContact>?

Call this method to retrieve single participants in the given process and it should be called only from a coroutine or another suspend function

Link copied to clipboard
fun getSingleParticipantsAsLiveData(context: Context, processUUID: String): LiveData<List<STWSingleContact>?>

Call this method to retrieve single participants in the given process as LiveData

Link copied to clipboard
fun getUnreadProcessCount(context: Context): LiveData<Int>

Gets the count of unread versions for all processes.

Link copied to clipboard
suspend fun loadProcessPreview(context: Context, templateUUID: String): ApiResult<ProcessForm>

Loads the ProcessForm for preview using the given template uuid.

Link copied to clipboard
suspend fun markProcessesAsRead(    context: Context,     processes: List<STWProcess>,     callback: OperationListener<MyBusinessError>?)

Marks the given process list as read. This operation will be synchronized with other client Apps.

Link copied to clipboard
suspend fun openProcess(    context: Context,     process: STWProcess,     lifecycleOwner: LifecycleOwner? = null): ApiResult<STWProcessStack>
suspend fun openProcess(    context: Context,     processUUID: String,     lifecycleOwner: LifecycleOwner? = null): ApiResult<STWProcessStack>

Open a process stack using the given process.

Link copied to clipboard
suspend fun releaseTheControl(context: Context, processUUID: String): ApiResult<Any>

Requests to release the control on the given process.

Link copied to clipboard
suspend fun saveProcess(    context: Context,     processUUID: String,     processName: String,     values: JSONObject,     recipients: Array<String>,     onSuccess: () -> Unit?,     onError: (MyBusinessError) -> Unit?)

Saves the given process locally and synchronises new values with other clients.

Link copied to clipboard
suspend fun stopRepeat(context: Context, processUUID: String): ApiResult<Any>

Stops the planed repetition of the given process

Link copied to clipboard
suspend fun submitProcess(    context: Context,     processUUID: String,     processName: String,     values: JSONObject,     recipients: Array<String>,     onSuccess: () -> Unit?,     onError: (MyBusinessError) -> Unit?)

Saves and Submits the given process to the given recipients.

Link copied to clipboard
suspend fun takeTheLead(context: Context, processUUID: String): ApiResult<Any>

Requests to take the lead on the given process.

Inherited functions

Link copied to clipboard
fun subscribe(listener: STWEventListener<STWEvent>): Disposable
Link copied to clipboard
fun subscribeFor(eventTypes: Array<Class<out STWEvent>>, listener: STWEventListener<STWEvent>): Disposable
fun subscribeFor(eventTypes: Array<String>, listener: STWEventListener<STWEvent>): Disposable

Subscribes to the specific eventTypes of the client.

fun subscribeFor(    lifecycleOwner: LifecycleOwner,     eventTypes: Array<Class<out STWEvent>>,     listener: STWEventListener<STWEvent>): Disposable
fun subscribeFor(    lifecycleOwner: LifecycleOwner,     eventTypes: Array<String>,     listener: STWEventListener<STWEvent>): Disposable

Subscribes to the specific eventTypes of the client, in the lifecycle of lifecycleOwner.

fun subscribeFor(    eventTypes: Array<String>,     filter: (STWEvent) -> Boolean,     listener: STWEventListener<STWEvent>): Disposable

Subscribes to the specific eventTypes of the client with additional filter.

fun subscribeFor(    lifecycleOwner: LifecycleOwner,     eventTypes: Array<String>,     filter: (STWEvent) -> Boolean,     listener: STWEventListener<STWEvent>): Disposable

Subscribes to the specific eventTypes of the client with additional filter, in the lifecycle of lifecycleOwner.

Link copied to clipboard
fun <T : STWEvent> subscribeForSingle(eventType: Class<T>, listener: STWEventListener<T>): Disposable
fun subscribeForSingle(eventType: String, listener: STWEventListener<STWEvent>): Disposable

Subscribes for the next event with the given eventType.

fun subscribeForSingle(    eventType: String,     filter: (STWEvent) -> Boolean,     listener: STWEventListener<STWEvent>): Disposable

Subscribes for the next event with the given eventType with additional filter.