Skip to main content

Adding a New Command to Akinon

In the Akinon folder within the application, processes that communicate with the services required by Akinon’s Omnitron product are coded. If there is a need for improvement in the Omnitron services or processes for the sales channel being developed, the prepared structure here can be used.

If the existing processes and services do not meet the needs, you can add the new commands you have written to the channel_app_template.akinon.integration.OmnitronIntegration section by following the steps below.

  1. Creating a Command

    • To create a command, the class you create must inherit from OmnitronCommandInterface.

    • You need to create a class that inherits from OmnitronApiEndpoint for the endpoint to which the command will send requests and assign it to the endpoint property of the created command.

    • Optionally, if you want to send multiple requests through the OmnitronApiEndpoint you created, you can input the path property into the created command and make the necessary customizations.

    • Optionally, to specify the number of data items the command will process at one time, you can define a property named BATCH_SIZE and make the necessary customizations.

    • The content_type property is used to hold the data type that the command will process and to create more detailed logs in case of an error. You can check the assignable content_type in channel_app.omnitron.constants.ContentType.

  2. The created command should be added with a key (name) to the new_actions property within OmnitronIntegration.

  3. To invoke the command, refer to channel_app.channel.integration.ChannelIntegration.do_action example.