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

Java ValueFields类代码示例

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

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



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

示例1: setValue

import org.activiti.engine.impl.variable.ValueFields; //导入依赖的package包/类
@Override
public void setValue(Object value, ValueFields valueFields)
{
    if (value != null) 
    {
        if (!(value instanceof ActivitiScriptNodeList)) 
        {
            throw new ActivitiException("Passed value is not an instance of ActivitiScriptNodeList, cannot set variable value.");
        }
       
        // Extract all node references
        List<NodeRef> nodeRefs = ((ActivitiScriptNodeList) value).getNodeReferences();
        // Save the list as a serializable
        super.setValue(nodeRefs, valueFields);
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:17,代码来源:ScriptNodeListVariableType.java


示例2: getValue

import org.activiti.engine.impl.variable.ValueFields; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public Object getValue(ValueFields valueFields)
{
    Object serializable = super.getValue(valueFields);
    if (serializable == null)
    {
        return null;
    }
    
    if (!(serializable instanceof List<?>))
    {
        throw new ActivitiException("Serializable stored in variable is not instance of List<NodeRef>, cannot get value.");
    }
    
    ActivitiScriptNodeList scriptNodes = new ActivitiScriptNodeList();
    // Wrap all node references in an ActivitiScriptNode
    List<NodeRef> nodeRefs =(List<NodeRef>) serializable;
    for (NodeRef ref : nodeRefs) 
    {
        scriptNodes.add(new ActivitiScriptNode(ref, serviceRegistry));
    }
    return scriptNodes;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:25,代码来源:ScriptNodeListVariableType.java


示例3: setValue

import org.activiti.engine.impl.variable.ValueFields; //导入依赖的package包/类
@Override
public void setValue(Object value, ValueFields valueFields) 
{
    if(value != null && ((String) value).length() > MAX_TEXT_LENGTH) 
    {
        byte[] bytes = ((String) value).getBytes();
        valueFields.setBytes(bytes);
    }
    else {
        // Make sure NO byte-array is present anymore in case this variable exceeded the 
        // length before this update, but is shorter now
        valueFields.setBytes(null);

        // Revert to storing regular string
        super.setValue(value, valueFields);
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:18,代码来源:CustomStringVariableType.java


示例4: setValue

import org.activiti.engine.impl.variable.ValueFields; //导入依赖的package包/类
@Override
public void setValue(Object value, ValueFields valueFields)
{
    String textValue = null;
    if (value != null) 
    {
        if (!(value instanceof ActivitiScriptNode)) 
        {
            throw new ActivitiException("Passed value is not an instance of ActivitiScriptNode, cannot set variable value.");
        }
        NodeRef reference = (((ActivitiScriptNode)value).getNodeRef());
        if (reference != null)
        {
            // Use the string representation of the NodeRef
            textValue = reference.toString();             
        }
    }
    valueFields.setTextValue(textValue);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:20,代码来源:ScriptNodeVariableType.java


示例5: setValue

import org.activiti.engine.impl.variable.ValueFields; //导入依赖的package包/类
@Override
public void setValue(Object obj, ValueFields valueFields) {
    if (obj != null && obj instanceof XMLDocument) {
        try {

            valueFields.setTextValue(Utils.stringify((XMLDocument) obj));

        } catch (TransformerException e) {
            //since error occurred while transformation, set the variable value to null
            valueFields.setTextValue(null);
            log.error("Error occurred while converting XMLDocument to String", e);
        }
    } else {
        valueFields.setTextValue(null);
    }
}
 
开发者ID:wso2,项目名称:carbon-business-process,代码行数:17,代码来源:XmlType.java


示例6: getValue

import org.activiti.engine.impl.variable.ValueFields; //导入依赖的package包/类
@Override
public Object getValue(ValueFields valueFields) 
{
    // In case the string is stored as a byte-array, create a string from the stored bytes
    // using platform encoding and return this instead of the text-value
    if(valueFields.getBytes() != null) {
        return new String(valueFields.getBytes());
    }
    return super.getValue(valueFields);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:11,代码来源:CustomStringVariableType.java


示例7: getValue

import org.activiti.engine.impl.variable.ValueFields; //导入依赖的package包/类
@Override
public Object getValue(ValueFields valueFields) {
    JsonNode jsonValue = null;
    if (valueFields.getTextValue() != null && valueFields.getTextValue().length() > 0) {
        try {
            jsonValue = objectMapper.readTree(valueFields.getTextValue());
            return new JsonNodeObject(jsonValue);
        } catch (Exception e) {
            //Since we cannot throw exception here, simply log the error and return null
            log.error("Error reading json variable " + valueFields.getName(), e);
        }
    }
    return jsonValue;
}
 
开发者ID:wso2,项目名称:carbon-business-process,代码行数:15,代码来源:ExtendedJsonType.java


示例8: setValue

import org.activiti.engine.impl.variable.ValueFields; //导入依赖的package包/类
@Override
public void setValue(Object o, ValueFields valueFields) {
  // ensure calling setBytes multiple times no longer causes any problems 
  valueFields.setBytes(new byte[] { 1, 2, 3} );
  valueFields.setBytes(null);
  valueFields.setBytes(new byte[] { 4, 5, 6} );
  
  byte[] value = (o == null ? null : ((CustomType) o).getValue());
  valueFields.setBytes(value);
}
 
开发者ID:springvelocity,项目名称:xbpm5,代码行数:11,代码来源:VariablesTest.java


示例9: getValue

import org.activiti.engine.impl.variable.ValueFields; //导入依赖的package包/类
@Override
public Object getValue(ValueFields valueFields) {
	return valueFields.getTextValue2();
}
 
开发者ID:cijujoseph,项目名称:activiti-analytics-spring-boot,代码行数:5,代码来源:VariableDataEntityType.java


示例10: setValue

import org.activiti.engine.impl.variable.ValueFields; //导入依赖的package包/类
@Override
public void setValue(Object value, ValueFields valueFields) {
	valueFields.setTextValue(value.toString());
	valueFields.setTextValue2(value.toString());
}
 
开发者ID:cijujoseph,项目名称:activiti-analytics-spring-boot,代码行数:6,代码来源:VariableDataEntityType.java


示例11: setValue

import org.activiti.engine.impl.variable.ValueFields; //导入依赖的package包/类
@Override
public void setValue(Object obj, ValueFields valueFields) {
    valueFields.setTextValue((obj != null && obj instanceof JsonNodeObject &&
                                        ((JsonNodeObject)obj).unwrap() != null) ? obj.toString() : null);
}
 
开发者ID:wso2,项目名称:carbon-business-process,代码行数:6,代码来源:ExtendedJsonType.java


示例12: getValue

import org.activiti.engine.impl.variable.ValueFields; //导入依赖的package包/类
@Override
public Object getValue(ValueFields valueFields) {
  byte[] bytes = valueFields.getBytes();
  return bytes == null ? null : new CustomType(bytes);
}
 
开发者ID:springvelocity,项目名称:xbpm5,代码行数:6,代码来源:VariablesTest.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java NonSpillableDataBag类代码示例发布时间:2022-05-23
下一篇:
Java GsonRequest类代码示例发布时间: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