/** * Execute a paxml entity. * * @param entity * the paxml entity * @param topLevelProperties * the top level properties. * @param initialProperties * the initial properties. * @return the execution result */ public Object execute(IEntity entity, Properties topLevelProperties, Properties initialProperties) { Context context = new Context(topLevelProperties, processId); if (initialProperties != null) { context = new Context(context); context.addProperties(initialProperties); } return execute(entity, context, true, true); }
/** * Execute a paxml entity. * * @param entity * the paxml entity * @param topLevelProperties * the top level properties. * @param initialProperties * the initial properties. * @return the execution result */ public Object execute(IEntity entity, Properties topLevelProperties, Properties initialProperties) { Context context = new Context(topLevelProperties, processId); if (initialProperties != null) { context = new Context(context); context.addProperties(initialProperties); } return execute(entity, context, true, true); }
/** * * {@inheritDoc} Makes a new context and pass on. * */ @Override protected Object doExecute(Context context) throws Exception { Context subContext = new Context(context); subContext.setAsCurrentThreadContext(); try { // let the parameters put them into the new context executeChildren(subContext); // invoke the target scenario with the new context final Object result = invoke(subContext); return result; } finally { context.setAsCurrentThreadContext(); } }
/** * * {@inheritDoc} Makes a new context and pass on. * */ @Override protected Object doExecute(Context context) throws Exception { Context subContext = new Context(context); subContext.setAsCurrentThreadContext(); try { // let the parameters put them into the new context executeChildren(subContext); // invoke the target scenario with the new context final Object result = invoke(subContext); return result; } finally { context.setAsCurrentThreadContext(); } }
/** * Call a tag. * * @param name * the tag name * @param args * the arguments map * @return the result */ public static Object call(String name, Map<String, Object> args) { final Context context = Context.getCurrentContext(); final IEntity tag = context.getPaxml().getEntity(name); if (tag == null) { throw new PaxmlRuntimeException("No tag defined as: " + name); } final Context subContext = new Context(context); subContext.setAsCurrentThreadContext(); try { if (args != null) { for (Map.Entry<String, Object> entry : args.entrySet()) { String key = entry.getKey(); Object value = entry.getValue(); subContext.addConst(key, key, value, false); } } return tag.execute(subContext); } finally { context.setAsCurrentThreadContext(); } }
/** * Call a tag. * * @param name * the tag name * @param args * the arguments map * @return the result */ public static Object call(String name, Map<String, Object> args) { final Context context = Context.getCurrentContext(); final IEntity tag = context.getPaxml().getEntity(name); if (tag == null) { throw new PaxmlRuntimeException("No tag defined as: " + name); } final Context subContext = new Context(context); subContext.setAsCurrentThreadContext(); try { if (args != null) { for (Map.Entry<String, Object> entry : args.entrySet()) { String key = entry.getKey(); Object value = entry.getValue(); subContext.addConst(key, key, value, false); } } return tag.execute(subContext); } finally { context.setAsCurrentThreadContext(); } }