Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 19 Next »

Due to various reasons it can happen that a task on a system ends up without any user available to process it. This may happen because roles / groups that define assignees to a task are empty or the assignees were deleted. The following script identifies these tasks and prints them out in a JSON format. It can be downloaded from the bottom of this page.

The script uses REST calls to communicate with the target system. If the target system returns an error status code, the error details will be printed on the command line.

Parameters

This script supports passing various parameters explained below.

The following four parameters are for connecting to the target system and are required to execute the script:

targetSystemIp (default: “localhost”)
IP address of the target system.

targetSystemPort (default: “8080”)
Port of the target system.

username (empty by default)
Name of the user who is authorized to perform the script's actions. In particular, this involves
the functional right MANAGE_PROCESSES.

password (empty by default)
Password of the provided user.

It is also possible to filter for specific processes with the following optional parameters:

processStates (default: [“RUNNING”])
Filter parameter to search for processes in specific states.
Parameter is a string array. Process query searches of processes which are in one of the folllowing states. If empty or null value is passed, this filter will be ignored and the query will filter for all available process states.

modelIds (not set by default)
Filter parameter to search for processes of specific models.
Parameter is a string array. Process query searches of processes which have one of the provided models. If empty, not set or null, this filter will be ignored and the query will filter for all available models.

projectId (not set by default)
Filter parameter to search for processes of a specific project. If empty, not set or null, this filter will be ignored and the query will filter for all available projects.

creatorId (not set by default)
Filter parameter to search for processes started by a specific user. If empty, not set or null, this filter will be ignored and the query will filter for all available creators.

Prerequisites

At first, the script will check if the target system identified by parameters targetSystemIp and targetSystemPort is reachable and running. After that, it will be checked if the provided credentials username and password are valid on that system and if the user has the required privilege MANAGE_PROCESSES.

If not, the script will terminate with an appropriate error message.

Example

An example call of the script with target system localhost:8080 (set by parameter’s default values):

.\SearchTasksWithoutUser_v1-2.ps1 -userName "roger" -password "rabbit" -modelIds "951049FDF8E14100BE7D810A2F018177", "951049FDF8E14100BE7D810A2F018177"

With this call, processes are filtered for running processes (set by default) and started by a model with one of the passed IDs.

Example output

[
    {
        "ActivityId":  "37D6BEE1BFE84ECE9E10BDA0D385AB6F",
        "ModelName":  "EmptyRole",
        "ModelId":  "951049FDF8E14100BE7D810A2F018177",
        "Link":  "http://localhost/app/management/index.html#/processdetails/7C854FEAF9CA4AD89FA5653A7E5CF072",
        "ProcessName":  "EmptyRole 218",
        "ProcessId":  "7C854FEAF9CA4AD89FA5653A7E5CF072",
        "Reason":  "Empty groups or roles.",
        "ActivityName":  "actWorkItem"
    },
    {
        "ActivityId":  "3D4BE4E4140D4275A93789C1155C5577",
        "ModelName":  "LoopFlow",
        "ModelId":  "39B5B353A90141C9B4751E07344D97B8",
        "Link":  "http://localhost/app/management/index.html#/processdetails/2CA098BD1F9E4E428F7969567D3E6758",
        "ProcessName":  "LoopFlow 2",
        "ProcessId":  "2CA098BD1F9E4E428F7969567D3E6758",
        "Reason":  "Performer does not exist.",
        "ActivityName":  "Start"
    }
]

Every JSON output element contains an attribute Reason stating the reason why this task has no users as well as some more attributes.

Script version history

Script Version

Date

Author

Description

Download

1.2

28th Nov 2023

A-Team

  • renamed parameter processState to processStates

  • If only one task can be found, it will still be printed out as a JSON array with one element. Before it was printed out as a single JSON element.

1.1

10th Nov 2023

A-Team

  • implemented check if core-service is reachable and running

  • implemented check if provided user credentials are correct and if user has privilege MANAGE_PROCESSES

1.0

24th Oct 2023

A-Team

-

Please note that this script is not a part of the product and is not officially supported.

It uses non-public REST API methods that may change without prior notice. This page will be updated in case of API changes, but the maintenance of the script and its derivatives in the field stays with its users.

  • No labels