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.
Creating a Command
To create a command, the
classyou create must inherit fromOmnitronCommandInterface.You need to create a
classthat inherits fromOmnitronApiEndpointfor the endpoint to which the command will send requests and assign it to theendpointproperty of the created command.Optionally, if you want to send multiple requests through the
OmnitronApiEndpointyou created, you can input thepathproperty 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_SIZEand make the necessary customizations.The
content_typeproperty 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 assignablecontent_typeinchannel_app.omnitron.constants.ContentType.
The created command should be added with a key (name) to the
new_actionsproperty withinOmnitronIntegration.To invoke the command, refer to
channel_app.channel.integration.ChannelIntegration.do_actionexample.
Was this helpful?

