Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v3.1.0 #102

Merged
merged 14 commits into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -329,4 +329,6 @@ Temporary Items
###################################

# VSCode
.vscode
.vscode
protobuf/src/main/proto/gov/hhs/aspr/ms/taskit/protobuf
protobuf/src/main/proto/google
20 changes: 10 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

<!-- Properties -->
<properties>
<revision>3.0.0</revision>
<revision>3.1.0</revision>

<!-- basic project properties -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand All @@ -59,19 +59,19 @@

<!-- standard plugins versions -->
<flatten-maven-plugin.version>1.6.0</flatten-maven-plugin.version>
<maven-surefire-plugin.version>3.4.0</maven-surefire-plugin.version>
<maven-failsafe-plugin.version>3.4.0</maven-failsafe-plugin.version>
<maven-surefire-plugin.version>3.5.2</maven-surefire-plugin.version>
<maven-failsafe-plugin.version>3.5.2</maven-failsafe-plugin.version>
<maven-source-plugin.version>3.3.1</maven-source-plugin.version>
<maven-install-plugin.version>3.1.2</maven-install-plugin.version>
<maven-deploy-plugin.version>3.1.2</maven-deploy-plugin.version>
<maven-javadoc-plugin.version>3.8.0</maven-javadoc-plugin.version>
<maven-gpg-plugin.version>3.2.5</maven-gpg-plugin.version>
<central-publishing-maven-plugin.version>0.5.0</central-publishing-maven-plugin.version>
<maven-install-plugin.version>3.1.3</maven-install-plugin.version>
<maven-deploy-plugin.version>3.1.3</maven-deploy-plugin.version>
<maven-javadoc-plugin.version>3.11.2</maven-javadoc-plugin.version>
<maven-gpg-plugin.version>3.2.7</maven-gpg-plugin.version>
<central-publishing-maven-plugin.version>0.7.0</central-publishing-maven-plugin.version>

<!-- dependency versions -->
<gcm.version>4.3.0</gcm.version>
<gcm.version>4.4.0</gcm.version>
<jacoco-maven-plugin.version>0.8.12</jacoco-maven-plugin.version>
<junit-jupiter-engine.version>5.11.0</junit-jupiter-engine.version>
<junit-jupiter-engine.version>5.11.4</junit-jupiter-engine.version>
</properties>

<dependencyManagement>
Expand Down
9 changes: 5 additions & 4 deletions protobuf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
<properties>
<!-- protobuf specific plugins versions -->
<os-maven-plugin.version>1.7.1</os-maven-plugin.version>
<maven-dependency-plugin.version>3.7.1</maven-dependency-plugin.version>
<maven-dependency-plugin.version>3.8.1</maven-dependency-plugin.version>
<build-helper-maven-plugin.version>3.6.0</build-helper-maven-plugin.version>
<protobuf-maven-plugin.version>0.6.1</protobuf-maven-plugin.version>
<maven-replacer-plugin.version>1.4.1</maven-replacer-plugin.version>

<!-- dependency versions -->
<protoc.version>3.25.3</protoc.version>
<protoc.version>3.25.6</protoc.version>
</properties>

<!-- Dependencies -->
Expand Down Expand Up @@ -94,7 +94,7 @@
<configuration>
<includes>**/*.proto</includes>
<excludes>**/testsupport/*.proto</excludes>
<outputDirectory>${project.build.outputDirectory}</outputDirectory>
<outputDirectory>${basedir}/src/main/proto</outputDirectory>
<includeArtifactIds>protobuf</includeArtifactIds>
<includeTypes>jar</includeTypes>
</configuration>
Expand Down Expand Up @@ -140,7 +140,8 @@
<protocArtifact>com.google.protobuf:protoc:${protoc.version}:exe:${os.detected.classifier}</protocArtifact>
<protoSourceRoot>${basedir}/src/main/proto/gov/hhs/aspr/ms/gcm/taskit/protobuf</protoSourceRoot>
<additionalProtoPathElements>
<additionalProtoPathElement>${project.build.outputDirectory}</additionalProtoPathElement>
<additionalProtoPathElement>${basedir}/src/main/proto/gov/hhs/aspr/ms/taskit/protobuf</additionalProtoPathElement>
<additionalProtoPathElement>${basedir}/src/main/proto/google</additionalProtoPathElement>
</additionalProtoPathElements>
<attachProtoSources>false</attachProtoSources>
</configuration>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import java.util.List;

import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.globalproperties.translation.specs.GlobalPropertiesPluginDataTranslationSpec;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.globalproperties.translation.specs.GlobalPropertyDimensionTranslationSpec;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.globalproperties.translation.specs.GlobalPropertyDimensionDataTranslationSpec;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.globalproperties.translation.specs.GlobalPropertyIdTranslationSpec;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.globalproperties.translation.specs.GlobalPropertyReportPluginDataTranslationSpec;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.globalproperties.translation.specs.TestGlobalPropertyIdTranslationSpec;
Expand All @@ -29,7 +29,7 @@ private GlobalPropertiesTranslator() {

list.add(new GlobalPropertiesPluginDataTranslationSpec());
list.add(new GlobalPropertyIdTranslationSpec());
list.add(new GlobalPropertyDimensionTranslationSpec());
list.add(new GlobalPropertyDimensionDataTranslationSpec());
list.add(new TestGlobalPropertyIdTranslationSpec());
list.add(new GlobalPropertyReportPluginDataTranslationSpec());

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
package gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.globalproperties.translation.specs;

import gov.hhs.aspr.ms.gcm.simulation.plugins.globalproperties.support.GlobalPropertyDimensionData;
import gov.hhs.aspr.ms.gcm.simulation.plugins.globalproperties.support.GlobalPropertyId;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.nucleus.input.DimensionSingleValueInput;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.globalproperties.support.input.GlobalPropertyDimensionDataInput;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.globalproperties.support.input.GlobalPropertyIdInput;
import gov.hhs.aspr.ms.taskit.protobuf.engine.TaskitObjectHelper;
import gov.hhs.aspr.ms.taskit.protobuf.objects.TaskitObjectInput;
import gov.hhs.aspr.ms.taskit.protobuf.translation.ProtobufTranslationSpec;

public class GlobalPropertyDimensionDataTranslationSpec
extends ProtobufTranslationSpec<GlobalPropertyDimensionDataInput, GlobalPropertyDimensionData> {

@Override
protected GlobalPropertyDimensionData translateInputObject(GlobalPropertyDimensionDataInput inputObject) {
GlobalPropertyDimensionData.Builder builder = GlobalPropertyDimensionData.builder();

GlobalPropertyId globalPropertyId = this.taskitEngine.translateObject(inputObject.getGlobalPropertyId());

builder.setGlobalPropertyId(globalPropertyId).setAssignmentTime(inputObject.getAssignmentTime());

for (DimensionSingleValueInput dimDataInput : inputObject.getValuesList()) {
String levelName = dimDataInput.getLevelName();
Object value = TaskitObjectHelper.getValue(dimDataInput.getValue());

builder.addValue(levelName, value);
}

return builder.build();
}

@Override
protected GlobalPropertyDimensionDataInput translateAppObject(GlobalPropertyDimensionData appObject) {
GlobalPropertyDimensionDataInput.Builder builder = GlobalPropertyDimensionDataInput.newBuilder();

GlobalPropertyIdInput globalPropertyIdInput = this.taskitEngine
.translateObjectAsClassSafe(appObject.getGlobalPropertyId(), GlobalPropertyId.class);

builder.setGlobalPropertyId(globalPropertyIdInput).setAssignmentTime(appObject.getAssignmentTime());

for (String levelName : appObject.getLevelNames()) {
int level = appObject.getLevel(levelName);
Object value = appObject.getValue(level);

TaskitObjectInput inValue = TaskitObjectHelper.getTaskitObjectInput(value, taskitEngine);

DimensionSingleValueInput dimInput = DimensionSingleValueInput.newBuilder()
.setLevelName(levelName)
.setValue(inValue)
.build();

builder.addValues(dimInput);
}

return builder.build();
}

@Override
public Class<GlobalPropertyDimensionData> getAppObjectClass() {
return GlobalPropertyDimensionData.class;
}

@Override
public Class<GlobalPropertyDimensionDataInput> getInputObjectClass() {
return GlobalPropertyDimensionDataInput.class;
}

}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,58 +1,71 @@
package gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.translation.specs;

import com.google.protobuf.Any;

import gov.hhs.aspr.ms.gcm.simulation.plugins.groups.support.GroupId;
import gov.hhs.aspr.ms.gcm.simulation.plugins.groups.support.GroupPropertyDimension;
import gov.hhs.aspr.ms.gcm.simulation.plugins.groups.support.GroupPropertyDimensionData;
import gov.hhs.aspr.ms.gcm.simulation.plugins.groups.support.GroupPropertyId;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.support.input.GroupPropertyDimensionInput;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.nucleus.input.DimensionSingleValueInput;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.support.input.GroupPropertyDimensionDataInput;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.support.input.GroupPropertyIdInput;
import gov.hhs.aspr.ms.taskit.protobuf.engine.TaskitObjectHelper;
import gov.hhs.aspr.ms.taskit.protobuf.objects.TaskitObjectInput;
import gov.hhs.aspr.ms.taskit.protobuf.translation.ProtobufTranslationSpec;

public class GroupPropertyDimensionTranslationSpec
extends ProtobufTranslationSpec<GroupPropertyDimensionInput, GroupPropertyDimension> {
extends ProtobufTranslationSpec<GroupPropertyDimensionDataInput, GroupPropertyDimensionData> {

@Override
protected GroupPropertyDimension translateInputObject(GroupPropertyDimensionInput inputObject) {
GroupPropertyDimension.Builder builder = GroupPropertyDimension.builder();
protected GroupPropertyDimensionData translateInputObject(GroupPropertyDimensionDataInput inputObject) {
GroupPropertyDimensionData.Builder builder = GroupPropertyDimensionData.builder();

GroupPropertyId globalPropertyId = this.taskitEngine.translateObject(inputObject.getGroupPropertyId());
GroupId groupId = new GroupId(inputObject.getGId());

builder.setGroupPropertyId(globalPropertyId).setGroupId(groupId);

for (Any anyValue : inputObject.getValuesList()) {
Object value = this.taskitEngine.getObjectFromAny(anyValue);
builder.addValue(value);
for (DimensionSingleValueInput dimDataInput : inputObject.getValuesList()) {
String levelName = dimDataInput.getLevelName();
Object value = TaskitObjectHelper.getValue(dimDataInput.getValue());

builder.addValue(levelName, value);
}

return builder.build();
}

@Override
protected GroupPropertyDimensionInput translateAppObject(GroupPropertyDimension appObject) {
GroupPropertyDimensionInput.Builder builder = GroupPropertyDimensionInput.newBuilder();
protected GroupPropertyDimensionDataInput translateAppObject(GroupPropertyDimensionData appObject) {
GroupPropertyDimensionDataInput.Builder builder = GroupPropertyDimensionDataInput.newBuilder();

GroupPropertyIdInput globalPropertyIdInput = this.taskitEngine
.translateObjectAsClassSafe(appObject.getGroupPropertyId(), GroupPropertyId.class);

builder.setGroupPropertyId(globalPropertyIdInput).setGId(appObject.getGroupId().getValue());

for (Object objValue : appObject.getValues()) {
builder.addValues(this.taskitEngine.getAnyFromObject(objValue));
for (String levelName : appObject.getLevelNames()) {
int level = appObject.getLevel(levelName);
Object value = appObject.getValue(level);

TaskitObjectInput inValue = TaskitObjectHelper.getTaskitObjectInput(value, taskitEngine);

DimensionSingleValueInput dimInput = DimensionSingleValueInput.newBuilder()
.setLevelName(levelName)
.setValue(inValue)
.build();

builder.addValues(dimInput);
}

return builder.build();
}

@Override
public Class<GroupPropertyDimension> getAppObjectClass() {
return GroupPropertyDimension.class;
public Class<GroupPropertyDimensionData> getAppObjectClass() {
return GroupPropertyDimensionData.class;
}

@Override
public Class<GroupPropertyDimensionInput> getInputObjectClass() {
return GroupPropertyDimensionInput.class;
public Class<GroupPropertyDimensionDataInput> getInputObjectClass() {
return GroupPropertyDimensionDataInput.class;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.properties.support.input.PropertyDefinitionInput;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.properties.support.input.PropertyDefinitionMapInput;
import gov.hhs.aspr.ms.taskit.core.engine.TaskitError;
import gov.hhs.aspr.ms.taskit.protobuf.engine.TaskitObjectHelper;
import gov.hhs.aspr.ms.taskit.protobuf.objects.TaskitObjectInput;
import gov.hhs.aspr.ms.taskit.protobuf.translation.ProtobufTranslationSpec;
import gov.hhs.aspr.ms.util.errors.ContractException;

Expand Down Expand Up @@ -58,9 +60,9 @@ protected PersonPropertiesPluginData translateInputObject(PersonPropertiesPlugin
.get(personPropertyValueMapInput.getPersonPropertyId().getId());
for (PersonPropertyValueInput personPropertyValueInput : personPropertyValueMapInput
.getPropertyValuesList()) {
Object value = TaskitObjectHelper.getValue(personPropertyValueInput.getValue());
for (int pId : personPropertyValueInput.getPIdList()) {
builder.setPersonPropertyValue(new PersonId(pId), propertyId,
this.taskitEngine.getObjectFromAny(personPropertyValueInput.getValue()));
builder.setPersonPropertyValue(new PersonId(pId), propertyId, value);
}
}
}
Expand Down Expand Up @@ -118,13 +120,15 @@ protected PersonPropertiesPluginDataInput translateAppObject(PersonPropertiesPlu

for (int i = 0; i < propertyValues.size(); i++) {
if (propertyValues.get(i) != null) {
Object propertyValue = propertyValues.get(i);
PersonPropertyValueInput.Builder personPropertyValueInputBuilder = personPropertyInputBuildersMap
.get(propertyValues.get(i));
.get(propertyValue);

if (personPropertyValueInputBuilder == null) {
personPropertyValueInputBuilder = PersonPropertyValueInput.newBuilder()
.setValue(this.taskitEngine.getAnyFromObject(propertyValues.get(i)));
personPropertyValueInputBuilder = PersonPropertyValueInput.newBuilder();
TaskitObjectInput value = TaskitObjectHelper.getTaskitObjectInput(propertyValue, taskitEngine);

personPropertyValueInputBuilder.setValue(value);
personPropertyInputBuildersMap.put(propertyValues.get(i), personPropertyValueInputBuilder);
}

Expand Down
Loading