ADTF Plugin

Process Launcher Plugin


ADTF Process Launcher

Description

This package contains a service that allows external applications to start, control, monitor and read stdout and stderr over RPC.

Please have a look at Release Notes

Usage

The ADTF Process Launcher service needs to be embedded in an ADTF session. Once the session has been launched, it can be accessed through the ADTF RPC system (RPC Object Server Registry).

On the client side make use of the cProcessLauncher class:

C++ example

cProcessSessionServiceClient oService('http://localhost:8001');

auto pProcess = oService.LaunchSession('demo_data_and_time_triggered_filter.adtfsession', '$(ADTF_DIR)/src/examples/projects/adtf_example_project/adtfsessions/demo_standard_filters_session', 'http://localhost:8081');

REQUIRE_OK(pProcess->GetProcessControl()->Ping());

adtf::remote::rpc_object_client_ptr<adtf::remote::ISystem> pSystem;
pProcess->GetProcessControl()->GetObjectClient(adtf::remote::ISystem::DEFAULT_NAME, pSystem);
REQUIRE(pSystem->GetRunlevel() == tADTFRunLevel::RL_Running);
REQUIRE(pProcess->IsRunning());

std::this_thread::sleep_for(std::chrono::seconds(5));

REQUIRE_OK(pSystem->SetRunlevel(tADTFRunLevel::RL_Shutdown));

REQUIRE(pProcess->WaitForExit());

Scripting examples

This examples show the usage with ADTF Control within a bash script.

Note: Set ADTF Process Launcher property 'applications' to '$(ADTFDIR)/bin/adtflauncher.exe'

Launch and GetStdOut


adtf> rpc process_launcher Launch executable ipconfig arguments /all working_directory C:/
> 0

adtf>  rpc process_launcher GetStdOut process_id 0
>  Windows-IP-Konfiguration

   Hostname  . . . . . . . . . . . . : build
   Primäres DNS-Suffix . . . . . . . :
   Knotentyp . . . . . . . . . . . . : Hybrid
   IP-Routing aktiviert  . . . . . . : Nein
   WINS-Proxy aktiviert  . . . . . . : Nein
   DNS-Suffixsuchliste . . . . . . . : fritz.box

GetStdErr


adtf> rpc process_launcher Launch executable InvalidProcess arguments InvalidArgument working_directory C:/
2023-04-18 19:30:15 [DETAIL]: Start Process: 'InvalidProcess' InvalidArgument [process_launcher.cpp:62(cProcessLauncherService::cProcessRunner::cProcessRunner)]
4
adtf> rpc process_launcher GetStatus process_id 4
Result code '-38 '(ERR_FAILED) - exception: unable to create child process: 'InvalidProcess' InvalidArgument [exception_handling.h:159(adtf::ucom::kiwi::current_exception_to_result)]
 [process_launcher.cpp:161(cProcessLauncherService::cProcessRunner::GetStatus)]
 [adtfcontrol.cpp:3947(handle_command)]

Launch Session


adtf> rpc process_launcher Launch executable $(ADTF_DIR)/bin/adtf_launcher arguments '--session $(ADTF_DIR)/src/examples/projects/adtf_example_project/adtfsessions/demo_standard_filters_session/demo_data_and_time_triggered_filter.adtfsession --run' working_directory $(ADTF_DIR)
>  0

adtf> rpc process_launcher GetStatus process_id 0
>  true

adtf> rpc process_launcher Terminate wait 0
>  

adtf> rpc process_launcher IsRunning
>  false

License Information

Please make sure you have an active and valid subscription for this feature, the license key/file is set and the used license server is reachable (if required). For more information, please contact our support.

For any licence information have a look at LICENSE.

Furthermore please refer to Used Open Source Software for an overview of 3rd party packages we are glad to use.


Version:
1.0.0
Platform:
Linux ARMv8 Show all
ADTF version:
3.17.1
Visibility:
Public
Debug binaries:
yes
State:
verified
Company: Digitalwerk GmbH
License: Digitalwerk
Support: support@digitalwerk.net
Homepage: https://support.digitalwerk.net/
Issue Tracker: N/A
Downloads: 0
Size: 6.81 MB
Checksum (SHA-256):
12dc7b420e50484891357a9762cec198a21b6da31fd17ae189ad889fdc3d3888

info
Use this service to enable extended RPC access for external applications.