Skip to content

Solved

The Solved endpoint is used when a Mate has solved a Task.

Details

When the Mate is finished working with a Task and it is Solved, then the Task becomes locked for future edits. The Task is in other words done, and what has happened up until this point is logged and can be retrived later by Employees if needed.

Solved takes a TaskAction objet as argument

    {
        "taskId" : 0,
        "reason" : "(optional) Reason for the move",
        "comment" : "(optional) Will create a comment together with the move",
        "overwriteSecondsSaved" : null,
        "overwriteEntries" : null
    }
  • TaskId: Required - Indicates which Task should be moved
  • Reason: Optional - While not mandatory, it is strongly recommend to give the Task a reason to inform the users why or in what context it was moved.
  • Comment: optional - Will let the Mate leave a Comment.
  • overwriteSecondsSaved: optional - Overwrites the Seconds Saved settings when logging KPI's for this task
  • overwriteEntries: optional - Overwrites the Entries settings when logging KPI's for this task
Use Comment to elaborate

We recommend using Comment together with the move, to elaborate on the reason and provide more information to the user as to what has happened and why the Mate did what it did. In case someone comes asking in the future, it is nice to have some data on what the Mate saw and did.

overwriteSecondsSaved and overwriteEntries is used to overwrite KPI's on the Task. It is the most common scenario that these are not included (undefined) or left as null. It typically only for advanced Mates where KPI's are followed more closely that these become relevant. If overwriteEntries is filled out, and overwriteSecondsSaved is left as null then Anymate will update the KPI's using the default settings for seconds saved pr. entry. If overwriteSecondsSaved is filled out, then that will be the value logged in the KPI's regardless of what overwriteEntries are (however amount of entries is always logged so it can still be relevant later when doing data analysis on the Mates performance). Click here to learn more about KPI's.

Example

The endpoint is found at https://{ClientId}.anymate.app/api/Solved/ The http-request must be submitted as a POST with JSON encoded data.

curl --request POST \
        --url https://{ClientId}.anymate.app/api/Solved/ \
        --header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IjgyQ0JGNDY3NEMyMUExRjBCMjhFNzlBNTk5MzAwQjdBIiwid.....' \
        --header 'Content-Type: application/json' \
        --data '{
        "taskId" : 1,
        "reason" : "(optional) Reason for the move",
        "comment" : "(optional) Will create a comment together with the move"
                }'

Using the Anymate .NET SDK, you simply call the Solved function in IAnymateService to solve the Task.

using Anymate;

// code omitted

//Initialize AnymateService
var anymateService = new AnymateService(client_id, client_secret, username, password);

//Create the Task Action
var action = new AnymateTaskAction()
{
    TaskId = taskId,
    Reason = "A reason",
    Comment = "A comment to elaborate on the action"       
};

//Call the Solved endpoint
var actionResponse = await anymateService.SolvedAsync(action);

Use the Action model to simplify your code

By using the AnymateTaskAction model, you can create the action once and then later in the code determine if the action should go to Solved, Manual, Error or Retry.

Using the Anymate Python SDK, simply invoke the solved function in anymate.client.

import anymate

# code omitted

# Initialize the client
client = anymate.client(client_id, api_secret, username, password)

# Invoke take_next, and get the task as a dict
task = client.take_next("myProcessKey")

# Read the TaskId of the new task
taskId = task['taskId']

# Business Logic omitted

# Move the Task
action_result = client.solved({'taskId': taskId,
                            'reason': 'A Reason',
                            'comment': "Comment describing what happened"})

solved takes a dictionary or object as input.

Using the Anymate UiPath SDK, simply invoke the Solved Task activity.

Solved Task alt >

AnymateClient and TaskId (as int64) are required input. Comment and Reason are optional, however we strongly recommend using them to take full advantage of Anymate.