website logo
⌘K
Explore our documentation
Contact APIANT support
What is APIANT?
Automation Editor
Key Concepts
Account Management
Managing Automations
App Connections
Building Automations
Alert Mappings
Troubleshooting
CRMConnect: Mindbody → HubSpot
CRMConnect: DonorPerfect → HubSpot
CRMConnect: DonorPerfect → ActiveCampaign
MailConnect: DonorPerfect → Mailchimp
ShopConnect
ShopConnect Settings
Sync Products
Manually sync Mindbody services/pricing options to Shopify
How to tag products in Shopify to prevent sync during sales sent to Mindbody
Retrying orders from Shopify → Mindbody
Manually pushing Mindbody orders to Shopify
Mindbody Pricing Discontinuation: Integration with Shopify
Guide to manually syncing Mindbody Packages with Shopify Products
Features that are not supported in ShopConnect
Automation Alert Reports
Linked Accounts
ZoomConnect
New features in version 4
Settings
General
Email & SMS
BOTs
MINDBODY
Zoom
ZoomConnect Mindbody Appointments - Setup and requirements
Troubleshooting
Assembly Editor
Key Concepts
Account Management
API Key Management
Managing Content
Building Assemblies
API Integrations
Other Assembly Types
Keyvalue Storage
Assembly development cycle
APIANT for Integrators
Help Forum
Automation Templates
Development Server
Module IDE
Shared App Connections
Tenants and Linked Accounts
APIANT Inline
Supported functionality
Embed Inline
Sandbox
Docs powered by
Archbee
APIANT for Integrators
Module IDE

Module Implementation

4min

This tab contains a code editor for editing and compiling the module's implementation:

Document image


Modules can have two code implementations: JavaScript for the browser and Java for the server. Not all modules will have a server-side Java implementation, but all modules must have a browser-side JavaScript implementation.

Module implementations make use of the Module API classes, whose implementations can be viewed in the Module Browser. The Module API allows most JavaScript and Java module implementations to be almost identical, with the Java implementations only needing type information, e.g. "int" instead of "var".

It is beyond the scope of this documentation to describe the Module API and coding details. Use the Module Browser to examine the code for the Module API classes which have inlined documentation, plus examine existing module implementations to learn boilerplate patterns for how modules work with input data and generate output.

At a high level, the general development cycle for a new module is as follows:

Begin by saving a copy of an existing module that closely does what is needed by the new module. Modify its Module Definition and optionally Module Settings until it has the needed inputs for its operation.

Focus first on the JavaScript implementation. Make needed code changes and test them in the assembly editor until confident the JavaScript is working as needed.

Test the JavaScript implementation by running a test assembly in the assembly editor. After you save the module, you can immediately run the test assembly. The editor immediately uses any JavaScript code changes that were made.

You can optionally run the assembly editor in debug mode to trace your code. Enable debug mode here:

Document image


Use the Show/Hide Debugger link at the top right of the editor to toggle the debug window:

Document image


Debug information appears as the assembly is executed. Use _debug(content) found in the _mixinBase class to write information into the debug window. If the content is an object the debug window will inspect that object and give you links to inspect the content within it.

After the module's JavaScript implementation is tested and working as needed, copy the method contents to the same methods in the Java implementation. Then convert all "var" definitions to the needed Java types. Use the Java compiler's error information to finish the conversion of the JavaScript code to Java.

Test the Java implementation by executing the test assembly on the server:



Document image


Leave debug information on so that any _debug() output or runtime errors will appear:



Document image


A new browser tab/window will open with the output from the execution on the server:

Document image


It is best to have an XML Viewer plugin installed in your browser so the output XML will be formatted for viewing.

You can refresh the output page after making Java code changes and saving the module, for quick test iterations.

Post to our Help Forum when you need help building new modules.

Updated 07 May 2023
Did this page help you?
PREVIOUS
Module Properties
NEXT
Module Browser
Docs powered by
Archbee
Docs powered by
Archbee