• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java VariableType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.activiti.engine.impl.variable.VariableType的典型用法代码示例。如果您正苦于以下问题:Java VariableType类的具体用法?Java VariableType怎么用?Java VariableType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



VariableType类属于org.activiti.engine.impl.variable包,在下文中一共展示了VariableType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: initVariableTypes

import org.activiti.engine.impl.variable.VariableType; //导入依赖的package包/类
@Override
protected void initVariableTypes()
{
    super.initVariableTypes();
    // Add custom types before SerializableType
    if (customTypes != null)
    {
        int serializableIndex = variableTypes.getTypeIndex(SerializableType.TYPE_NAME);
        for (VariableType type : customTypes) 
        {
            variableTypes.addType(type, serializableIndex);
        }
    }
    
    // WOR-171: Replace string type by custom one to handle large text-values
    int stringIndex = variableTypes.getTypeIndex("string");
    variableTypes.removeType(variableTypes.getVariableType("string"));
    variableTypes.addType(new CustomStringVariableType(), stringIndex);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:20,代码来源:AlfrescoProcessEngineConfiguration.java


示例2: configure

import org.activiti.engine.impl.variable.VariableType; //导入依赖的package包/类
@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);
}
 
开发者ID:FINRAOS,项目名称:herd,代码行数:18,代码来源:HerdProcessEngineConfigurator.java


示例3: replaceVariableType

import org.activiti.engine.impl.variable.VariableType; //导入依赖的package包/类
/**
 * Inserts the variableType in variableTypes at the given index. If variableType already exists, then it replaces the type at the location where it already
 * exists.
 *
 * @param variableTypes the variableTypes
 * @param variableTypeToReplace the variableType to insert
 * @param indexToInsert the index to insert variableType
 *
 * @return the index where variableType was inserted.
 */
private int replaceVariableType(VariableTypes variableTypes, VariableType variableTypeToReplace, int indexToInsert)
{
    int indexToInsertReturn = indexToInsert;

    VariableType existingVariableType = variableTypes.getVariableType(variableTypeToReplace.getTypeName());
    if (existingVariableType != null)
    {
        indexToInsertReturn = variableTypes.getTypeIndex(existingVariableType.getTypeName());

        variableTypes.removeType(existingVariableType);
    }
    variableTypes.addType(variableTypeToReplace, indexToInsertReturn);

    return indexToInsertReturn;
}
 
开发者ID:FINRAOS,项目名称:herd,代码行数:26,代码来源:HerdProcessEngineConfigurator.java


示例4: initJpa

import org.activiti.engine.impl.variable.VariableType; //导入依赖的package包/类
protected void initJpa() {
  if(jpaPersistenceUnitName!=null) {
    jpaEntityManagerFactory = JpaHelper.createEntityManagerFactory(jpaPersistenceUnitName);
  }
  if(jpaEntityManagerFactory!=null) {
    sessionFactories.put(EntityManagerSession.class, new EntityManagerSessionFactory(jpaEntityManagerFactory, jpaHandleTransaction, jpaCloseEntityManager));
    VariableType jpaType = variableTypes.getVariableType(JPAEntityVariableType.TYPE_NAME);
    // Add JPA-type
    if(jpaType == null) {
      // We try adding the variable right before SerializableType, if available
      int serializableIndex = variableTypes.getTypeIndex(SerializableType.TYPE_NAME);
      if(serializableIndex > -1) {
        variableTypes.addType(new JPAEntityVariableType(), serializableIndex);
      } else {
        variableTypes.addType(new JPAEntityVariableType());
      }        
    }
  }
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:20,代码来源:ProcessEngineConfigurationImpl.java


示例5: createVariableLocal

import org.activiti.engine.impl.variable.VariableType; //导入依赖的package包/类
public void createVariableLocal(String variableName, Object value) {
  ensureVariableInstancesInitialized();
  
  if (variableInstances.containsKey(variableName)) {
    throw new ActivitiException("variable '"+variableName+"' already exists. Use setVariableLocal if you want to overwrite the value");
  }
  
  VariableTypes variableTypes = Context
    .getProcessEngineConfiguration()
    .getVariableTypes();
  
  VariableType type = variableTypes.findVariableType(value);
 
  VariableInstanceEntity variableInstance = VariableInstanceEntity.createAndInsert(variableName, type, value);
  initializeVariableInstanceBackPointer(variableInstance);
  variableInstances.put(variableName, variableInstance);
  
  setVariableInstanceValue(value, variableInstance);
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:20,代码来源:VariableScopeImpl.java


示例6: updateVariableInstance

import org.activiti.engine.impl.variable.VariableType; //导入依赖的package包/类
protected void updateVariableInstance(VariableInstanceEntity variableInstance, Object value, ExecutionEntity sourceActivityExecution) {

     // type should be changed
 if ((variableInstance != null) && (!variableInstance.getType().isAbleToStore(value))) {
	    VariableTypes variableTypes = Context
	    	      .getProcessEngineConfiguration()
	    	      .getVariableTypes();
	    VariableType newType = variableTypes.findVariableType(value);
	    variableInstance.setValue(null);
	    variableInstance.setType(newType);
	    variableInstance.forceUpdate();
  }
   variableInstance.setValue(value);

   Context.getCommandContext().getHistoryManager()
     .recordHistoricDetailVariableCreate(variableInstance, sourceActivityExecution, isActivityIdUsedForDetails());
   
   Context.getCommandContext().getHistoryManager()
     .recordVariableUpdate(variableInstance);
 }
 
开发者ID:springvelocity,项目名称:xbpm5,代码行数:21,代码来源:VariableScopeImpl.java


示例7: createVariableInstance

import org.activiti.engine.impl.variable.VariableType; //导入依赖的package包/类
protected VariableInstanceEntity createVariableInstance(String variableName, Object value, ExecutionEntity sourceActivityExecution) {
  VariableTypes variableTypes = Context
    .getProcessEngineConfiguration()
    .getVariableTypes();
  
  VariableType type = variableTypes.findVariableType(value);
 
  VariableInstanceEntity variableInstance = VariableInstanceEntity.createAndInsert(variableName, type, value);
  initializeVariableInstanceBackPointer(variableInstance);
  variableInstances.put(variableName, variableInstance);
  
  // Record historic variable
  Context.getCommandContext().getHistoryManager()
    .recordVariableCreate(variableInstance);

  // Record historic detail
  Context.getCommandContext().getHistoryManager()
    .recordHistoricDetailVariableCreate(variableInstance, sourceActivityExecution, isActivityIdUsedForDetails());

  return variableInstance;
}
 
开发者ID:springvelocity,项目名称:xbpm5,代码行数:22,代码来源:VariableScopeImpl.java


示例8: testNoStringAndLongStringType

import org.activiti.engine.impl.variable.VariableType; //导入依赖的package包/类
/**
 * Activiti by default configures StringType and LongStringType VariableType in configuration.
 * This method tests the scenarios where no StringType and LongStringType is already configured in configuration.
 */
@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());
}
 
开发者ID:FINRAOS,项目名称:herd,代码行数:18,代码来源:HerdProcessEngineConfiguratorTest.java


示例9: createAndInsert

import org.activiti.engine.impl.variable.VariableType; //导入依赖的package包/类
public static VariableInstanceEntity createAndInsert(String name, VariableType type, Object value) {
  VariableInstanceEntity variableInstance = create(name, type, value);

  Context
    .getCommandContext()
    .getDbSqlSession()
    .insert(variableInstance);

  return variableInstance;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:11,代码来源:VariableInstanceEntity.java


示例10: create

import org.activiti.engine.impl.variable.VariableType; //导入依赖的package包/类
public static VariableInstanceEntity create(String name, VariableType type, Object value) {
  VariableInstanceEntity variableInstance = new VariableInstanceEntity();
  variableInstance.name = name;
  variableInstance.type = type;
  variableInstance.setValue(value);
  
  return variableInstance;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:9,代码来源:VariableInstanceEntity.java


示例11: getResult

import org.activiti.engine.impl.variable.VariableType; //导入依赖的package包/类
public Object getResult(ResultSet rs, String columnName) throws SQLException {
  String typeName = rs.getString(columnName);
  VariableType type = getVariableTypes().getVariableType(typeName);
  if (type == null) {
    throw new ActivitiException("unknown variable type name " + typeName);
  }
  return type;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:9,代码来源:IbatisVariableTypeHandler.java


示例12: initialize

import org.activiti.engine.impl.variable.VariableType; //导入依赖的package包/类
public void initialize(VariableTypes types) {
  if(variableInstanceEntity == null) {
    VariableType type = types.findVariableType(value);
    if(type instanceof ByteArrayType) {
      throw new ActivitiException("Variables of type ByteArray cannot be used to query");
    } else if(type instanceof JPAEntityVariableType && operator != QueryOperator.EQUALS) {
      throw new ActivitiException("JPA entity variables can only be used in 'variableValueEquals'");
    } else {
      // Type implementation determines which fields are set on the entity
      variableInstanceEntity = VariableInstanceEntity.create(name, type, value);
    }
  }
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:14,代码来源:QueryVariableValue.java


示例13: createAndInsert

import org.activiti.engine.impl.variable.VariableType; //导入依赖的package包/类
public static VariableInstanceEntity createAndInsert(String name, VariableType type, Object value) {
  VariableInstanceEntity variableInstance = create(name, type, value);

  Context.getCommandContext()
    .getDbSqlSession()
    .insert(variableInstance);

  return variableInstance;
}
 
开发者ID:springvelocity,项目名称:xbpm5,代码行数:10,代码来源:VariableInstanceEntity.java


示例14: create

import org.activiti.engine.impl.variable.VariableType; //导入依赖的package包/类
public static VariableInstanceEntity create(String name, VariableType type, Object value) {
  VariableInstanceEntity variableInstance = new VariableInstanceEntity();
  variableInstance.name = name;
  variableInstance.type = type;
  variableInstance.setValue(value);
  return variableInstance;
}
 
开发者ID:springvelocity,项目名称:xbpm5,代码行数:8,代码来源:VariableInstanceEntity.java


示例15: getResult

import org.activiti.engine.impl.variable.VariableType; //导入依赖的package包/类
public VariableType getResult(ResultSet rs, String columnName) throws SQLException {
  String typeName = rs.getString(columnName);
  VariableType type = getVariableTypes().getVariableType(typeName);
  if (type == null && typeName != null) {
    throw new ActivitiException("unknown variable type name " + typeName);
  }
  return type;
}
 
开发者ID:springvelocity,项目名称:xbpm5,代码行数:9,代码来源:IbatisVariableTypeHandler.java


示例16: initialize

import org.activiti.engine.impl.variable.VariableType; //导入依赖的package包/类
public void initialize(VariableTypes types) {
  if(variableInstanceEntity == null) {
    VariableType type = types.findVariableType(value);
    if(type instanceof ByteArrayType) {
      throw new ActivitiIllegalArgumentException("Variables of type ByteArray cannot be used to query");
    } else if(type instanceof JPAEntityVariableType && operator != QueryOperator.EQUALS) {
      throw new ActivitiIllegalArgumentException("JPA entity variables can only be used in 'variableValueEquals'");
    } else {
      // Type implementation determines which fields are set on the entity
      variableInstanceEntity = VariableInstanceEntity.create(name, type, value);
    }
  }
}
 
开发者ID:springvelocity,项目名称:xbpm5,代码行数:14,代码来源:QueryVariableValue.java


示例17: setCustomTypes

import org.activiti.engine.impl.variable.VariableType; //导入依赖的package包/类
public void setCustomTypes(List<VariableType> customTypes)
{
    this.customTypes = customTypes;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:5,代码来源:AlfrescoProcessEngineConfiguration.java


示例18: getCustomPreVariableTypes

import org.activiti.engine.impl.variable.VariableType; //导入依赖的package包/类
public List<VariableType> getCustomPreVariableTypes() {
  return customPreVariableTypes;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:4,代码来源:ProcessEngineConfigurationImpl.java


示例19: setCustomPreVariableTypes

import org.activiti.engine.impl.variable.VariableType; //导入依赖的package包/类
public ProcessEngineConfigurationImpl setCustomPreVariableTypes(List<VariableType> customPreVariableTypes) {
  this.customPreVariableTypes = customPreVariableTypes;
  return this;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:5,代码来源:ProcessEngineConfigurationImpl.java


示例20: getCustomPostVariableTypes

import org.activiti.engine.impl.variable.VariableType; //导入依赖的package包/类
public List<VariableType> getCustomPostVariableTypes() {
  return customPostVariableTypes;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:4,代码来源:ProcessEngineConfigurationImpl.java



注:本文中的org.activiti.engine.impl.variable.VariableType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Utils类代码示例发布时间:2022-05-23
下一篇:
Java NodeInfo类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap