Discussion
Lloyds Banking Group
GB
Last activity: 9 Dec 2015 11:54 EST
Configuring Button for agent stop / start
Is there a way to configure a button in an UI which will control an agent like stop/start without accessing SMA?
Regards,
Manash
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Pegasystems Inc.
SG
I don't think there is an OOTB way to do this. You may need to reach out to Pega support to see if such a functionality is accessible.
EAI Systems
US
Yes. It is possible to start or stop agent using a button in UI by invoking an activity which in turn invokes OOTB API to start or stop agents as mentioned below:
To start an agent:
boolean result = tools.getAgentUtils().startQueue(RulesetName, AgentIndex);
To stop an agent:
boolean result = tools.getAgentUtils().terminateQueue(RulesetName, AgentIndex);
RulesetName is the name of the agent ruleset. AgentIndex is index of specific agent in the Rule-Agent-Queue instance.
To get the Agent Index based on agent name perform below steps:
Open the Rule-Agent-Queue instance by Obj-Open using agent ruleset name as key.
Get the Agent index based on agent name as ( @(Pega-RULES:Utilities).IndexInPageList("AgentName" , "pyAgentName" , .pyFutureQueues)) - 1.
To start or stop all agents in an agent rule do not pass the agent index.
tools.getAgentUtils().startQueue(RulesetName)
tools.getAgentUtils().terminateQueue(RulesetName
Yes. It is possible to start or stop agent using a button in UI by invoking an activity which in turn invokes OOTB API to start or stop agents as mentioned below:
To start an agent:
boolean result = tools.getAgentUtils().startQueue(RulesetName, AgentIndex);
To stop an agent:
boolean result = tools.getAgentUtils().terminateQueue(RulesetName, AgentIndex);
RulesetName is the name of the agent ruleset. AgentIndex is index of specific agent in the Rule-Agent-Queue instance.
To get the Agent Index based on agent name perform below steps:
Open the Rule-Agent-Queue instance by Obj-Open using agent ruleset name as key.
Get the Agent index based on agent name as ( @(Pega-RULES:Utilities).IndexInPageList("AgentName" , "pyAgentName" , .pyFutureQueues)) - 1.
To start or stop all agents in an agent rule do not pass the agent index.
tools.getAgentUtils().startQueue(RulesetName)
tools.getAgentUtils().terminateQueue(RulesetName
It is advisable to create wrapper functions to start and stop agents which can take the Ruleset name and agent Index as input variables. The activity thus can invoke this wrapper functions rather than hard-coding the API invocation within the java step.
Wipro Ltd
AU
Arshad,
The activities where the parameters are "AgentIndex" are depricated now.
Instead of that, we can use the Agent Queue Name
To start an agent:
boolean result = tools.getAgentUtils().startQueue(RulesetName, QueueName);
To stop an agent:
boolean result = tools.getAgentUtils().terminateQueue(RulesetName, QueueName);
RulesetName is the name of the agent (key to the Rule-Agent-Queue record) to modify.
QueueName is the queue name.
Correct me if I am wrong
Phalanx Consultancy Limited
GB
That is really helpful. I will try this and let you know if I face any issue.
Wells Fargo
US
Curios to know the reason behind not able to access SMA. I definitely agree after seeing the solutions that it is possible but this reinventing of wheel is really necessary and aboslute for business to have?
I also agree its good to know how pega achieves these things which will help us in some difficult scenarios.
Thanks
Chiranjeevi
Phalanx Consultancy Limited
GB
Hi, accessing the SMA is not an issue. I am desiging a solution where I am planning to driving the agent execution on the click of a button. So wanted to know if at all it is possible.
Pegasystems Inc.
IN
>>> Hi, accessing the SMA is not an issue. I am desiging a solution where I am planning to driving the agent execution on the click of a button. So wanted to know if at all it is possible.
would the OOTB agents wizard be of help? please share your thoughts/comments.
DesignerStudio --> System --> Operations --> Agents
note: the wizard is added in Pega 7.