当前位置: 首页>>代码示例>>Java>>正文


Java ExecutionQuery.processVariableValueNotEqualsIgnoreCase方法代码示例

本文整理汇总了Java中org.activiti.engine.runtime.ExecutionQuery.processVariableValueNotEqualsIgnoreCase方法的典型用法代码示例。如果您正苦于以下问题:Java ExecutionQuery.processVariableValueNotEqualsIgnoreCase方法的具体用法?Java ExecutionQuery.processVariableValueNotEqualsIgnoreCase怎么用?Java ExecutionQuery.processVariableValueNotEqualsIgnoreCase使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.activiti.engine.runtime.ExecutionQuery的用法示例。


在下文中一共展示了ExecutionQuery.processVariableValueNotEqualsIgnoreCase方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addVariables

import org.activiti.engine.runtime.ExecutionQuery; //导入方法依赖的package包/类
protected void addVariables(ExecutionQuery processInstanceQuery, List<QueryVariable> variables, boolean process) {
    for (QueryVariable variable : variables) {
        if (variable.getVariableOperation() == null) {
            throw new ActivitiIllegalArgumentException("Variable operation is missing for variable: " + variable.getName());
        }
        if (variable.getValue() == null) {
            throw new ActivitiIllegalArgumentException("Variable value is missing for variable: " + variable.getName());
        }

        boolean nameLess = variable.getName() == null;

        Object actualValue = new RestResponseFactory().getVariableValue(variable);

        // A value-only query is only possible using equals-operator
        if (nameLess && variable.getVariableOperation() != QueryVariable.QueryVariableOperation.EQUALS) {
            throw new ActivitiIllegalArgumentException("Value-only query (without a variable-name) is only supported when using 'equals' operation.");
        }

        switch (variable.getVariableOperation()) {

            case EQUALS:
                if (nameLess) {
                    if (process) {
                        processInstanceQuery.processVariableValueEquals(actualValue);
                    } else {
                        processInstanceQuery.variableValueEquals(actualValue);
                    }
                } else {
                    if (process) {
                        processInstanceQuery.processVariableValueEquals(variable.getName(), actualValue);
                    } else {
                        processInstanceQuery.variableValueEquals(variable.getName(), actualValue);
                    }
                }
                break;

            case EQUALS_IGNORE_CASE:
                if (actualValue instanceof String) {
                    if (process) {
                        processInstanceQuery.processVariableValueEqualsIgnoreCase(variable.getName(), (String) actualValue);
                    } else {
                        processInstanceQuery.variableValueEqualsIgnoreCase(variable.getName(), (String) actualValue);
                    }
                } else {
                    throw new ActivitiIllegalArgumentException("Only string variable values are supported when ignoring casing, but was: "
                            + actualValue.getClass().getName());
                }
                break;

            case NOT_EQUALS:
                if (process) {
                    processInstanceQuery.processVariableValueNotEquals(variable.getName(), actualValue);
                } else {
                    processInstanceQuery.variableValueNotEquals(variable.getName(), actualValue);
                }
                break;

            case NOT_EQUALS_IGNORE_CASE:
                if (actualValue instanceof String) {
                    if (process) {
                        processInstanceQuery.processVariableValueNotEqualsIgnoreCase(variable.getName(), (String) actualValue);
                    } else {
                        processInstanceQuery.variableValueNotEqualsIgnoreCase(variable.getName(), (String) actualValue);
                    }
                } else {
                    throw new ActivitiIllegalArgumentException("Only string variable values are supported when ignoring casing, but was: "
                            + actualValue.getClass().getName());
                }
                break;
            default:
                throw new ActivitiIllegalArgumentException("Unsupported variable query operation: " + variable.getVariableOperation());
        }
    }
}
 
开发者ID:wso2,项目名称:carbon-business-process,代码行数:75,代码来源:BaseExecutionService.java

示例2: addVariables

import org.activiti.engine.runtime.ExecutionQuery; //导入方法依赖的package包/类
protected void addVariables(ExecutionQuery processInstanceQuery, List<QueryVariable> variables, boolean process) {
    for (QueryVariable variable : variables) {
        if (variable.getVariableOperation() == null) {
            throw new ActivitiIllegalArgumentException("Variable operation is missing for variable: " + variable.getName());
        }
        if (variable.getValue() == null) {
            throw new ActivitiIllegalArgumentException("Variable value is missing for variable: " + variable.getName());
        }

        boolean nameLess = variable.getName() == null;

        Object actualValue = new RestResponseFactory().getVariableValue(variable);

        // A value-only query is only possible using equals-operator
        if (nameLess && variable.getVariableOperation() != QueryVariable.QueryVariableOperation.EQUALS) {
            throw new ActivitiIllegalArgumentException("Value-only query (without a variable-name) is only supported when using 'equals' operation.");
        }

        switch (variable.getVariableOperation()) {

        case EQUALS:
            if (nameLess) {
                if(process) {
                    processInstanceQuery.processVariableValueEquals(actualValue);
                } else {
                    processInstanceQuery.variableValueEquals(actualValue);
                }
            } else {
                if(process) {
                    processInstanceQuery.processVariableValueEquals(variable.getName(), actualValue);
                } else {
                    processInstanceQuery.variableValueEquals(variable.getName(), actualValue);
                }
            }
            break;

        case EQUALS_IGNORE_CASE:
            if (actualValue instanceof String) {
                if(process) {
                    processInstanceQuery.processVariableValueEqualsIgnoreCase(variable.getName(), (String) actualValue);
                } else {
                    processInstanceQuery.variableValueEqualsIgnoreCase(variable.getName(), (String) actualValue);
                }
            } else {
                throw new ActivitiIllegalArgumentException("Only string variable values are supported when ignoring casing, but was: "
                        + actualValue.getClass().getName());
            }
            break;

        case NOT_EQUALS:
            if(process) {
                processInstanceQuery.processVariableValueNotEquals(variable.getName(), actualValue);
            } else {
                processInstanceQuery.variableValueNotEquals(variable.getName(), actualValue);
            }
            break;

        case NOT_EQUALS_IGNORE_CASE:
            if (actualValue instanceof String) {
                if(process) {
                    processInstanceQuery.processVariableValueNotEqualsIgnoreCase(variable.getName(), (String) actualValue);
                } else {
                    processInstanceQuery.variableValueNotEqualsIgnoreCase(variable.getName(), (String) actualValue);
                }
            } else {
                throw new ActivitiIllegalArgumentException("Only string variable values are supported when ignoring casing, but was: "
                        + actualValue.getClass().getName());
            }
            break;
        default:
            throw new ActivitiIllegalArgumentException("Unsupported variable query operation: " + variable.getVariableOperation());
        }
    }
}
 
开发者ID:wso2,项目名称:carbon-business-process,代码行数:75,代码来源:BaseRuntimeService.java


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