diff --git a/TelosysTools/models/InfiniMotion/CommandRollback.entity b/TelosysTools/models/InfiniMotion/CommandRollback.entity new file mode 100644 index 0000000..1e0ced1 --- /dev/null +++ b/TelosysTools/models/InfiniMotion/CommandRollback.entity @@ -0,0 +1,4 @@ +#Command +@Extends(Command) +CommandRollback { +} diff --git a/TelosysTools/models/InfiniMotion/CommandRollbackResponse.entity b/TelosysTools/models/InfiniMotion/CommandRollbackResponse.entity new file mode 100644 index 0000000..34e842a --- /dev/null +++ b/TelosysTools/models/InfiniMotion/CommandRollbackResponse.entity @@ -0,0 +1,4 @@ +#Command +@Extends(Command) +CommandRollbackResponse { +} diff --git a/TelosysTools/models/InfiniMotion/CommandWrapper.entity b/TelosysTools/models/InfiniMotion/CommandWrapper.entity index 684a17d..253670b 100644 --- a/TelosysTools/models/InfiniMotion/CommandWrapper.entity +++ b/TelosysTools/models/InfiniMotion/CommandWrapper.entity @@ -1,6 +1,8 @@ #Command CommandWrapper { transaction: string { } ; // Random Transaction ID + commit: boolean { @PrimitiveType } ; + request: string {} ; // Random Request ID type: string {} ; // Command Type payload: binary {} ; diff --git a/TelosysTools/telosys-tools.cfg b/TelosysTools/telosys-tools.cfg index 221652b..389305c 100644 --- a/TelosysTools/telosys-tools.cfg +++ b/TelosysTools/telosys-tools.cfg @@ -22,7 +22,7 @@ ENTITY_PKG=de.infinimotion.model.bean ProjectVariable.MAVEN_ARTIFACT_ID=model ProjectVariable.MAVEN_GROUP_ID=de.infinimotion ProjectVariable.PROJECT_NAME=infinimodel -ProjectVariable.PROJECT_VERSION=0.0.44 +ProjectVariable.PROJECT_VERSION=0.0.54 ProjectVariable.REST_SERVER_PORT=3000 ProjectVariable.REST_API_ROOT=/api/v1 ProjectVariable.REST_URL_ROOT=http://localhost:3000 diff --git a/TelosysTools/templates/infinimotion/backend/command_entity_java.vm b/TelosysTools/templates/infinimotion/backend/command_entity_java.vm index fc46a8b..129ec0d 100644 --- a/TelosysTools/templates/infinimotion/backend/command_entity_java.vm +++ b/TelosysTools/templates/infinimotion/backend/command_entity_java.vm @@ -139,6 +139,17 @@ public#if( $entity.isAbstract() ) abstract#end class ${entity.name}#if( $entity. return this; } + public $entity.name tx(CommandWrapper wrapper) { + setTransaction(wrapper.getTransaction()); + setRequest(java.util.UUID.randomUUID().toString()); + return this; + } + + public $entity.name commit() { + setCommit(true); + return this; + } + public ${entity.name}(CommandWrapper wrapper) { this(); copyIds(wrapper); diff --git a/TelosysTools/templates/infinimotion/persistence/command_entity_java.vm b/TelosysTools/templates/infinimotion/persistence/command_entity_java.vm index 19aad86..89dcc0d 100644 --- a/TelosysTools/templates/infinimotion/persistence/command_entity_java.vm +++ b/TelosysTools/templates/infinimotion/persistence/command_entity_java.vm @@ -146,6 +146,18 @@ public#if( $entity.isAbstract() ) abstract#end class ${entity.name}#if( $entity. return this; } + + public $entity.name tx(CommandWrapper wrapper) { + setTransaction(wrapper.getTransaction()); + setRequest(java.util.UUID.randomUUID().toString()); + return this; + } + + public $entity.name commit() { + setCommit(true); + return this; + } + public ${entity.name}(CommandWrapper wrapper) { this(); copyIds(wrapper);