powered by ASAP

Java command annotations are used for the developing Java commands in PAK. This chapter describes the functionality of the @Run annotation. It also gives an example of how you can use this annotation in your implementation.

1. Basics

The @Run annotation marks the entry method of a command and contains its business logic. Each command class should use this annotation exactly once. The method annotated with @Run has to have a public modifier and void as return type.

The name of the @Run method must not collide with the getter name of a class field. For further information please refer to the @Persistent documentation.

2. Usage

In the following Listing 1 in line 10 the @Run annotation is used.

Listing 1. Example usage of @Run
/**
 * @workflowDocu This command gets an element by its id.
 */
@JavaCommand
@CommandGroup("Element")
public class GetElement {

	[...]

	/**
	 * Fetch the element with a given name.
	 */
	@Run (1)
	public void fetchElement() {
		// Implement functionality of the command here
		[...]
	}
}
1 Use of the @Run annotation