Package SDK 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 property attributes of action
The property values of an action can be exposed 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 two methods, next and hasNext, which return the actual object and a boolean value.
Create a custom trigger (Example 2)
The example shows how to create a trigger in Automation 360 that allows you to create tasks that will be executed at specified intervals.
Create a custom trigger (Example 3)
The example shows how to create an event-based trigger (SimpleMessageListenerContainer) using the Package SDK.
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 Task Bots 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 Task Bots that run concurrently, for example, using the same Excel file to pass values.
Actions
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)
  • Iterator
  • Condition
Important: If you do not provide a public setter to member variables with Inject, compilation errors occur.