How to examples
This section contains code examples and explanations about how to code some basic bot capabilities.
- Return a value from an action
- Set the following properties on CommandPkg to store the action output in a variable.
- Expose an action as a property
- An action can be exposed as property if it does not accept any parameter. This can be done by setting the following properties on CommandPkg.
- Organize and group actions when developing packages
- Review the provided examples on how to add and group actions during the package SDK development process.
- Input types - UI elements
- The user interface (UI) elements are the input controls used to receive inputs in an action while building a bot.
- Create custom variables using Package SDK
- When using Automation 360, you can create custom variables using the SDK package.
- Create a condition using Package SDK
- When using Automation 360, you can create a condition with the SDK package.
- Add a condition in a custom package for If condition
- Add conditions in a custom package.
- Create an iterator using Package SDK
- In Automation 360, you can create an
iterator with the SDK package. An iterator is used to loop through multiple objects of
similar type and is used with the Loop package. It consists of
hasNext, which return the actual object and a boolean value.
- Create a trigger using Package SDK
- When using Automation 360, you can create a trigger using the SDK package.
- Custom triggers - pull and push mechanism
- The examples provided in this topic demonstrate
how to create time-based and event-based triggers, pull
(link TriggerDemo)and push
(SimpleMessageListenerContainer)mechanisms using the SDK package.
- Add debug logs of custom packages to bot_launcher.log file
- You can add logs using log4j. The dependency is already added in the package SDK sample build.gradle file.
- Handle sessions in a custom package
- You can extract a session using a session name from the SessionsMap. In the same package, you can use sessions to pass information between actions, but not to other packages.
- Configure shared session using Package SDK
- Package SDK provides configuration for the SDK users to create and use shared sessions. Sessions are seamlessly shared between different bots to share resources between them. This means that if a session has been created, the other TaskBots can read and update the session and vice versa.
- Create a bot to test the custom package
- A shared session enables you to reuse actions between TaskBots that run concurrently, for example, using the same Excel file to pass values.
Any action class supports only one method as an entry point. Annotate all parameters of the entry point method with Idx. There are three types of actions:
- Command\Action (default choice)
CAUTION: If you do not provide a public setter to member variables with Inject, compilation errors occur.