@Override public void build(Process process, ProcessDescr processDescr, ProcessBuildContext context, Node node) { Transformation transformation = (Transformation) node.getMetaData().get("Transformation"); if (transformation != null) { WorkflowProcess wfProcess = (WorkflowProcess) process; Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("imports", wfProcess.getImports()); parameters.put("classloader", context.getConfiguration().getClassLoader()); DataTransformer transformer = DataTransformerRegistry.get().find(transformation.getLanguage()); transformation.setCompiledExpression(transformer.compile(transformation.getExpression(), parameters)); } }
protected void readDataOutputAssociation(org.w3c.dom.Node xmlNode, SubProcessNode subProcessNode, Map<String, String> dataOutputs) { // sourceRef org.w3c.dom.Node subNode = xmlNode.getFirstChild(); String from = subNode.getTextContent(); // targetRef subNode = subNode.getNextSibling(); String to = subNode.getTextContent(); // transformation Transformation transformation = null; subNode = subNode.getNextSibling(); if (subNode != null && "transformation".equals(subNode.getNodeName())) { String lang = subNode.getAttributes().getNamedItem("language").getNodeValue(); String expression = subNode.getTextContent(); DataTransformer transformer = transformerRegistry.find(lang); if (transformer == null) { throw new IllegalArgumentException("No transformer registered for language " + lang); } transformation = new Transformation(lang, expression, from); subNode = subNode.getNextSibling(); } subProcessNode.addOutMapping(dataOutputs.get(from), to, transformation); }
@Override public Object transformEvent(Object event) { if (event == null || transformation == null) { return event; } DataTransformer transformer = DataTransformerRegistry.get().find(transformation.getLanguage()); if (transformer != null) { Object parameterValue = transformer.transform(transformation.getCompiledExpression(), Collections.singletonMap(name, event)); return parameterValue; } return event; }
public EventTransformerImpl(Transformation transformation) { if (transformation != null) { this.transformation = transformation; this.name = transformation.getSource(); if (this.name == null) { this.name = "event"; } } }
public EventTransformerImpl(Transformation transformation) { if (transformation != null) { this.transformation = transformation; this.name = transformation.getSource(); if (this.name == null) { this.name = "event"; } } }
@Override public void build(Process process, ProcessDescr processDescr, ProcessBuildContext context, Node node) { super.build(process, processDescr, context, node); Transformation transformation = (Transformation) node.getMetaData().get("Transformation"); if (transformation != null) { WorkflowProcess wfProcess = (WorkflowProcess) process; Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("imports", wfProcess.getImports()); parameters.put("classloader", context.getConfiguration().getClassLoader()); DataTransformer transformer = DataTransformerRegistry.get().find(transformation.getLanguage()); transformation.setCompiledExpression(transformer.compile(transformation.getExpression(), parameters)); } }
if (association.getTransformation() != null) { Transformation transformation = association.getTransformation(); DataTransformer transformer = DataTransformerRegistry.get().find(transformation.getLanguage()); if (transformer != null) { Object parameterValue = transformer.transform(transformation.getCompiledExpression(), getSourceParameters(association)); if (parameterValue != null) { replacements.put(association.getTarget(), parameterValue);
throw new IllegalArgumentException("No transformer registered for language " + lang); transformation = new Transformation(lang, expression, source); subNode = subNode.getNextSibling();
@Override public void build(Process process, ProcessDescr processDescr, ProcessBuildContext context, Node node) { super.build(process, processDescr, context, node); WorkflowProcess wfProcess = (WorkflowProcess) process; Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("imports", wfProcess.getImports()); parameters.put("classloader", context.getConfiguration().getClassLoader()); for (DataAssociation dataAssociation: ((RuleSetNode) node).getInAssociations()) { Transformation transformation = dataAssociation.getTransformation(); if (transformation != null) { DataTransformer transformer = DataTransformerRegistry.get().find(transformation.getLanguage()); transformation.setCompiledExpression(transformer.compile(transformation.getExpression(), parameters)); } } for (DataAssociation dataAssociation: ((RuleSetNode) node).getOutAssociations()) { Transformation transformation = dataAssociation.getTransformation(); if (transformation != null) { DataTransformer transformer = DataTransformerRegistry.get().find(transformation.getLanguage()); transformation.setCompiledExpression(transformer.compile(transformation.getExpression(), parameters)); } } }
if (association.getTransformation() != null) { Transformation transformation = association.getTransformation(); DataTransformer transformer = DataTransformerRegistry.get().find(transformation.getLanguage()); if (transformer != null) { Object parameterValue = transformer.transform(transformation.getCompiledExpression(), getSourceParameters(association)); if (parameterValue != null) { ((WorkItem) workItem).setParameter(association.getTarget(), parameterValue);
throw new IllegalArgumentException("No transformer registered for language " + lang); transformation = new Transformation(lang, expression, source);
@Override public void build(Process process, ProcessDescr processDescr, ProcessBuildContext context, Node node) { super.build(process, processDescr, context, node); WorkflowProcess wfProcess = (WorkflowProcess) process; Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("imports", wfProcess.getImports()); parameters.put("classloader", context.getConfiguration().getClassLoader()); for (DataAssociation dataAssociation: ((SubProcessNode) node).getInAssociations()) { Transformation transformation = dataAssociation.getTransformation(); if (transformation != null) { DataTransformer transformer = DataTransformerRegistry.get().find(transformation.getLanguage()); transformation.setCompiledExpression(transformer.compile(transformation.getExpression(), parameters)); } } for (DataAssociation dataAssociation: ((SubProcessNode) node).getOutAssociations()) { Transformation transformation = dataAssociation.getTransformation(); if (transformation != null) { DataTransformer transformer = DataTransformerRegistry.get().find(transformation.getLanguage()); transformation.setCompiledExpression(transformer.compile(transformation.getExpression(), parameters)); } } }
if (association.getTransformation() != null) { Transformation transformation = association.getTransformation(); DataTransformer transformer = DataTransformerRegistry.get().find(transformation.getLanguage()); if (transformer != null) { Object parameterValue = transformer.transform(transformation.getCompiledExpression(), objects); VariableScopeInstance variableScopeInstance = (VariableScopeInstance) resolveContextInstance(VariableScope.VARIABLE_SCOPE, association.getTarget());
protected void readDataOutputAssociation(org.w3c.dom.Node xmlNode, EventNode eventNode) { // sourceRef org.w3c.dom.Node subNode = xmlNode.getFirstChild(); String from = subNode.getTextContent(); // targetRef subNode = subNode.getNextSibling(); String to = subNode.getTextContent(); // transformation Transformation transformation = null; subNode = subNode.getNextSibling(); if (subNode != null && "transformation".equals(subNode.getNodeName())) { String lang = subNode.getAttributes().getNamedItem("language").getNodeValue(); String expression = subNode.getTextContent(); DataTransformer transformer = transformerRegistry.find(lang); if (transformer == null) { throw new IllegalArgumentException("No transformer registered for language " + lang); } transformation = new Transformation(lang, expression, dataOutputs.get(from)); eventNode.setMetaData("Transformation", transformation); eventNode.setEventTransformer(new EventTransformerImpl(transformation)); } eventNode.setVariableName(to); }
public void build(Process process, ProcessDescr processDescr, ProcessBuildContext context, Node node) { super.build(process, processDescr, context, node); ActionNode actionNode = ( ActionNode ) node; DroolsConsequenceAction action = (DroolsConsequenceAction) actionNode.getAction(); ActionDescr actionDescr = new ActionDescr(); actionDescr.setText( action.getConsequence() ); actionDescr.setResource(processDescr.getResource()); ProcessDialect dialect = ProcessDialectRegistry.getDialect( action.getDialect() ); dialect.getActionBuilder().build( context, action, actionDescr, (NodeImpl) node ); Transformation transformation = (Transformation) node.getMetaData().get("Transformation"); if (transformation != null) { WorkflowProcess wfProcess = (WorkflowProcess) process; Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("imports", wfProcess.getImports()); parameters.put("classloader", context.getConfiguration().getClassLoader()); DataTransformer transformer = DataTransformerRegistry.get().find(transformation.getLanguage()); transformation.setCompiledExpression(transformer.compile(transformation.getExpression(), parameters)); } }
if (mapping.getTransformation() != null) { Transformation transformation = mapping.getTransformation(); DataTransformer transformer = DataTransformerRegistry.get().find(transformation.getLanguage()); if (transformer != null) { Object parameterValue = transformer.transform(transformation.getCompiledExpression(), subProcessVariableScopeInstance.getVariables()); VariableScopeInstance variableScopeInstance = (VariableScopeInstance) resolveContextInstance(VariableScope.VARIABLE_SCOPE, mapping.getTarget());
protected void readDataOutputAssociation(org.w3c.dom.Node xmlNode, EventNode eventNode) { // sourceRef org.w3c.dom.Node subNode = xmlNode.getFirstChild(); String from = subNode.getTextContent(); // targetRef subNode = subNode.getNextSibling(); String to = subNode.getTextContent(); eventNode.setVariableName(to); // transformation Transformation transformation = null; subNode = subNode.getNextSibling(); if (subNode != null && "transformation".equals(subNode.getNodeName())) { String lang = subNode.getAttributes().getNamedItem("language").getNodeValue(); String expression = subNode.getTextContent(); DataTransformer transformer = transformerRegistry.find(lang); if (transformer == null) { throw new IllegalArgumentException("No transformer registered for language " + lang); } transformation = new Transformation(lang, expression, dataOutputs.get(from)); eventNode.setMetaData("Transformation", transformation); eventNode.setEventTransformer(new EventTransformerImpl(transformation)); } }
DataTransformer transformer = DataTransformerRegistry.get().find(transformation.getLanguage()); transformation.setCompiledExpression(transformer.compile(transformation.getExpression(), parameters)); if (transformation != null) { DataTransformer transformer = DataTransformerRegistry.get().find(transformation.getLanguage()); transformation.setCompiledExpression(transformer.compile(transformation.getExpression(), parameters));
if (mapping.getTransformation() != null) { Transformation transformation = mapping.getTransformation(); DataTransformer transformer = DataTransformerRegistry.get().find(transformation.getLanguage()); if (transformer != null) { parameterValue = transformer.transform(transformation.getCompiledExpression(), getSourceParameters(mapping));
throw new IllegalArgumentException("No transformer registered for language " + lang); transformation = new Transformation(lang, expression, dataOutputs.get(source)); startNode.setMetaData("Transformation", transformation);