_tasks

class appian_locust._tasks._Tasks(interactor: appian_locust._interactor._Interactor)

Bases: appian_locust._base._Base

INITIAL_FEED_URI = '/suite/api/feed/tempo?m=menu-tasks&t=t&s=pt&defaultFacets=%255Bstatus-open%255D'
get_all(search_string: str = None, locust_request_label: str = 'Tasks') → Dict[str, Any]

Retrieves all the available “tasks” and associated metadata from “Appian-Tempo-Tasks”

Note: All the retrieved data about tasks is stored in the private variable self._tasks

Returns (dict): List of tasks and associated metadata

Examples

>>> self.appian.task.get_all()
get_next_task_page_uri(get_default: bool = True) → Optional[str]

Retrieves the next URI in the sequence of Task pages being fetched using self.get_task_pages().

If the previous call to self.get_task_pages() reached the end of the available pages then this method will return either a value of None or the default initial page URI depending on the get_default argument.

Returns (str): The URI for the next page of Tasks (or the first page if the previous page fetches

reached the end).

get_task(task_name: str, exact_match: bool = True) → Dict[str, Any]

Get the information about specific task by name.

Parameters
  • task_name (str) – Name of the task

  • exact_match (bool) – Should task name match exactly or to be partial match. Default : True

Returns (dict): Specific task’s info

Raises: In case of task is not found in the system, it throws an “Exception”

Example

If full name of task is known,

>>> self.appian.task.get("task_name")

If only partial name is known,

>>> self.appian.task.get("task_name", exact_match=False)
get_task_pages(locust_request_label: str = 'Tasks', next_uri: Optional[str] = '/suite/api/feed/tempo?m=menu-tasks&t=t&s=pt&defaultFacets=%255Bstatus-open%255D', pages_requested: int = - 1) → Dict[str, Any]

Retrieves all the available “tasks” and associated metadata from “Appian-Tempo-Tasks”

If the next_uri argument is specified then the calls to fetch tasks will begin at that URI. If omitted the fetching starts at the first page of Tasks. This can be useful for fetching a subset of pages one call at a time. To control the number of pages fetched use the page_count argument. The default of -1 means fetch all pages (starting from the given URI.

Note: If the page_count is used and is less than the total number of pages available then the URI of the _next_ page in the sequence will be stored in self._next_uri and can be fetched with self.get_next_task_page_uri()

Note: All the retrieved data about tasks is stored in the private variable self._tasks

Returns (dict): List of tasks and associated metadata

Examples:

Start at the first page and get all content from that point forward:

>>> self.appian.task.get_task_pages()

Start at the next page (from the previous call to get_task_pages) and fetch the next three pages of Tasks:

>>> self.appian.task.get_task_pages(next_uri=self.get_next_task_page_uri(), pages_requested=3)
visit(task_name: str, exact_match: bool = True) → Dict[str, Any]

This function calls the API for the specific task to get its “form” data

Parameters
  • task_name (str) – Name of the task to be called.

  • exact_match (bool, optional) – Should task name match exactly or to be partial match. Default : True

Returns (dict): Response of task’s Get UI call in dictionary

Examples

If full name of task is known,

>>> self.appian.task.visit("task_name")

If only partial name is known,

>>> self.appian.task.visit("task_name", exact_match=False)
visit_and_get_form(task_name: str, exact_match: bool = True, locust_request_label: str = '')appian_locust.uiform.SailUiForm

Gets the SailUiForm given a task name

Parameters
  • task_name (str) – Name of the task to search for

  • exact_match (bool, optional) – Whether or not a full match is returned. Defaults to True.

  • locust_request_label (str, optional) – label to be used within locust

Returns

SAIL form for the task

Return type

SailUiForm