Java Command Processing
Table of Contents
The processing of commands plays a vital role in PAK. It’s required for defining commands. This chapter will offer an quick overview on
how to define commands, using the two notation-styles in PAK.
1. Basics
-
The class-based processing of commands follows a code-template to define commands:
Listing 1. Example command on class-level
/**
* @workflowDocu This command gets an element by its id.
*/
@JavaCommand
@CommandGroup("Element")
public class GetElement {
[..]
}
-
The method-based approach is used to extend already existing code and turn the methods into commands. But here it is important
to also use@JavaCommandService
on class-level.
Listing 2. Example command on method-level
@JavaCommandService
public class CommandClass {
[...]
// Will be turned into a command
public String myCommand1(String myReadVariable1, String myReadVariable2) {
return myReadVariable1 + myReadVariable2;
}
}
Last updated 2024-12-19 10:07:55 +0100