Introduction
This summary serves as a concise guide to the iComposer language. It provides a set of customization methods and utility classes to handle API calls, data processing, and transaction management.
For detailed usage and code examples of these methods and classes, see iComposer Language Reference Example or iComposer Language Reference Example file in your local project folder via IDE.
Customization Methods
The IComposerSystem class provides a suite of custom methods designed to streamline access to request and response data and facilitate the invocation of common services and SDKs. These methods enable developers to efficiently obtain information from HTTP requests, call service functions, utilize SDKs, and manage logs.
| Method | Description |
|---|---|
| debug() | Output debug logs using log4j. |
| error() | Output error logs using log4j. |
| executeFunction() | Execute specific service functions with method name and parameters. |
| executeRestful() | Execute RESTful API requests with specified parameters and request body. |
| getBean() | Retrieve a bean instance from the springContext with the bean name. |
| getCommonService() | Acquire the function of iComposer with the function name. |
| getICmpHttpServletRequest() | Acquire the request and request header from ServletHttpRequest. |
| getICmpHttpServletResponse() | Manage response and response header from ServletHttpResponse, facilitating efficient file export and stream outputs. |
| getRequestBody() | Obtain the request body from ServletHttpRequest. |
| getRequestParameter() | Obtain the request parameter from ServletHttpRequest. |
| getSDK() | Acquire the insuremo SDK instance with the name. |
| getUploadFiles() | Obtain the request files from ServletHttpRequest. |
| info() | Output info logs using log4j. |
| println() | Output logs on the online test UI without log4j. |
| warn() | Output warning logs using log4j. |
Utility Classes
The iComposer developer utility classes offer a comprehensive suite of powerful tools covering key development areas such as data processing, application context management, file operations, and API calls. These classes are designed to streamline development by providing ready-to-use implementations, solving common programming challenges, and reducing repetitive code.
| Class Name | Description |
|---|---|
| IComposerAppContext | Offers utilities related to the application context, such as retrieving the tenant code and current user details. |
| IComposerAssert | Performs condition validation in code, throwing a BusinessException if validation fails. |
| IComposerBeanUtils | Provides methods for getting/setting property values, copying properties between objects, and accessing bean properties through reflection. |
| IComposerDateContext | Provides a utility method to get the current user’s local date and time. |
| IComposerDbDataUtils | Provides a utility method to handle the dynamic storage data of IComposer. |
| IComposerDataAccessorUtils | Provides methods for database operations such as querying, inserting, updating, deleting, and paginated queries using the iComposer data access framework. |
| IComposerEnv | A wrapper around the Env class to retrieve configuration parameters by key. |
| IComposerExceptionUtils | Provides static methods for exception handling, parsing, and conversion operations, serving as a wrapper around ExceptionUtils with additional functionality for handling iComposer-specific exceptions. |
| IComposerExecutorUtils | Provides methods for executing functions with different transaction strategies, including asynchronous execution and transaction management. |
| IComposerFileUtils | Handles file operations for CSV and Excel files, including reading/writing files and streams. |
| IComposerFunctionUtils | Provides a generic way to dynamically invoke methods on service objects that implement the GroovyExecutorInterface. |
| IComposerGlobalTxContext | Manages global transaction contexts, binding transaction IDs, and registering synchronization callbacks for distributed transactions. |
| IComposerIntegrationAdapter | Prepares and sends integration requests to external providers. |
| IComposerJsonUtils | Extends GroovyRestfulJacksonUtils to provide JSON utility methods for serialization and deserialization. |
| IComposerLoggingUtils | Provides comprehensive logging utilities for request/response logging, business log management, and log data encryption. |
| IComposerMessageUtils | Provides methods for message handling, including adding messages to thread context, formatting messages, and managing message lists. |
| IComposerMultiTablesUtils | Provides data access operations across multiple tables, including insert, update, delete, and query operations with table enumeration support. |
| IComposerPdfUtils | Handling PDF files and providing methods to create, read, merge, split, extract pages, add text, and retrieve page counts. |
| IComposerRestTemplateManager | Manages different RestTemplate beans for various types of service calls. |
| IComposerRestfulLocalExecutor | Provides a convenient way to execute RESTful API requests locally, efficiently making API calls and handling responses to enhance the efficiency of development and testing. |
| IComposerSftpClient | Provides a unified SFTP client for file operations including upload, download, delete, rename, and directory management. |
| IComposerSslConnectionUtils | Creates RestTemplate instances with SSL configuration and connection pooling for secure HTTP communications. |
| IComposerTransactionUtils | Prepares and processes transaction data to ensure proper formatting and handling of transaction information. |
| IComposerLocalCacheUtils | Manages local cache operations with methods to set, get, and retrieve cached beans via GroovyRestfulCacheService. |
| IComposerLocalDateTimeUtils | Facilitates conversion between LocalDateTime and other date formats, and parses date strings. |
| IComposerLockUtils | Manages distributed locks with methods to acquire, release, and check lock status. |
| IComposerNumberUtils | Safely converts various numeric types to BigDecimal, supporting types like BigDecimal, String, Long, Integer, Double, Float, Short, BigInteger, and other Number subclasses. |
| IComposerPrimaryKeyUtils | Used for generating sequence IDs, it provides methods to retrieve primary keys from a sequence. |
| IComposerRatingExecutorUtils | Executes rating calculations with specified rating codes and input data for insurance business logic. |
| IComposerRuleV2ExecutorUtils | Executes domain rules using Rule Engine V2 with various configuration options for rule execution. |
| IComposerZipFileUtils | Provides comprehensive ZIP file operations including compression, decompression, and file handling with Base64 encoding support. |
| IComposerProductSdkUtils | Static utility wrapping ProductClientService for product and product element queries; returns domain objects as Maps. |
| IComposerTableSdkUtils | Single-table SDK wrapper for RateTable / DataTable / CodeTable / ConfigTable lookup, one table per call. |
| IComposerHooksUtils | Resource registry and ServiceFunction invocation helpers, plus TCC prepare-phase dispatch via the platform IComposerTccDispatcherService. |
| IComposerEventBridgeUtils | Builder-based event publisher backed by the platform EventPutService; required fields: source / type / eventBusName. |
| BadRequestException | A custom exception class for handling bad request scenarios, offering constructors with various parameters. |
| BusinessException | A custom exception class for handling business-related exceptions, providing constructors with various parameters. |
| SystemError | A custom exception class for handling system-related errors, offering constructors with various parameters. |
Specification Query Classes
The com.insuremo.icomposer.specifications package provides a fluent DSL for building Spring Data JPA Specification<T> predicates against the dynamic entity tables exposed by IComposerDataAccessorUtils.
| Class Name | Description |
|---|---|
| IComposerQuery | Abstract specification factory for the standard index fields (id, entityName, modelType, modelName, uniqueIndex, indexString1-2, indexDate1-4) of dynamic entity tables. Obtain an instance via IComposerDataAccessorUtils.getNewIComposerQuery(table). |
| IComposerQueryBuilder | Static combiner for Specification<T> (.where(), .and(), .or()); implements Specification<T> so the result can be passed directly to IComposerDataAccessorUtils.findAll / pagedQuery. |
| IComposerEntity01..20Query | Concrete subclasses of IComposerQuery for the 20 dynamic entity tables (entity_01 .. entity_20). The method surface is identical to IComposerQuery; only the bound table differs. |
Third-Party Packages
The iComposer language currently relies on the following third-party packages.
| Library | Version |
|---|---|
| spring-batch-core | 4.3.7 |
| spring-webflux | 5.3.39 |
| reactor-core | 3.4.30 |
| reactive-streams | 1.0.3 |
| spring-webmvc | 5.3.39 |
| spring-aop | 5.3.39 |
| spring-beans | 5.3.39 |
| spring-context | 5.3.39 |
| spring-core | 5.3.39 |
| spring-web | 5.3.39 |
| commons-lang3 | 3.8.1 |
| commons-collections4 | 4.1 |
| poi-ooxml | 4.1.2 |
| poi | 4.1.2 |
| commons-math | 2.2 |
| commons-csv | 1.6 |
| commons-fileupload | 1.5 |
| icomposer-domain | 25.01.193 |