Develop your own custom command

The ability to invoke custom code provides the greatest flexibility in exchange for great responsibility. Keep in mind the multiple restrictions of the underlying hardware and security requirements.
 IMPORTANT: The developer of a custom command is in charge of implementing the required security restrictions and of ensuring adherence to the stability requirements! Review the predefined commands before you start a custom command development! 

To simplify development and to improve code quality, the BCloudCustomCommand allows Tridium to enforce certain security needs including auditing, permission checking, etc.

To develop your own custom command:

  • Extend the BCloudCustomCommand class.
  • Override the runCommand method to implement the required command behavior.
  • Create a unique command name and register it.

Custom commands introduce an additional high security risk for the customer (customers do not really know what will be executed on their stations). To mitigate this risk, the system disables the execution of custom commands by default. 

The BCloudCustomCommand provides a separate flag to enable and disable of this functionality.

Some important requirements

  • Do not start additional threads in your custom command. A custom command is not expected to be multi-threaded!
  • Catch InterruptedExceptions in your custom command code. This exception means that your command should stop execution and exit. There are multiple reasons why the framework can send this exception to your code, but you have to follow this rule.
ACTIONS: Develop your own command module

Create your own module with a custom command by extending the BCloudCustomCommand class.

Install your module in a station.

Invoke your own command using your own command ID.