use of org.finra.herd.model.api.xml.BusinessObjectDataStatusInformation in project herd by FINRAOS.
the class GetBusinessObjectDataStatus method executeImpl.
@Override
public void executeImpl(DelegateExecution execution) throws Exception {
String namespace = activitiHelper.getExpressionVariableAsString(this.namespace, execution);
String businessObjectDefinitionName = activitiHelper.getExpressionVariableAsString(this.businessObjectDefinitionName, execution);
String businessObjectFormatUsage = activitiHelper.getExpressionVariableAsString(this.businessObjectFormatUsage, execution);
String businessObjectFormatFileType = activitiHelper.getExpressionVariableAsString(this.businessObjectFormatFileType, execution);
Integer businessObjectFormatVersion = activitiHelper.getExpressionVariableAsInteger(this.businessObjectFormatVersion, execution, "businessObjectFormatVersion", false);
String partitionValue = activitiHelper.getExpressionVariableAsString(this.partitionValue, execution);
String subPartitionValuesString = activitiHelper.getExpressionVariableAsString(this.subPartitionValues, execution);
List<String> subPartitionValues = daoHelper.splitStringWithDefaultDelimiterEscaped(subPartitionValuesString);
Integer businessObjectDataVersion = activitiHelper.getExpressionVariableAsInteger(this.businessObjectDataVersion, execution, "businessObjectDataVersion", false);
BusinessObjectDataKey businessObjectDataKey = new BusinessObjectDataKey();
businessObjectDataKey.setNamespace(namespace);
businessObjectDataKey.setBusinessObjectDefinitionName(businessObjectDefinitionName);
businessObjectDataKey.setBusinessObjectFormatUsage(businessObjectFormatUsage);
businessObjectDataKey.setBusinessObjectFormatFileType(businessObjectFormatFileType);
businessObjectDataKey.setBusinessObjectFormatVersion(businessObjectFormatVersion);
businessObjectDataKey.setPartitionValue(partitionValue);
businessObjectDataKey.setSubPartitionValues(subPartitionValues);
businessObjectDataKey.setBusinessObjectDataVersion(businessObjectDataVersion);
BusinessObjectDataStatusInformation businessObjectDataStatusInformation = businessObjectDataStatusService.getBusinessObjectDataStatus(businessObjectDataKey, null);
setJsonResponseAsWorkflowVariable(businessObjectDataStatusInformation, execution);
}
use of org.finra.herd.model.api.xml.BusinessObjectDataStatusInformation in project herd by FINRAOS.
the class BusinessObjectDataStatusServiceTest method testGetBusinessObjectDataStatus.
@Test
public void testGetBusinessObjectDataStatus() {
// Create and persist database entities required for testing.
businessObjectDataDaoTestHelper.createBusinessObjectDataEntity(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, SUBPARTITION_VALUES, DATA_VERSION, true, BDATA_STATUS);
// Get the business object data status information.
BusinessObjectDataStatusInformation resultBusinessObjectDataStatusInformation = businessObjectDataStatusService.getBusinessObjectDataStatus(new BusinessObjectDataKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, SUBPARTITION_VALUES, DATA_VERSION), PARTITION_KEY);
// Validate the returned object.
businessObjectDataServiceTestHelper.validateBusinessObjectDataStatusInformation(new BusinessObjectDataKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, SUBPARTITION_VALUES, DATA_VERSION), BDATA_STATUS, resultBusinessObjectDataStatusInformation);
}
use of org.finra.herd.model.api.xml.BusinessObjectDataStatusInformation in project herd by FINRAOS.
the class BusinessObjectDataStatusServiceTest method testGetBusinessObjectDataStatusLowerCaseParameters.
@Test
public void testGetBusinessObjectDataStatusLowerCaseParameters() {
// Create and persist database entities required for testing.
businessObjectDataDaoTestHelper.createBusinessObjectDataEntity(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, SUBPARTITION_VALUES, DATA_VERSION, true, BDATA_STATUS);
// Get the business object data status using lower case input parameters (except for case-sensitive partition values).
BusinessObjectDataStatusInformation resultBusinessObjectDataStatusInformation = businessObjectDataStatusService.getBusinessObjectDataStatus(new BusinessObjectDataKey(NAMESPACE.toLowerCase(), BDEF_NAME.toLowerCase(), FORMAT_USAGE_CODE.toLowerCase(), FORMAT_FILE_TYPE_CODE.toLowerCase(), FORMAT_VERSION, PARTITION_VALUE, SUBPARTITION_VALUES, DATA_VERSION), PARTITION_KEY.toLowerCase());
// Validate the returned object.
businessObjectDataServiceTestHelper.validateBusinessObjectDataStatusInformation(new BusinessObjectDataKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, SUBPARTITION_VALUES, DATA_VERSION), BDATA_STATUS, resultBusinessObjectDataStatusInformation);
}
use of org.finra.herd.model.api.xml.BusinessObjectDataStatusInformation in project herd by FINRAOS.
the class BusinessObjectDataStatusServiceTest method testGetBusinessObjectDataStatusMissingOptionalParametersPassedAsNulls.
@Test
public void testGetBusinessObjectDataStatusMissingOptionalParametersPassedAsNulls() {
// Create and persist a business object data entity without sub-partition values.
businessObjectDataDaoTestHelper.createBusinessObjectDataEntity(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, NO_SUBPARTITION_VALUES, DATA_VERSION, true, BDATA_STATUS);
// Get the business object data status by passing null value for the partition key.
BusinessObjectDataStatusInformation resultBusinessObjectDataStatusInformation = businessObjectDataStatusService.getBusinessObjectDataStatus(new BusinessObjectDataKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, null, PARTITION_VALUE, NO_SUBPARTITION_VALUES, null), null);
// Validate the returned object.
businessObjectDataServiceTestHelper.validateBusinessObjectDataStatusInformation(new BusinessObjectDataKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, NO_SUBPARTITION_VALUES, DATA_VERSION), BDATA_STATUS, resultBusinessObjectDataStatusInformation);
}
use of org.finra.herd.model.api.xml.BusinessObjectDataStatusInformation in project herd by FINRAOS.
the class BusinessObjectDataStatusServiceTest method testGetBusinessObjectDataStatusMissingOptionalParameters.
@Test
public void testGetBusinessObjectDataStatusMissingOptionalParameters() {
// and with any allowed number of subpartition values (from 0 to MAX_SUBPARTITIONS).
for (int i = 0; i <= BusinessObjectDataEntity.MAX_SUBPARTITIONS; i++) {
// Build a list of subpartition values.
List<String> subPartitionValues = SUBPARTITION_VALUES.subList(0, i);
// Create and persist a business object data entity.
businessObjectDataDaoTestHelper.createBusinessObjectDataEntity(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, subPartitionValues, DATA_VERSION, true, BDATA_STATUS);
// Get the business object data status information without specifying optional parameters.
BusinessObjectDataStatusInformation resultBusinessObjectDataStatusInformation = businessObjectDataStatusService.getBusinessObjectDataStatus(new BusinessObjectDataKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, null, PARTITION_VALUE, subPartitionValues, null), BLANK_TEXT);
// Validate the returned object.
businessObjectDataServiceTestHelper.validateBusinessObjectDataStatusInformation(new BusinessObjectDataKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, subPartitionValues, DATA_VERSION), BDATA_STATUS, resultBusinessObjectDataStatusInformation);
}
}
Aggregations