use of org.finra.herd.model.api.xml.BusinessObjectDataAttributeKeys in project herd by FINRAOS.
the class GetBusinessObjectDataAttributes 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);
BusinessObjectDataAttributeKeys businessObjectDataAttributeKeys = businessObjectDataAttributeService.getBusinessObjectDataAttributes(businessObjectDataKey);
setJsonResponseAsWorkflowVariable(businessObjectDataAttributeKeys, execution);
}
use of org.finra.herd.model.api.xml.BusinessObjectDataAttributeKeys in project herd by FINRAOS.
the class BusinessObjectDataAttributeServiceImpl method getBusinessObjectDataAttributesImpl.
/**
* Gets a list of keys for all existing business object data attributes.
*
* @param businessObjectDataKey the business object data key
*
* @return the list of business object data attribute keys
*/
protected BusinessObjectDataAttributeKeys getBusinessObjectDataAttributesImpl(BusinessObjectDataKey businessObjectDataKey) {
// Validate and trim the business object data key.
businessObjectDataHelper.validateBusinessObjectDataKey(businessObjectDataKey, true, true);
// Retrieve the business object data and ensure it exists.
BusinessObjectDataEntity businessObjectDataEntity = businessObjectDataDaoHelper.getBusinessObjectDataEntity(businessObjectDataKey);
// Create and populate a list of business object data attribute keys.
BusinessObjectDataAttributeKeys businessObjectDataAttributeKeys = new BusinessObjectDataAttributeKeys();
for (BusinessObjectDataAttributeEntity businessObjectDataAttributeEntity : businessObjectDataEntity.getAttributes()) {
businessObjectDataAttributeKeys.getBusinessObjectDataAttributeKeys().add(getBusinessObjectDataAttributeKey(businessObjectDataAttributeEntity));
}
return businessObjectDataAttributeKeys;
}
use of org.finra.herd.model.api.xml.BusinessObjectDataAttributeKeys in project herd by FINRAOS.
the class BusinessObjectDataAttributeRestControllerTest method testGetBusinessObjectDataAttributesSubPartitionValuesCount0.
@Test
public void testGetBusinessObjectDataAttributesSubPartitionValuesCount0() {
// Create a business object data key.
BusinessObjectDataKey businessObjectDataKey = new BusinessObjectDataKey(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, NO_SUBPARTITION_VALUES, DATA_VERSION);
// Create a business object data attribute keys.
BusinessObjectDataAttributeKeys businessObjectDataAttributeKeys = new BusinessObjectDataAttributeKeys(Arrays.asList(new BusinessObjectDataAttributeKey(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, NO_SUBPARTITION_VALUES, DATA_VERSION, ATTRIBUTE_NAME_1_MIXED_CASE)));
// Mock the external calls.
when(businessObjectDataAttributeService.getBusinessObjectDataAttributes(businessObjectDataKey)).thenReturn(businessObjectDataAttributeKeys);
// Call the method under test.
BusinessObjectDataAttributeKeys result = businessObjectDataAttributeRestController.getBusinessObjectDataAttributes(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, DATA_VERSION);
// Verify the external calls.
verify(businessObjectDataAttributeService).getBusinessObjectDataAttributes(businessObjectDataKey);
verifyNoMoreInteractionsHelper();
// Validate the results.
assertEquals(businessObjectDataAttributeKeys, result);
}
use of org.finra.herd.model.api.xml.BusinessObjectDataAttributeKeys in project herd by FINRAOS.
the class BusinessObjectDataAttributeRestControllerTest method testGetBusinessObjectDataAttributesSubPartitionValuesCount3.
@Test
public void testGetBusinessObjectDataAttributesSubPartitionValuesCount3() {
// Create a business object data key.
BusinessObjectDataKey businessObjectDataKey = new BusinessObjectDataKey(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, Arrays.asList(SUBPARTITION_VALUES.get(0), SUBPARTITION_VALUES.get(1), SUBPARTITION_VALUES.get(2)), DATA_VERSION);
// Create a business object data attribute keys.
BusinessObjectDataAttributeKeys businessObjectDataAttributeKeys = new BusinessObjectDataAttributeKeys(Arrays.asList(new BusinessObjectDataAttributeKey(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, NO_SUBPARTITION_VALUES, DATA_VERSION, ATTRIBUTE_NAME_1_MIXED_CASE)));
// Mock the external calls.
when(businessObjectDataAttributeService.getBusinessObjectDataAttributes(businessObjectDataKey)).thenReturn(businessObjectDataAttributeKeys);
// Call the method under test.
BusinessObjectDataAttributeKeys result = businessObjectDataAttributeRestController.getBusinessObjectDataAttributes(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, SUBPARTITION_VALUES.get(0), SUBPARTITION_VALUES.get(1), SUBPARTITION_VALUES.get(2), DATA_VERSION);
// Verify the external calls.
verify(businessObjectDataAttributeService).getBusinessObjectDataAttributes(businessObjectDataKey);
verifyNoMoreInteractionsHelper();
// Validate the results.
assertEquals(businessObjectDataAttributeKeys, result);
}
use of org.finra.herd.model.api.xml.BusinessObjectDataAttributeKeys in project herd by FINRAOS.
the class BusinessObjectDataAttributeRestControllerTest method testGetBusinessObjectDataAttributesSubPartitionValuesCount1.
@Test
public void testGetBusinessObjectDataAttributesSubPartitionValuesCount1() {
// Create a business object data key.
BusinessObjectDataKey businessObjectDataKey = new BusinessObjectDataKey(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, Arrays.asList(SUBPARTITION_VALUES.get(0)), DATA_VERSION);
// Create a business object data attribute keys.
BusinessObjectDataAttributeKeys businessObjectDataAttributeKeys = new BusinessObjectDataAttributeKeys(Arrays.asList(new BusinessObjectDataAttributeKey(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, NO_SUBPARTITION_VALUES, DATA_VERSION, ATTRIBUTE_NAME_1_MIXED_CASE)));
// Mock the external calls.
when(businessObjectDataAttributeService.getBusinessObjectDataAttributes(businessObjectDataKey)).thenReturn(businessObjectDataAttributeKeys);
// Call the method under test.
BusinessObjectDataAttributeKeys result = businessObjectDataAttributeRestController.getBusinessObjectDataAttributes(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, SUBPARTITION_VALUES.get(0), DATA_VERSION);
// Verify the external calls.
verify(businessObjectDataAttributeService).getBusinessObjectDataAttributes(businessObjectDataKey);
verifyNoMoreInteractionsHelper();
// Validate the results.
assertEquals(businessObjectDataAttributeKeys, result);
}
Aggregations