This chapter gives an introduction to the command meta of PAK.

1. Glossary

In the following a short glossary is given to clarify the terms used in this chapter.

Term Description

User Task

Describes a command that needs some kind of input from the user, e.g. click a button or choose an item from a list.

2. Command Meta Information

2.1. What is it

The command meta information is JSON file which contains relevant meta information of a Command implementation.

It contains

  • basic information such as name, id, interpreter, version etc.

  • documentation of the command functionality

  • information about the in- and outputs of a command

  • information about its interpreter

2.2. How is it created

The command meta file should be created by its corresponding Command Interpreter. So each of our existing Command Interpreters (Java, Html,Open-API) has the abilities to create CommandMetas and also to execute / interpret them.

The command meta files needs to be packed inside a somelibrary-pakmeta.jar which is basically a zip file which contains als command-meta json files. Here you can download a example of our generic commands package. Extract it as a zip-file and you will have a folder-structure which contains multiple command-meta json files

2.3. How is it used

It is used by multiple core components.

  • Command- Pool/Collector – to initialize the commands and their needed Command Interpreters for the engine

  • Command Interpreter – to map in- and outputs and to execute the command

  • Apps (Editor / Executor) – for building workflows / showing Documentation

3. Fields of Command Meta

The following fields can be defined by the command meta.

Field name Description Example

artifactGroup

Defines the artifact group where the command can be found

de.example.adapter.somekind

artifactName

Defines the artifact name where the command can be found.

somekind-adapter

deprecated

Flag to tell if the command is deprecated and should not be used anymore.

true or false

deprecatedDocu

Tells why the command is deprecated. This can be shown to workflow developers.

Command is deprecated as the api does not support this functionality anymore!

group

Human-readable group name. One maven module usually provides one command group. But this is no law.

Git / Generic / Jenkins / …​

id

Unique command id. Usually a fully qualified name analogous to Java classes.

de.asap.pak.adapter.gitak.commands.CheckModification

interpreter

Java class of the interpreter implementation that can execute this command.

de.asap.pak.jlcint.pakbridge.JavaInterpreter

major
minor
increment

Maven-style command version. Major version should be changed for API breaks, minor version for API enhancements and increment for all other changes (e.g. bugfixes).

1.0.0

mappings

List with datastore variables that are read/written. Including their scope and data type.

[{key = hasModifications,…​},{key = targetFolder,…​}]

name

Language independent name of the command

Git Clone

properties

Additional, interpreter specific properties.

Map of keys and property objects

services

List of services required by the command.

[de.asap.pak.adapter.gitak.IGitService]

userTask

Boolean flag to mark commands as user tasks.

true or false

workflowDocu

Additional documentation for the workflow developer.

This command clones a remote repository to a local target

4. Command Meta – Command Mappings

The command mappings are part of the command meta and contain more information on every datastore variable defined by a command. Some fields may not be present if their value was not set, e.g. in case no information is present to fill it with.

The following fields are defined for the command mapping.

Field name Description Example

allowedValues

A list of values that the variable is allowed to hold. Values not part of the allowed values are not accepted and should throw an exception. An empty list indicates that all values are allowed.

[], [ALL, NONE, A_PART_OF] or ["Yes","No","Maybe"]

defaultConstant

Default value of the variable for the case no value will be set in the context.

NOTE: This value is not set with Java Commands as the default value is derived from the initialized value in the command itself.

default://uri_to_repo

documentation

A description for the datastore variable to explain what it is for. Can be shown to a workflow developer.

“The URI is needed to know what instance to clone. Use only github URIs!”

group

The name of the group of the variable. Only one of the variables within the same group needs to be filled with a value.

Group_For_Uri_Inputs

key

Name of the datastore variable.

gitUri

mandatory

Flag that indicates if a value must exist in the datastore before executing the command.

true or false

pattern

A regex to check String values against. Only values that fulfill the regex are allowed.

^.+World$

patternExample

Examples of Strings allowed by the pattern. Used for user documentation so they know what is matched by the pattern.

HelloWorld, All Strings ending with World

scope

Determines whether the variable is to be read-only, written or both.

read, write or both

type

Data type of the variable.

string, boolean, integer, decimal, char, array or object

5. Command Meta – Required Services

Commands can require services to function. These services are also defined in the command meta and have the following property fields.

Field name Description Example

id

Fully qualified name of the class of the service

de.asap.pak.adapter.codebeamer.api.ICodebeamerAdapter

key

The datastore key if the service can be found in the datastore

SavedAdapter

optional

Flag to determine if the service is optional or required. False stands for required and is the default.

true or false

increment

Increment version of the service – increased on bug fix releases

10

major

Major version of the service – increased on non-backward compatible changes

1

minor

Minor version of the service – increased on api extensions

3

name

Custom name of the service

CanDoEverythingAdapter