Search in sources :

Example 6 with BusinessObjectDataAttributeKeys

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);
}
Also used : BusinessObjectDataKey(org.finra.herd.model.api.xml.BusinessObjectDataKey) BusinessObjectDataAttributeKeys(org.finra.herd.model.api.xml.BusinessObjectDataAttributeKeys)

Example 7 with BusinessObjectDataAttributeKeys

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;
}
Also used : BusinessObjectDataAttributeEntity(org.finra.herd.model.jpa.BusinessObjectDataAttributeEntity) BusinessObjectDataEntity(org.finra.herd.model.jpa.BusinessObjectDataEntity) BusinessObjectDataAttributeKeys(org.finra.herd.model.api.xml.BusinessObjectDataAttributeKeys)

Example 8 with 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);
}
Also used : BusinessObjectDataAttributeKey(org.finra.herd.model.api.xml.BusinessObjectDataAttributeKey) BusinessObjectDataKey(org.finra.herd.model.api.xml.BusinessObjectDataKey) BusinessObjectDataAttributeKeys(org.finra.herd.model.api.xml.BusinessObjectDataAttributeKeys) Test(org.junit.Test)

Example 9 with BusinessObjectDataAttributeKeys

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);
}
Also used : BusinessObjectDataAttributeKey(org.finra.herd.model.api.xml.BusinessObjectDataAttributeKey) BusinessObjectDataKey(org.finra.herd.model.api.xml.BusinessObjectDataKey) BusinessObjectDataAttributeKeys(org.finra.herd.model.api.xml.BusinessObjectDataAttributeKeys) Test(org.junit.Test)

Example 10 with BusinessObjectDataAttributeKeys

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);
}
Also used : BusinessObjectDataAttributeKey(org.finra.herd.model.api.xml.BusinessObjectDataAttributeKey) BusinessObjectDataKey(org.finra.herd.model.api.xml.BusinessObjectDataKey) BusinessObjectDataAttributeKeys(org.finra.herd.model.api.xml.BusinessObjectDataAttributeKeys) Test(org.junit.Test)

Aggregations

BusinessObjectDataAttributeKeys (org.finra.herd.model.api.xml.BusinessObjectDataAttributeKeys)16 BusinessObjectDataKey (org.finra.herd.model.api.xml.BusinessObjectDataKey)15 Test (org.junit.Test)14 BusinessObjectDataAttributeKey (org.finra.herd.model.api.xml.BusinessObjectDataAttributeKey)5 ArrayList (java.util.ArrayList)3 HashMap (java.util.HashMap)3 FieldExtension (org.activiti.bpmn.model.FieldExtension)3 Attribute (org.finra.herd.model.api.xml.Attribute)3 Parameter (org.finra.herd.model.api.xml.Parameter)3 BusinessObjectDataAttributeEntity (org.finra.herd.model.jpa.BusinessObjectDataAttributeEntity)1 BusinessObjectDataEntity (org.finra.herd.model.jpa.BusinessObjectDataEntity)1