public static void writeAction(final DroolsAction action, final StringBuilder xmlDump) { if (action instanceof DroolsConsequenceAction) { DroolsConsequenceAction consequenceAction = (DroolsConsequenceAction) action; xmlDump.append(" <action type=\"expression\" "); String name = consequenceAction.getName(); if (name != null) { xmlDump.append("name=\"" + name + "\" "); } String dialect = consequenceAction.getDialect(); if (dialect != null) { xmlDump.append("dialect=\"" + dialect + "\" "); } String consequence = consequenceAction.getConsequence(); if (consequence == null) { xmlDump.append("/>" + EOL); } else { xmlDump.append(">" + XmlDumper.replaceIllegalChars(consequence.trim()) + "</action>" + EOL); } } else { throw new IllegalArgumentException( "Unknown action " + action); } }
public static void writeScript(final DroolsAction action, String type, final StringBuilder xmlDump) { if (action instanceof DroolsConsequenceAction) { DroolsConsequenceAction consequenceAction = (DroolsConsequenceAction) action; xmlDump.append(" <tns:" + type + "-script"); String name = consequenceAction.getName(); if (name != null) { xmlDump.append(" name=\"" + name + "\""); } String dialect = consequenceAction.getDialect(); if (JavaDialect.ID.equals(dialect)) { xmlDump.append(" scriptFormat=\"" + XmlBPMNProcessDumper.JAVA_LANGUAGE + "\""); } else if ("JavaScript".equals(dialect)) { xmlDump.append(" scriptFormat=\"" + XmlBPMNProcessDumper.JAVASCRIPT_LANGUAGE + "\""); } String consequence = consequenceAction.getConsequence(); if (consequence != null) { xmlDump.append(">" + EOL + " <tns:script>" + XmlDumper.replaceIllegalChars(consequence.trim()) + "</tns:script>" + EOL); xmlDump.append(" </tns:" + type + "-script>" + EOL); } else { xmlDump.append("/>" + EOL); } } else { throw new IllegalArgumentException( "Unknown action " + action); } }
xmlDump, metaDataType); if (JavaDialect.ID.equals(action.getDialect())) { xmlDump.append("scriptFormat=\"" + XmlBPMNProcessDumper.JAVA_LANGUAGE + "\" "); } else if ("JavaScript".equals(action.getDialect())) { xmlDump.append("scriptFormat=\"" + XmlBPMNProcessDumper.JAVASCRIPT_LANGUAGE + "\" ");
protected void buildAction(DroolsAction droolsAction, ProcessBuildContext context, NodeImpl node) { DroolsConsequenceAction action = (DroolsConsequenceAction) droolsAction; ActionDescr actionDescr = new ActionDescr(); actionDescr.setText( action.getConsequence() ); actionDescr.setResource(context.getProcessDescr().getResource()); ProcessDialect dialect = ProcessDialectRegistry.getDialect( action.getDialect() ); dialect.getActionBuilder().build( context, action, actionDescr, node); }
public void build(Process process, ProcessDescr processDescr, ProcessBuildContext context, Node 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 ); }
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)); } }
public void buildContexts(ContextContainer contextContainer, ProcessBuildContext buildContext) { List<Context> exceptionScopes = contextContainer.getContexts(ExceptionScope.EXCEPTION_SCOPE); if (exceptionScopes != null) { for (Context context: exceptionScopes) { // TODO: OCRAM: add compensation scope to process builder???? ExceptionScope exceptionScope = (ExceptionScope) context; for (ExceptionHandler exceptionHandler: exceptionScope.getExceptionHandlers().values()) { if (exceptionHandler instanceof ActionExceptionHandler) { DroolsConsequenceAction action = (DroolsConsequenceAction) ((ActionExceptionHandler) exceptionHandler).getAction(); ActionDescr actionDescr = new ActionDescr(); actionDescr.setText( action.getConsequence() ); actionDescr.setResource(buildContext.getProcessDescr().getResource()); ProcessDialect dialect = ProcessDialectRegistry.getDialect( action.getDialect() ); dialect.getActionBuilder().build( buildContext, action, actionDescr, (ProcessImpl) buildContext.getProcess() ); } } } } }
errors, "Action has empty action."); } else if ("mvel".equals(droolsAction.getDialect())) { try { ParserContext parserContext = new ParserContext();
public static void writeScript(final DroolsAction action, String type, final StringBuilder xmlDump) { if (action instanceof DroolsConsequenceAction) { DroolsConsequenceAction consequenceAction = (DroolsConsequenceAction) action; xmlDump.append(" <tns:" + type + "-script"); String name = consequenceAction.getName(); if (name != null) { xmlDump.append(" name=\"" + name + "\""); } String dialect = consequenceAction.getDialect(); if (JavaDialect.ID.equals(dialect)) { xmlDump.append(" scriptFormat=\"" + XmlBPMNProcessDumper.JAVA_LANGUAGE + "\""); } else if ("JavaScript".equals(dialect)) { xmlDump.append(" scriptFormat=\"" + XmlBPMNProcessDumper.JAVASCRIPT_LANGUAGE + "\""); } String consequence = consequenceAction.getConsequence(); if (consequence != null) { xmlDump.append(">" + EOL + " <tns:script>" + XmlDumper.replaceIllegalChars(consequence.trim()) + "</tns:script>" + EOL); xmlDump.append(" </tns:" + type + "-script>" + EOL); } else { xmlDump.append("/>" + EOL); } } else { throw new IllegalArgumentException( "Unknown action " + action); } }
public static void writeAction(final DroolsAction action, final StringBuilder xmlDump) { if (action instanceof DroolsConsequenceAction) { DroolsConsequenceAction consequenceAction = (DroolsConsequenceAction) action; xmlDump.append(" <action type=\"expression\" "); String name = consequenceAction.getName(); if (name != null) { xmlDump.append("name=\"" + name + "\" "); } String dialect = consequenceAction.getDialect(); if (dialect != null) { xmlDump.append("dialect=\"" + dialect + "\" "); } String consequence = consequenceAction.getConsequence(); if (consequence == null) { xmlDump.append("/>" + EOL); } else { xmlDump.append(">" + XmlDumper.replaceIllegalChars(consequence.trim()) + "</action>" + EOL); } } else { throw new IllegalArgumentException( "Unknown action " + action); } }
xmlDump, metaDataType); if (JavaDialect.ID.equals(action.getDialect())) { xmlDump.append("scriptFormat=\"" + XmlBPMNProcessDumper.JAVA_LANGUAGE + "\" "); } else if ("JavaScript".equals(action.getDialect())) { xmlDump.append("scriptFormat=\"" + XmlBPMNProcessDumper.JAVASCRIPT_LANGUAGE + "\" ");
protected void buildAction(DroolsAction droolsAction, ProcessBuildContext context, NodeImpl node) { DroolsConsequenceAction action = (DroolsConsequenceAction) droolsAction; ActionDescr actionDescr = new ActionDescr(); actionDescr.setText( action.getConsequence() ); actionDescr.setResource(context.getProcessDescr().getResource()); ProcessDialect dialect = ProcessDialectRegistry.getDialect( action.getDialect() ); dialect.getActionBuilder().build( context, action, actionDescr, node); }
public void build(Process process, ProcessDescr processDescr, ProcessBuildContext context, Node 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 ); }
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)); } }
public void buildContexts(ContextContainer contextContainer, ProcessBuildContext buildContext) { List<Context> exceptionScopes = contextContainer.getContexts(ExceptionScope.EXCEPTION_SCOPE); if (exceptionScopes != null) { for (Context context: exceptionScopes) { // TODO: OCRAM: add compensation scope to process builder???? ExceptionScope exceptionScope = (ExceptionScope) context; for (ExceptionHandler exceptionHandler: exceptionScope.getExceptionHandlers().values()) { if (exceptionHandler instanceof ActionExceptionHandler) { DroolsConsequenceAction action = (DroolsConsequenceAction) ((ActionExceptionHandler) exceptionHandler).getAction(); ActionDescr actionDescr = new ActionDescr(); actionDescr.setText( action.getConsequence() ); actionDescr.setResource(buildContext.getProcessDescr().getResource()); ProcessDialect dialect = ProcessDialectRegistry.getDialect( action.getDialect() ); dialect.getActionBuilder().build( buildContext, action, actionDescr, (ProcessImpl) buildContext.getProcess() ); } } } } }
errors, "Action has empty action."); } else if ("mvel".equals(droolsAction.getDialect())) { try { ParserContext parserContext = new ParserContext();