Build bots to share session details using Package SDK

A shared session enables you to reuse actions between Task Bots that run concurrently, for example, using the same Excel file to pass values.

Prerequisites

Ensure you have the following to build a Task Bot:

  • Access to the Control Room
  • Credentials with AAE_Basic permissions
  • A development license, which enables you to create and run Task Bots
  • Your workstation is a registered device in the Control Room
  • An Excel file that you want to use in the shared session actions

Procedure

  1. Log in to the Control Room.
  2. Create three Task Bots that will share the shared session actions.
  3. Create a new childSession2 variable of Type > Session and Session type > MS Excel session, select Use as input, and then click Apply.
  4. On the left pane, click Automation.
    A list of available bots and forms is displayed.
  5. Click the Create a bot icon.
  6. Create a new bot called childBot2.
    1. In the Name field, enter childBot2.
    2. In the Actions pane, find Excel Advanced, and drag Get current worksheet name to the Bot editor.
    3. In Session name > Shared session, enter F2 > childSession2, and in Assign the output to variable, select prompt-assignment.
  7. Create a new parentSession variable of Type > Session and Session type > MS Excel session, and then click Apply.
  8. Create a new bot called parentSession, and click Create & Edit.
  9. In the Actions pane, find Excel Advanced, and drag Open to the Bot editor.
    1. In File path, select Desktop file, click Browse, and navigate to the Excel file that you want to use.
    2. In Session name, retain Default.
    3. Click Save.
  10. Create a new childSession1 variable of Type > Session and Session type > MS Excel session, select Use as input, and then click Apply.
  11. Create a new bot called childBot1.
    1. In the Name field, enter childBot1.
    2. In the Actions pane, find Excel Advanced, and drag Get single cell to the Bot editor.
    3. Select Active cell in Session name, and select Local name, enter F2, and then in Store cell content to, select prompt-assignment.
  12. In the Actions pane, find Excel Advanced, and drag Set session variable to the Bot editor.
    1. In Session name, retain Default.
    2. In Save session to a variable, select parentSession.
  13. From the Actions pane, find Task Bot, and drag Run to the Bot editor.
    1. In Task Bot to run, select Control Room file, click Choose, and then Browse, and select childBot1.
    2. In Input values, select Set childSession1, enter F2, and select parentSession.
  14. In the Actions pane, find Excel Advanced, and drag Close, select Session name as Local name, and retain Default.
  15. In the Actions pane, find Message box. In Enter the message to display, enter F2, and then select prompt-assignment.
  16. From the Actions pane, select Task Bot, and drag Run to the Bot editor.
    1. In Task Bot to run, select Control Room file, click Choose, and then Browse, and then select childBot2.
    2. In Input values, select Set childSession2, enter F2, and select childSession1.
  17. In the Actions pane, find Message box. In Enter the message to display, enter F2, and select prompt-assignment.
  18. Save all three bots and run the parentSession Task Bot.
The following three messages are displayed:

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!