private List<Parameter> buildJobParameters(StorageUnitNotificationEventParamsDto storageUnitNotificationEventParams) throws IOException { List<Parameter> parameters = new ArrayList<>(); BusinessObjectData businessObjectData = storageUnitNotificationEventParams.getBusinessObjectData(); NotificationJobActionEntity notificationJobActionEntity = storageUnitNotificationEventParams.getNotificationJobAction(); parameters.add(new Parameter(PARAM_NAMESPACE, storageUnitNotificationEventParams.getStorageUnitNotificationRegistration().getNamespace().getCode())); parameters.add(new Parameter(PARAM_NOTIFICATION_NAME, storageUnitNotificationEventParams.getStorageUnitNotificationRegistration().getName())); parameters.add(new Parameter(PARAM_STORAGE_UNIT_EVENT_TYPE, storageUnitNotificationEventParams.getEventType())); parameters.add(new Parameter(PARAM_CORRELATION_DATA, notificationJobActionEntity.getCorrelationData())); parameters.add(new Parameter(PARAM_BUSINESS_OBJECT_DATA, jsonHelper.objectToJson(businessObjectData))); parameters.add(new Parameter(PARAM_BUSINESS_OBJECT_DEFINITION_NAMESPACE, businessObjectData.getNamespace())); parameters.add(new Parameter(PARAM_BUSINESS_OBJECT_DEFINITION_NAME, businessObjectData.getBusinessObjectDefinitionName())); parameters.add(new Parameter(PARAM_BUSINESS_OBJECT_FORMAT_USAGE, businessObjectData.getBusinessObjectFormatUsage())); parameters.add(new Parameter(PARAM_BUSINESS_OBJECT_FORMAT_FILE_TYPE, businessObjectData.getBusinessObjectFormatFileType())); parameters.add(new Parameter(PARAM_BUSINESS_OBJECT_FORMAT_VERSION, Integer.toString(businessObjectData.getBusinessObjectFormatVersion()))); parameters.add(new Parameter(PARAM_PARTITION_COLUMN_NAMES, herdStringHelper.buildStringWithDefaultDelimiter(storageUnitNotificationEventParams.getPartitionColumnNames()))); parameters.add( new Parameter(PARAM_PARTITION_VALUES, herdStringHelper.buildStringWithDefaultDelimiter(storageUnitNotificationEventParams.getPartitionValues()))); parameters.add(new Parameter(PARAM_BUSINESS_OBJECT_DATA_VERSION, Integer.toString(businessObjectData.getVersion()))); parameters.add(new Parameter(PARAM_STORAGE_NAME, storageUnitNotificationEventParams.getStorageName())); parameters.add(new Parameter(PARAM_NEW_STORAGE_UNIT_STATUS, storageUnitNotificationEventParams.getNewStorageUnitStatus())); parameters.add(new Parameter(PARAM_OLD_STORAGE_UNIT_STATUS, storageUnitNotificationEventParams.getOldStorageUnitStatus())); return parameters; } }
private List<Parameter> buildJobParameters(StorageUnitNotificationEventParamsDto storageUnitNotificationEventParams) throws IOException { List<Parameter> parameters = new ArrayList<>(); BusinessObjectData businessObjectData = storageUnitNotificationEventParams.getBusinessObjectData(); NotificationJobActionEntity notificationJobActionEntity = storageUnitNotificationEventParams.getNotificationJobAction(); parameters.add(new Parameter(PARAM_NAMESPACE, storageUnitNotificationEventParams.getStorageUnitNotificationRegistration().getNamespace().getCode())); parameters.add(new Parameter(PARAM_NOTIFICATION_NAME, storageUnitNotificationEventParams.getStorageUnitNotificationRegistration().getName())); parameters.add(new Parameter(PARAM_STORAGE_UNIT_EVENT_TYPE, storageUnitNotificationEventParams.getEventType())); parameters.add(new Parameter(PARAM_CORRELATION_DATA, notificationJobActionEntity.getCorrelationData())); parameters.add(new Parameter(PARAM_BUSINESS_OBJECT_DATA, jsonHelper.objectToJson(businessObjectData))); parameters.add(new Parameter(PARAM_BUSINESS_OBJECT_DEFINITION_NAMESPACE, businessObjectData.getNamespace())); parameters.add(new Parameter(PARAM_BUSINESS_OBJECT_DEFINITION_NAME, businessObjectData.getBusinessObjectDefinitionName())); parameters.add(new Parameter(PARAM_BUSINESS_OBJECT_FORMAT_USAGE, businessObjectData.getBusinessObjectFormatUsage())); parameters.add(new Parameter(PARAM_BUSINESS_OBJECT_FORMAT_FILE_TYPE, businessObjectData.getBusinessObjectFormatFileType())); parameters.add(new Parameter(PARAM_BUSINESS_OBJECT_FORMAT_VERSION, Integer.toString(businessObjectData.getBusinessObjectFormatVersion()))); parameters.add(new Parameter(PARAM_PARTITION_COLUMN_NAMES, herdStringHelper.buildStringWithDefaultDelimiter(storageUnitNotificationEventParams.getPartitionColumnNames()))); parameters.add( new Parameter(PARAM_PARTITION_VALUES, herdStringHelper.buildStringWithDefaultDelimiter(storageUnitNotificationEventParams.getPartitionValues()))); parameters.add(new Parameter(PARAM_BUSINESS_OBJECT_DATA_VERSION, Integer.toString(businessObjectData.getVersion()))); parameters.add(new Parameter(PARAM_STORAGE_NAME, storageUnitNotificationEventParams.getStorageName())); parameters.add(new Parameter(PARAM_NEW_STORAGE_UNIT_STATUS, storageUnitNotificationEventParams.getNewStorageUnitStatus())); parameters.add(new Parameter(PARAM_OLD_STORAGE_UNIT_STATUS, storageUnitNotificationEventParams.getOldStorageUnitStatus())); return parameters; } }
private List<Parameter> buildJobParameters(BusinessObjectDataNotificationEventParamsDto businessObjectDataNotificationEventParams) throws IOException { List<Parameter> parameters = new ArrayList<>(); BusinessObjectData businessObjectData = businessObjectDataNotificationEventParams.getBusinessObjectData(); NotificationJobActionEntity notificationJobActionEntity = businessObjectDataNotificationEventParams.getNotificationJobAction(); parameters.add( new Parameter(PARAM_NAMESPACE, businessObjectDataNotificationEventParams.getBusinessObjectDataNotificationRegistration().getNamespace().getCode())); parameters .add(new Parameter(PARAM_NOTIFICATION_NAME, businessObjectDataNotificationEventParams.getBusinessObjectDataNotificationRegistration().getName())); parameters.add(new Parameter(PARAM_BUSINESS_OBJECT_DATA_EVENT_TYPE, businessObjectDataNotificationEventParams.getEventType())); parameters.add(new Parameter(PARAM_CORRELATION_DATA, notificationJobActionEntity.getCorrelationData())); parameters.add(new Parameter(PARAM_BUSINESS_OBJECT_DATA, jsonHelper.objectToJson(businessObjectData))); parameters.add(new Parameter(PARAM_BUSINESS_OBJECT_DEFINITION_NAMESPACE, businessObjectData.getNamespace())); parameters.add(new Parameter(PARAM_BUSINESS_OBJECT_DEFINITION_NAME, businessObjectData.getBusinessObjectDefinitionName())); parameters.add(new Parameter(PARAM_BUSINESS_OBJECT_FORMAT_USAGE, businessObjectData.getBusinessObjectFormatUsage())); parameters.add(new Parameter(PARAM_BUSINESS_OBJECT_FORMAT_FILE_TYPE, businessObjectData.getBusinessObjectFormatFileType())); parameters.add(new Parameter(PARAM_BUSINESS_OBJECT_FORMAT_VERSION, Integer.toString(businessObjectData.getBusinessObjectFormatVersion()))); parameters.add(new Parameter(PARAM_PARTITION_COLUMN_NAMES, herdStringHelper.buildStringWithDefaultDelimiter(businessObjectDataNotificationEventParams.getPartitionColumnNames()))); parameters.add(new Parameter(PARAM_PARTITION_VALUES, herdStringHelper.buildStringWithDefaultDelimiter(businessObjectDataNotificationEventParams.getPartitionValues()))); parameters.add(new Parameter(PARAM_BUSINESS_OBJECT_DATA_VERSION, Integer.toString(businessObjectData.getVersion()))); parameters.add(new Parameter(PARAM_NEW_BUSINESS_OBJECT_DATA_STATUS, businessObjectDataNotificationEventParams.getNewBusinessObjectDataStatus())); parameters.add(new Parameter(PARAM_OLD_BUSINESS_OBJECT_DATA_STATUS, businessObjectDataNotificationEventParams.getOldBusinessObjectDataStatus())); return parameters; } }
private List<Parameter> buildJobParameters(BusinessObjectDataNotificationEventParamsDto businessObjectDataNotificationEventParams) throws IOException { List<Parameter> parameters = new ArrayList<>(); BusinessObjectData businessObjectData = businessObjectDataNotificationEventParams.getBusinessObjectData(); NotificationJobActionEntity notificationJobActionEntity = businessObjectDataNotificationEventParams.getNotificationJobAction(); parameters.add( new Parameter(PARAM_NAMESPACE, businessObjectDataNotificationEventParams.getBusinessObjectDataNotificationRegistration().getNamespace().getCode())); parameters .add(new Parameter(PARAM_NOTIFICATION_NAME, businessObjectDataNotificationEventParams.getBusinessObjectDataNotificationRegistration().getName())); parameters.add(new Parameter(PARAM_BUSINESS_OBJECT_DATA_EVENT_TYPE, businessObjectDataNotificationEventParams.getEventType())); parameters.add(new Parameter(PARAM_CORRELATION_DATA, notificationJobActionEntity.getCorrelationData())); parameters.add(new Parameter(PARAM_BUSINESS_OBJECT_DATA, jsonHelper.objectToJson(businessObjectData))); parameters.add(new Parameter(PARAM_BUSINESS_OBJECT_DEFINITION_NAMESPACE, businessObjectData.getNamespace())); parameters.add(new Parameter(PARAM_BUSINESS_OBJECT_DEFINITION_NAME, businessObjectData.getBusinessObjectDefinitionName())); parameters.add(new Parameter(PARAM_BUSINESS_OBJECT_FORMAT_USAGE, businessObjectData.getBusinessObjectFormatUsage())); parameters.add(new Parameter(PARAM_BUSINESS_OBJECT_FORMAT_FILE_TYPE, businessObjectData.getBusinessObjectFormatFileType())); parameters.add(new Parameter(PARAM_BUSINESS_OBJECT_FORMAT_VERSION, Integer.toString(businessObjectData.getBusinessObjectFormatVersion()))); parameters.add(new Parameter(PARAM_PARTITION_COLUMN_NAMES, herdStringHelper.buildStringWithDefaultDelimiter(businessObjectDataNotificationEventParams.getPartitionColumnNames()))); parameters.add(new Parameter(PARAM_PARTITION_VALUES, herdStringHelper.buildStringWithDefaultDelimiter(businessObjectDataNotificationEventParams.getPartitionValues()))); parameters.add(new Parameter(PARAM_BUSINESS_OBJECT_DATA_VERSION, Integer.toString(businessObjectData.getVersion()))); parameters.add(new Parameter(PARAM_NEW_BUSINESS_OBJECT_DATA_STATUS, businessObjectDataNotificationEventParams.getNewBusinessObjectDataStatus())); parameters.add(new Parameter(PARAM_OLD_BUSINESS_OBJECT_DATA_STATUS, businessObjectDataNotificationEventParams.getOldBusinessObjectDataStatus())); return parameters; } }
/** * This method tests the availability activiti task with partition values */ @Test public void testAvailabilityTaskWithPartitionValues() throws Exception { businessObjectDataAvailabilityTestHelper.createDatabaseEntitiesForBusinessObjectDataAvailabilityTesting(null); List<FieldExtension> fieldExtensionList = new ArrayList<>(getMandatoryFields()); fieldExtensionList.add(buildFieldExtension("businessObjectFormatVersion", "${businessObjectFormatVersion}")); fieldExtensionList.add(buildFieldExtension("partitionKey", "${partitionKey}")); fieldExtensionList.add(buildFieldExtension("partitionValues", "${partitionValues}")); fieldExtensionList.add(buildFieldExtension("businessObjectDataVersion", "${businessObjectDataVersion}")); List<Parameter> parameters = new ArrayList<>(getMandatoryParameters()); parameters.add(buildParameter("businessObjectFormatVersion", FORMAT_VERSION.toString())); parameters.add(buildParameter("partitionKey", FIRST_PARTITION_COLUMN_NAME)); parameters.add(buildParameter("partitionValues", herdStringHelper.buildStringWithDefaultDelimiter(STORAGE_1_AVAILABLE_PARTITION_VALUES))); parameters.add(buildParameter("businessObjectDataVersion", DATA_VERSION.toString())); Map<String, Object> variableValuesToValidate = new HashMap<>(); variableValuesToValidate.put(CheckBusinessObjectDataAvailability.VARIABLE_IS_ALL_DATA_AVAILABLE, Boolean.TRUE); testActivitiServiceTaskSuccess(CheckBusinessObjectDataAvailability.class.getCanonicalName(), fieldExtensionList, parameters, variableValuesToValidate); }
@Override public void executeImpl(DelegateExecution execution) throws Exception { // Create the request. EmrMasterSecurityGroupAddRequest request = new EmrMasterSecurityGroupAddRequest(); request.setNamespace(activitiHelper.getExpressionVariableAsString(namespace, execution)); request.setEmrClusterDefinitionName(activitiHelper.getExpressionVariableAsString(emrClusterDefinitionName, execution)); request.setEmrClusterName(activitiHelper.getExpressionVariableAsString(emrClusterName, execution)); request.setAccountId(activitiHelper.getExpressionVariableAsString(accountId, execution)); String groupIdStr = activitiHelper.getExpressionVariableAsString(securityGroupIds, execution); if (StringUtils.isBlank(groupIdStr)) { throw new IllegalArgumentException("At least one security group must be specified."); } request.setSecurityGroupIds(daoHelper.splitStringWithDefaultDelimiter(groupIdStr.trim())); // Create the cluster in a new transaction. EmrMasterSecurityGroup emrMasterSecurityGroup = emrService.addSecurityGroupsToClusterMaster(request); // Set workflow variables based on the security groups. setTaskWorkflowVariable(execution, VARIABLE_EMR_MASTER_SECURITY_GROUPS, herdStringHelper.buildStringWithDefaultDelimiter(emrMasterSecurityGroup.getSecurityGroupIds())); } }
@Override public void executeImpl(DelegateExecution execution) throws Exception { // Create the request. EmrMasterSecurityGroupAddRequest request = new EmrMasterSecurityGroupAddRequest(); request.setNamespace(activitiHelper.getExpressionVariableAsString(namespace, execution)); request.setEmrClusterDefinitionName(activitiHelper.getExpressionVariableAsString(emrClusterDefinitionName, execution)); request.setEmrClusterName(activitiHelper.getExpressionVariableAsString(emrClusterName, execution)); request.setAccountId(activitiHelper.getExpressionVariableAsString(accountId, execution)); String groupIdStr = activitiHelper.getExpressionVariableAsString(securityGroupIds, execution); if (StringUtils.isBlank(groupIdStr)) { throw new IllegalArgumentException("At least one security group must be specified."); } request.setSecurityGroupIds(daoHelper.splitStringWithDefaultDelimiter(groupIdStr.trim())); // Create the cluster in a new transaction. EmrMasterSecurityGroup emrMasterSecurityGroup = emrService.addSecurityGroupsToClusterMaster(request); // Set workflow variables based on the security groups. setTaskWorkflowVariable(execution, VARIABLE_EMR_MASTER_SECURITY_GROUPS, herdStringHelper.buildStringWithDefaultDelimiter(emrMasterSecurityGroup.getSecurityGroupIds())); } }
parameters.add(buildParameter("businessObjectFormatVersion", FORMAT_VERSION.toString())); parameters.add(buildParameter("partitionValue", PARTITION_VALUE)); parameters.add(buildParameter("subPartitionValues", herdStringHelper.buildStringWithDefaultDelimiter(SUBPARTITION_VALUES))); parameters.add(buildParameter("businessObjectDataVersion", DATA_VERSION.toString()));
parameters.add(buildParameter("partitionKey", partitionKey)); parameters.add(buildParameter("partitionValue", PARTITION_VALUE)); parameters.add(buildParameter("subPartitionValues", herdStringHelper.buildStringWithDefaultDelimiter(SUBPARTITION_VALUES))); parameters.add(buildParameter("businessObjectDataVersion", DATA_VERSION.toString())); parameters.add(buildParameter("storageName", STORAGE_NAME));
parameters.add(buildParameter("businessObjectFormatVersion", FORMAT_VERSION.toString())); parameters.add(buildParameter("partitionValue", PARTITION_VALUE)); parameters.add(buildParameter("subPartitionValues", herdStringHelper.buildStringWithDefaultDelimiter(SUBPARTITION_VALUES))); parameters.add(buildParameter("businessObjectDataVersion", DATA_VERSION.toString())); parameters.add(buildParameter("businessObjectDataStatus", BDATA_STATUS_2));
parameters.add(buildParameter("businessObjectFormatVersion", FORMAT_VERSION.toString())); parameters.add(buildParameter("partitionValue", PARTITION_VALUE)); parameters.add(buildParameter("subPartitionValues", herdStringHelper.buildStringWithDefaultDelimiter(SUBPARTITION_VALUES))); parameters.add(buildParameter("businessObjectDataVersion", DATA_VERSION.toString())); parameters.add(buildParameter("businessObjectDataAttributeName", ATTRIBUTE_NAME_1_MIXED_CASE));
parameters.add(buildParameter("businessObjectFormatFileType", FORMAT_FILE_TYPE_CODE)); parameters.add(buildParameter("partitionValue", PARTITION_VALUE)); parameters.add(buildParameter("subPartitionValues", herdStringHelper.buildStringWithDefaultDelimiter(SUBPARTITION_VALUES))); parameters.add(buildParameter("businessObjectFormatVersion", FORMAT_VERSION.toString())); parameters.add(buildParameter("businessObjectDataVersion", DATA_VERSION.toString()));
parameters.add(buildParameter("businessObjectFormatVersion", FORMAT_VERSION.toString())); parameters.add(buildParameter("partitionValue", PARTITION_VALUE)); parameters.add(buildParameter("subPartitionValues", herdStringHelper.buildStringWithDefaultDelimiter(SUBPARTITION_VALUES))); parameters.add(buildParameter("businessObjectDataVersion", DATA_VERSION.toString())); parameters.add(buildParameter("storageName", STORAGE_NAME));
parameters.add(buildParameter("businessObjectFormatVersion", FORMAT_VERSION.toString())); parameters.add(buildParameter("partitionValue", PARTITION_VALUE)); parameters.add(buildParameter("subPartitionValues", herdStringHelper.buildStringWithDefaultDelimiter(SUBPARTITION_VALUES))); parameters.add(buildParameter("businessObjectDataVersion", DATA_VERSION.toString())); parameters.add(buildParameter("businessObjectDataAttributeName", ATTRIBUTE_NAME_1_MIXED_CASE));
parameters.add(buildParameter("businessObjectFormatVersion", FORMAT_VERSION.toString())); parameters.add(buildParameter("partitionValue", PARTITION_VALUE)); parameters.add(buildParameter("subPartitionValues", herdStringHelper.buildStringWithDefaultDelimiter(SUBPARTITION_VALUES))); parameters.add(buildParameter("businessObjectDataVersion", DATA_VERSION.toString()));
parameters.add(buildParameter("businessObjectFormatVersion", FORMAT_VERSION.toString())); parameters.add(buildParameter("partitionValue", PARTITION_VALUE)); parameters.add(buildParameter("subPartitionValues", herdStringHelper.buildStringWithDefaultDelimiter(SUBPARTITION_VALUES))); parameters.add(buildParameter("businessObjectDataVersion", DATA_VERSION.toString())); parameters.add(buildParameter("businessObjectDataAttributeName", ATTRIBUTE_NAME_1_MIXED_CASE));
parameters.add(buildParameter("businessObjectFormatFileType", FORMAT_FILE_TYPE_CODE)); parameters.add(buildParameter("partitionValue", PARTITION_VALUE)); parameters.add(buildParameter("subPartitionValues", herdStringHelper.buildStringWithDefaultDelimiter(SUBPARTITION_VALUES))); parameters.add(buildParameter("businessObjectFormatVersion", FORMAT_VERSION.toString())); parameters.add(buildParameter("businessObjectDataVersion", DATA_VERSION.toString()));
herdStringHelper.buildStringWithDefaultDelimiter(request.getSecurityGroupIds()) + " to cluster: " + clusterName);
herdStringHelper.buildStringWithDefaultDelimiter(request.getSecurityGroupIds()) + " to cluster: " + clusterName);
setTaskWorkflowVariable(execution, "activeStep_mainClass", emrCluster.getActiveStep().getMainClass()); setTaskWorkflowVariable(execution, "activeStep_scriptArguments", herdStringHelper.buildStringWithDefaultDelimiter(emrCluster.getActiveStep().getScriptArguments())); setTaskWorkflowVariable(execution, "activeStep_continueOnError", emrCluster.getActiveStep().getContinueOnError()); setTaskWorkflowVariable(execution, "step_mainClass", emrCluster.getStep().getMainClass()); setTaskWorkflowVariable(execution, "step_scriptArguments", herdStringHelper.buildStringWithDefaultDelimiter(emrCluster.getStep().getScriptArguments())); setTaskWorkflowVariable(execution, "step_continueOnError", emrCluster.getStep().getContinueOnError());