STWTemplatesApi

object STWTemplatesApi : ObservableApi

Functions

Link copied to clipboard
fun addTemplateToFavorite(    context: Context,     templateUuid: String,     callback: OperationListener<MyBusinessError>?)

Adds a template to the list of favorite templates. The new favorite template is always added at the first position in favorite list.

Link copied to clipboard
fun changeTemplateFavoriteListOrder(    context: Context,     sortedList: List<STWTemplate?>?,     callback: OperationListener<MyBusinessError>?)

Changes the order of favorite list. The new order will be synchronized with other client Apps.

Link copied to clipboard
suspend fun getAllTemplates(    context: Context,     categoryUUID: String? = null,     searchKeyword: String? = null): List<STWTemplate>?

Gets the full list of templates that matching the keyword.

Link copied to clipboard
fun getAllTemplatesAsFlow(    context: Context,     categoryUUID: String? = null,     searchKeyword: String? = null): Flow<List<STWTemplate>?>

Gets the full list of templates that matching the keyword.

Link copied to clipboard
fun getAllTemplatesAsLiveData(    context: Context,     categoryUUID: String? = null,     searchKeyword: String? = null): LiveData<List<STWTemplate>?>

Gets the full list of templates that matching the keyword.

Link copied to clipboard
suspend fun geTemplateIcon(iconName: String, iconType: Int): Bitmap?

Gets the template icon as Bitmap.

Link copied to clipboard
suspend fun getFavoriteTemplateList(context: Context): List<STWTemplate>?

Gets the list of user favorite templates. And it should be called only from a coroutine or another suspend function.

Link copied to clipboard
fun getFavoriteTemplateListAsLiveData(context: Context): LiveData<List<STWTemplate>?>

Gets the list of user favorite templates.

Link copied to clipboard
fun getRecentTemplateMaxSize(context: Context): Int
Link copied to clipboard
suspend fun getRecentUsedTemplateList(context: Context): List<STWTemplate>?

Gets the list of templates recently used to create processes. The list size of resent templates is limited to maximum count configurable on backend side.

Link copied to clipboard
fun getRecentUsedTemplateListAsFlow(context: Context): Flow<List<STWTemplate>?>

Gets the list of templates recently used to create processes. The list size of resent templates is limited to maximum count configurable on backend side.

Link copied to clipboard
fun getRecentUsedTemplateListAsLiveData(context: Context): LiveData<List<STWTemplate>?>

Gets the list of templates recently used to create processes. The list size of resent templates is limited to maximum count configurable on backend side.

Link copied to clipboard
suspend fun getTemplateByUUID(context: Context, templateUUID: String): STWTemplate?

Gets the STWTemplate having the given templateUUID.

Link copied to clipboard
suspend fun getTemplateCategories(context: Context): List<STWTemplateCategory>?

Gets the list of templates categories. and it should be called only from a coroutine or another suspend function

Link copied to clipboard
fun getTemplateCategoriesAsFlow(context: Context): Flow<List<STWTemplateCategory>?>

Gets the list of templates categories.

Link copied to clipboard
fun getTemplateCategoriesAsLiveData(context: Context): LiveData<List<STWTemplateCategory>?>

Gets the list of templates categories.

Link copied to clipboard
suspend fun getTemplateCategoryByUUID(context: Context, categoryUUID: String): STWTemplateCategory?

Gets a template category having the given categoryUUID. This method return null if the given categoryUUID is empty or the corresponding category is not found.

Link copied to clipboard
fun getTemplateIconUri(templateIconName: String, iconType: Int): Uri

Gets the template icon Uri. There is Three types of template icon

Link copied to clipboard
fun isTemplateAvailable(context: Context, templateUuid: String): Boolean

Checks the availability of template. If the last version of template is not available, a download operation will be forced.

Link copied to clipboard
fun removeTemplateFromFavorite(    context: Context,     templateUuid: String,     callback: OperationListener<MyBusinessError>?)

Removes a template from the list of favorite templates.

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.