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 6 Next »

Due to various reasons it can happen that a task on a system ends up without any user assigned to it. This may be because roles / groups that define assignees to a task are empty or the assignees were deleted. This script provided here identifies these tasks and print them out in JSON format.

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
Name of the user who is authorized to perform the script's actions. In particular, this involves
the functional right MANAGE_PROCESSES.

password
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 of the 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.

projectId (not set by default)
Filter parameter to search for processes of a specific project.

creatorId (not set by default)
Filter parameter to search for processes started by a specific user.

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.ps1 -userName "roger" -password "rabbit" -modelIds "951049FDF8E14100BE7D810A2F018177", "951049FDF8E14100BE7D810A2F018177"

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

Compatible core-service version

Author

Description

Download

1.0

28th Nov 2023

<= 9.4

A-Team

-

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

It utilizes 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