The following JOBI, UC4.RESOLVE_AGENT_GROUP.JOBI, allows one to set an agent group programmatically/dynamically.
See the updated version of this JOBI in the comment below.
To use the JOBI, just include a few lines in the process tab of the parent workflow of the jobs that will use this agent group:
:SET &AGENT_OR_AGENTGROUP# = "WINFT"
:SET &ACTUAL_TARGET_AGENT# = &AGENT#
This JOBI acts like a function:
&AGENT_OR_AGENTGROUP# —the name of anagent or an agent group.
&AGENT_OR_AGENTGROUP#contains the name of anagent, then this agent name (if it is active);
&AGENT_OR_AGENTGROUP#contains the name of anagent group, then the next active agent in that agent group.
Then simply insert
:PUT_ATT HOST = &ACTUAL_TARGET_AGENT#into the pre-process of any job that should run on the agent or agent group. (If the job is a file transfer job, put the attribute
FT_DST_HOSTinstead.) And again, this approach works whether
&AGENT_OR_AGENTGROUP#is set to the name of an agent or an agent group.