🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
# 组件源码 ``` /** * <b>方法描述:</b> 获取容器变量值 <br/> * <b>创建者:</b> admin <br/> * <b>创建时间:</b> 2018-05-11 11:53:46 <br/> * * @param indict * 入参|上下文|{@link java.util.Map} * @param varname * 入参|变量名称|{@link java.lang.String} * @param varval * 出参|返回变量值|{@link Object} * @return 0 失败<br/> * 1 成功<br/> */ @Component(label = "获取容器变量值", style = "判断型", type = "同步组件", comment = "获取上下文中指定变量的值", version = "1.0.0", deprecated = false, author = "admin", date = "2018-05-11 11:53:46") @InParams(param = {@Param(name = "indict", comment = "上下文", type = java.util.Map.class), @Param(name = "varname", comment = "变量名称", type = java.lang.String.class)}) @OutParams(param = {@Param(name = "varval", comment = "返回变量值", type = Object.class)}) @Returns(returns = {@Return(id = "0", desp = "失败"), @Return(id = "1", desp = "成功")}) public static ResultBase P_getVal(Map indict, String varname) { if (indict == null) return ResultBase.newFailureResult("TPTC2006", "容器不能为空"); Object obj = indict.get(varname); AppLog.debug("获取容器变量:key={},value={}", varname, obj); return ResultBase.newSuccessResult(obj); } ``` # 交易中组件使用方式 ![](https://img.kancloud.cn/ea/e5/eae537e67c35492b332fd06613792c09_1870x891.png) # 参数说明及示例 ## 入口参数 上下文:一个 Map 对象,示例: `__INNER__` 变量名称:容器中存在的变量名,示例: `"x"` ## 出口参数 返回变量值:获取上下文中指定变量的值,示例: `__INNER__["result"]`