Build bots to share session details using Package SDK
A shared session enables you to reuse actions between TaskBots that run concurrently, for example, using the same Excel file to pass values.
Pré-requisitos
Ensure you have the following to build a TaskBot:
- Access to the Control Room
- Credentials with AAE_Basic permissions
- A development license, which enables you to create and run TaskBots
- Your workstation is a registered device in the Control Room
- An Excel file that you want to use in the shared session actions
Procedimento
- Log in to the Control Room.
- Create three TaskBots that will share the shared session actions.
- Create a new childSession2 variable of Type > Session and Session type > MS Excel session, select Use as input, and then click Apply.
-
No painel da esquerda, clique em Automation (Automação).
Uma lista de formulários e bots disponíveis é exibida.
- Click the Create a bot icon.
-
Create a new bot called childBot2.
- In the Name field, enter childBot2.
- In the Actions pane, find Excel Advanced, and drag Get current worksheet name to the Bot editor.
- In Session name > Shared session, enter F2 > childSession2, and in Assign the output to variable, select prompt-assignment.
- Create a new parentSession variable of Type > Session and Session type > MS Excel session, and then click Apply.
- Create a new bot called parentSession, and click Create & Edit.
-
In the Actions pane, find Excel Advanced, and drag
Open to the Bot editor.
- In File path, select Desktop file, click Browse, and navigate to the Excel file that you want to use.
- In Session name, retain Default.
- Click Save.
- Create a new childSession1 variable of Type > Session and Session type > MS Excel session, select Use as input, and then click Apply.
-
Create a new bot called childBot1.
- In the Name field, enter childBot1.
- In the Actions pane, find Excel Advanced, and drag Get single cell to the Bot editor.
- Select Active cell in Session name, and select Local name, enter F2, and then in Store cell content to, select prompt-assignment.
-
In the Actions pane, find Excel Advanced, and drag
Set session variable to the Bot editor.
- In Session name, retain Default.
- In Save session to a variable, select parentSession.
-
From the Actions pane, find Task Bot, and drag
Run to the Bot editor.
- In Task Bot to run, select Control Room file, click Choose, and then Browse, and select childBot1.
- In Input values, select Set childSession1, enter F2, and select parentSession.
- In the Actions pane, find Excel Advanced, and drag Close, select Session name as Local name, and retain Default.
- In the Actions pane, find Message box. In Enter the message to display, enter F2, and then select prompt-assignment.
-
From the Actions pane, select Task Bot, and drag
Run to the Bot editor.
- In Task Bot to run, select Control Room file, click Choose, and then Browse, and then select childBot2.
- In Input values, select Set childSession2, enter F2, and select childSession1.
- In the Actions pane, find Message box. In Enter the message to display, enter F2, and select prompt-assignment.
- Save all three bots and run the parentSession TaskBot.
Single cell value from parent bot:1
Current worksheet name of excel opened in parent bot: Sheet1 <name of the sheet>
Your bot has run successfully!