B4A.BASE.JOBI.RESOLVE-AGENTGROUP

Summary

Object type
JOBI
Object Folder
PACKAGES/BEST4AUTOMIC/B4A.BASE/SOURCE/SETTINGS
Title
Reads b4a settings for the specific platform
Archive Key 1
-
Archive Key 2
-
Created
WRITER/B4A am: 2022-03-24 08:01:45
Last Modified
WRITER/B4A am: 2024-01-09 10:09:56 14 x
Last Used
-

Description

This include is capable of resolving an agent group. If the given parameter points to an agent group it will be resolved. The resulting agent will be set if the calling object is a JOBS. If the agent group has already been resolved within the same workflow the chosen agent will be re-used

Parameter

$AGENT$
agent or agent group

Input

Output

&B4AB_AGENT_RESOLVED_O#
the agent resolved from the given agent group
&B4AB_PLATFORM_O#
The platform b4A is running on based on the selected agent

Example

    :include B4A.BASE.JOBI.RESOLVE_AGENTGROUP $AGENT$ = "<value>"

Process

:set &agent# = "$AGENT$"
:set &type# = get_object_type( &agent# )
:if &type# = "HOSTG"
:  set &B4AB_AGENT_RESOLVED_O# = "&B4AB_AGENT_RESOLVED_O#"
:  if &B4AB_AGENT_RESOLVED_O# <> ""
:    p "agent group has been resolved before. Reusing the agent &B4AB_AGENT_RESOLVED_O#."
:    set &B4AB_AGENT_O# = &B4AB_AGENT_RESOLVED_O#
:  else
:    set &hnd# = prep_process_agentgroup( &B4AB_AGENT_O# )
:    process &hnd#
:      set &B4AB_AGENT_O# = get_process_line( &hnd#, 1 )
:      term_process
:    endprocess
:    close_process &hnd#
:    set &B4AB_AGENT_RESOLVED_O# = &B4AB_AGENT_O#
:    publish &B4AB_AGENT_RESOLVED_O#, , WORKFLOW
:  endif
:else
:  set &B4AB_AGENT_O# = &agent#
:endif

:set &B4AB_PLATFORM_O# = get_var( "UC_HOST_JCL_VAR", "&B4AB_AGENT_O#", 1 )
:publish &B4AB_PLATFORM_O#, , TASK

Variable Publications

Found 1 variable publications (WORKFLOW)

Zeilennummer Scriptzeile
16 : publish &B4AB_AGENT_RESOLVED_O#, , WORKFLOW

Found 1 variable publications (TASK)

Zeilennummer Scriptzeile
23 :publish &B4AB_PLATFORM_O#, , TASK