iComposer & AI
iComposer
iComposer Language Ref Summary
Sidebar On this page

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.

MethodDescription
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 NameDescription
IComposerAppContextOffers utilities related to the application context, such as retrieving the tenant code and current user details.
IComposerAssertPerforms condition validation in code, throwing a BusinessException if validation fails.
IComposerBeanUtilsProvides methods for getting/setting property values, copying properties between objects, and accessing bean properties through reflection.
IComposerDateContextProvides a utility method to get the current user’s local date and time.
IComposerDbDataUtilsProvides a utility method to handle the dynamic storage data of IComposer.
IComposerDataAccessorUtilsProvides methods for database operations such as querying, inserting, updating, deleting, and paginated queries using the iComposer data access framework.
IComposerEnvA wrapper around the Env class to retrieve configuration parameters by key.
IComposerExceptionUtilsProvides static methods for exception handling, parsing, and conversion operations, serving as a wrapper around ExceptionUtils with additional functionality for handling iComposer-specific exceptions.
IComposerExecutorUtilsProvides methods for executing functions with different transaction strategies, including asynchronous execution and transaction management.
IComposerFileUtilsHandles file operations for CSV and Excel files, including reading/writing files and streams.
IComposerFunctionUtilsProvides a generic way to dynamically invoke methods on service objects that implement the GroovyExecutorInterface.
IComposerGlobalTxContextManages global transaction contexts, binding transaction IDs, and registering synchronization callbacks for distributed transactions.
IComposerIntegrationAdapterPrepares and sends integration requests to external providers.
IComposerJsonUtilsExtends GroovyRestfulJacksonUtils to provide JSON utility methods for serialization and deserialization.
IComposerLoggingUtilsProvides comprehensive logging utilities for request/response logging, business log management, and log data encryption.
IComposerMessageUtilsProvides methods for message handling, including adding messages to thread context, formatting messages, and managing message lists.
IComposerMultiTablesUtilsProvides data access operations across multiple tables, including insert, update, delete, and query operations with table enumeration support.
IComposerPdfUtilsHandling PDF files and providing methods to create, read, merge, split, extract pages, add text, and retrieve page counts.
IComposerRestTemplateManagerManages different RestTemplate beans for various types of service calls.
IComposerRestfulLocalExecutorProvides a convenient way to execute RESTful API requests locally, efficiently making API calls and handling responses to enhance the efficiency of development and testing.
IComposerSftpClientProvides a unified SFTP client for file operations including upload, download, delete, rename, and directory management.
IComposerSslConnectionUtilsCreates RestTemplate instances with SSL configuration and connection pooling for secure HTTP communications.
IComposerTransactionUtilsPrepares and processes transaction data to ensure proper formatting and handling of transaction information.
IComposerLocalCacheUtilsManages local cache operations with methods to set, get, and retrieve cached beans via GroovyRestfulCacheService.
IComposerLocalDateTimeUtilsFacilitates conversion between LocalDateTime and other date formats, and parses date strings.
IComposerLockUtilsManages distributed locks with methods to acquire, release, and check lock status.
IComposerNumberUtilsSafely converts various numeric types to BigDecimal, supporting types like BigDecimal, String, Long, Integer, Double, Float, Short, BigInteger, and other Number subclasses.
IComposerPrimaryKeyUtilsUsed for generating sequence IDs, it provides methods to retrieve primary keys from a sequence.
IComposerRatingExecutorUtilsExecutes rating calculations with specified rating codes and input data for insurance business logic.
IComposerRuleV2ExecutorUtilsExecutes domain rules using Rule Engine V2 with various configuration options for rule execution.
IComposerZipFileUtilsProvides comprehensive ZIP file operations including compression, decompression, and file handling with Base64 encoding support.
IComposerProductSdkUtilsStatic utility wrapping ProductClientService for product and product element queries; returns domain objects as Maps.
IComposerTableSdkUtilsSingle-table SDK wrapper for RateTable / DataTable / CodeTable / ConfigTable lookup, one table per call.
IComposerHooksUtilsResource registry and ServiceFunction invocation helpers, plus TCC prepare-phase dispatch via the platform IComposerTccDispatcherService.
IComposerEventBridgeUtilsBuilder-based event publisher backed by the platform EventPutService; required fields: source / type / eventBusName.
BadRequestExceptionA custom exception class for handling bad request scenarios, offering constructors with various parameters.
BusinessExceptionA custom exception class for handling business-related exceptions, providing constructors with various parameters.
SystemErrorA 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 NameDescription
IComposerQueryAbstract 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).
IComposerQueryBuilderStatic combiner for Specification<T> (.where(), .and(), .or()); implements Specification<T> so the result can be passed directly to IComposerDataAccessorUtils.findAll / pagedQuery.
IComposerEntity01..20QueryConcrete 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.

LibraryVersion
spring-batch-core4.3.7
spring-webflux5.3.39
reactor-core3.4.30
reactive-streams1.0.3
spring-webmvc5.3.39
spring-aop5.3.39
spring-beans5.3.39
spring-context5.3.39
spring-core5.3.39
spring-web5.3.39
commons-lang33.8.1
commons-collections44.1
poi-ooxml4.1.2
poi4.1.2
commons-math2.2
commons-csv1.6
commons-fileupload1.5
icomposer-domain25.01.193

Feedback
Was this page helpful?
|
Provide feedback