Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Version published after converting to the new editor

Processes can be started either automatically, manually, by another process or by custom code. To start processes by custom code the corresponding option of each process has to be set. The class /PCH/CL_BPF_START_ENGINE can be used the retrieve information about startable processes and to start them.
Use the following methods to get information, set, validate and finally start processes. Several phases have to be run through without the possibility of going back.

Method

Description

Initialization phase


GET_INSTANCE

Create an engine instance for an (optional) object. Use the start type /pch/if_bpf_constants=>c_start_type-api. An object representing the owner of the engine is necessary.

IS_MASTER_OWNER

Make sure to check if the instance is not owned by another object and release the engine immediately (using method FREE) to make sure your code is not breaking another implementation.

GET_VALID_PROCESSES

Retrieve a list of all valid processes. If a process can be started according its settings but is somehow erroneous it will still be available on the returned list but marked with the flag UNAVAILABLE and MSG.

GET_RUNNING_PROCESSES

Retrieve a list of all already running processes if the start engine has been requested for an object.

ADD_START_PROCESS

Add a process, which has to be started.

GET_START_PROCESSES

Retrieve a list of processes, which have been added to the processes to be started.

VALIDATE

Validate the processes to be started. Errors can occur because the start of one process can prevent others from starting.

Start phase


START

The processes to be started are validated and internally created but not yet saved.

GET_STARTED_PROCESSES

Retrieve a list of processes, which have been started internally but not yet saved.

Pre-save phase


SAVE

Processes are saved to the database and the necessary workflow events are triggered.

After-save phase


FREE

Make sure you release the engine using the owner object in any circumstances.

The following methods are phase independent:

Method

Description

INVALIDATE

Invalidates the valid and the running processes. Processes, which have been added to the start processes are kept but can lead into further errors because the list of valid and/or already running processes may change.

CANCEL

The processes to be started will be removed again.

RESET

Invalidates all the data including the running, valid and processes to be started (combination of INVALIDATE and CANCEL).

CHECK_DEPENDENCIES

This static method can be used the check how processes affect each other. All data (valid processes, running processes and process to be started) can be provided. By adding a process to be started to the list of the started processes, a check can be performed of how this process is affecting others.

...