test_class.declarator: herdProcessEngineConfigurator
test_class.modifier: @Autowired
test_class.original_string: @Autowired
      HerdProcessEngineConfigurator herdProcessEngineConfigurator;
test_class.type: HerdProcessEngineConfigurator
test_class.var_name: herdProcessEngineConfigurator
test_class.file: herd-code/herd-service/src/test/java/org/finra/herd/service/activiti/HerdProcessEngineConfiguratorTest.java
test_class.identifier: HerdProcessEngineConfiguratorTest
test_class.superclass: extends AbstractServiceTest
test_case.body: @Test
      public void testNoStringAndLongStringType() throws Exception
      {
          SpringProcessEngineConfiguration configuration = new SpringProcessEngineConfiguration();
          configuration.setVariableTypes(new DefaultVariableTypes());
          
          herdProcessEngineConfigurator.configure(configuration);
          VariableType type = configuration.getVariableTypes().findVariableType(StringUtils.repeat("a", 2000));
          assertEquals(StringType.class, type.getClass());
          
          type = configuration.getVariableTypes().findVariableType(StringUtils.repeat("a", 2001));
          assertEquals(LongStringType.class, type.getClass());
      }
test_case.class_method_signature: HerdProcessEngineConfiguratorTest.testNoStringAndLongStringType()
test_case.full_signature: @Test public void testNoStringAndLongStringType()
test_case.identifier: testNoStringAndLongStringType
test_case.invocations: setVariableTypes configure findVariableType getVariableTypes repeat assertEquals getClass findVariableType getVariableTypes repeat assertEquals getClass
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testNoStringAndLongStringType()
focal_class.file: herd-code/herd-service/src/main/java/org/finra/herd/service/activiti/HerdProcessEngineConfigurator.java
focal_class.identifier: HerdProcessEngineConfigurator
focal_class.interfaces: implements ProcessEngineConfigurator
focal_class.class_method_signature: HerdProcessEngineConfigurator.beforeInit(ProcessEngineConfigurationImpl configuration)
focal_class.full_signature: @Override public void beforeInit(ProcessEngineConfigurationImpl configuration)
focal_class.identifier: beforeInit
focal_class.modifiers: @Override public
focal_class.parameters: (ProcessEngineConfigurationImpl configuration)
focal_class.return: void
focal_class.signature: void beforeInit(ProcessEngineConfigurationImpl configuration)
focal_class.class_method_signature: HerdProcessEngineConfigurator.configure(ProcessEngineConfigurationImpl processEngineConfiguration)
focal_class.full_signature: @Override public void configure(ProcessEngineConfigurationImpl processEngineConfiguration)
focal_class.identifier: configure
focal_class.modifiers: @Override public
focal_class.parameters: (ProcessEngineConfigurationImpl processEngineConfiguration)
focal_class.return: void
focal_class.signature: void configure(ProcessEngineConfigurationImpl processEngineConfiguration)
focal_class.class_method_signature: HerdProcessEngineConfigurator.getPriority()
focal_class.full_signature: @Override public int getPriority()
focal_class.identifier: getPriority
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getPriority()
focal_class.class_method_signature: HerdProcessEngineConfigurator.replaceVariableType(VariableTypes variableTypes, VariableType variableTypeToReplace, int indexToInsert)
focal_class.full_signature: private int replaceVariableType(VariableTypes variableTypes, VariableType variableTypeToReplace, int indexToInsert)
focal_class.identifier: replaceVariableType
focal_class.modifiers: private
focal_class.parameters: (VariableTypes variableTypes, VariableType variableTypeToReplace, int indexToInsert)
focal_class.return: int
focal_class.signature: int replaceVariableType(VariableTypes variableTypes, VariableType variableTypeToReplace, int indexToInsert)
focal_method.body: @Override
      public void configure(ProcessEngineConfigurationImpl processEngineConfiguration)
      {
          // There is an issue when using Activiti with Oracle. When workflow variables have a length greater then 2000 and smaller than 4001,
          // Activiti tries to store that as a String column, but the Oracle database column length (ACT_RU_VARIABLE.TEXT_, ACT_HI_VARINST.TEXT_) is 2000.
          // Since Activiti uses NVARCHAR as the column type which requires 2 bytes for every character, the maximum size Oracle allows for the column is
          // 2000 (i.e. 4000 bytes).
  
          // Replace the StringType and LongType to store greater than 2000 length variables as blob.
          VariableTypes variableTypes = processEngineConfiguration.getVariableTypes();
  
          VariableType stringType = new StringType(2000);
          int indexToInsert = replaceVariableType(variableTypes, stringType, 0);
  
          VariableType longStringType = new LongStringType(2001);
          replaceVariableType(variableTypes, longStringType, ++indexToInsert);
      }
focal_method.class_method_signature: HerdProcessEngineConfigurator.configure(ProcessEngineConfigurationImpl processEngineConfiguration)
focal_method.full_signature: @Override public void configure(ProcessEngineConfigurationImpl processEngineConfiguration)
focal_method.identifier: configure
focal_method.invocations: getVariableTypes replaceVariableType replaceVariableType
focal_method.modifiers: @Override public
focal_method.parameters: (ProcessEngineConfigurationImpl processEngineConfiguration)
focal_method.return: void
focal_method.signature: void configure(ProcessEngineConfigurationImpl processEngineConfiguration)