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); } }
DroolsConsequenceAction action = (DroolsConsequenceAction) actionNode.getAction(); if (action != null) { String s = action.getConsequence(); if (s.startsWith("org.drools.core.process.instance.context.exception.ExceptionScopeInstance scopeInstance = (org.drools.core.process.instance.context.exception.ExceptionScopeInstance) ((org.drools.workflow.instance.NodeInstance) kcontext.getNodeInstance()).resolveContextInstance(org.drools.core.process.core.context.exception.ExceptionScope.EXCEPTION_SCOPE, \"")) { s = s.substring(327);
if (actions.size() == 1) { DroolsConsequenceAction action = (DroolsConsequenceAction) actions.get(0); String s = action.getConsequence(); if (s.startsWith("org.drools.core.process.instance.impl.WorkItemImpl workItem = new org.drools.core.process.instance.impl.WorkItemImpl();")) { xmlDump.append(">" + EOL);
String s = action.getConsequence(); if (s.startsWith("org.drools.core.process.instance.impl.WorkItemImpl workItem = new org.drools.core.process.instance.impl.WorkItemImpl();")) { writeNode("intermediateThrowEvent", writeExtensionElements(actionNode, xmlDump); if (action.getConsequence() != null) { xmlDump.append(" <script>" + XmlDumper.replaceIllegalChars(action.getConsequence()) + "</script>" + EOL);
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() ); } } } } }
} else if (actionNode.getAction() instanceof DroolsConsequenceAction) { DroolsConsequenceAction droolsAction = (DroolsConsequenceAction) actionNode.getAction(); String actionString = droolsAction.getConsequence(); if (actionString == null) { addErrorMessage(process,
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); } }
DroolsConsequenceAction action = (DroolsConsequenceAction) actionNode.getAction(); if (action != null) { String s = action.getConsequence(); if (s.startsWith("org.drools.core.process.instance.context.exception.ExceptionScopeInstance scopeInstance = (org.drools.core.process.instance.context.exception.ExceptionScopeInstance) ((org.drools.workflow.instance.NodeInstance) kcontext.getNodeInstance()).resolveContextInstance(org.drools.core.process.core.context.exception.ExceptionScope.EXCEPTION_SCOPE, \"")) { s = s.substring(327);
if (actions.size() == 1) { DroolsConsequenceAction action = (DroolsConsequenceAction) actions.get(0); String s = action.getConsequence(); if (s.startsWith("org.drools.core.process.instance.impl.WorkItemImpl workItem = new org.drools.core.process.instance.impl.WorkItemImpl();")) { xmlDump.append(">" + EOL);
String s = action.getConsequence(); if (s.startsWith("org.drools.core.process.instance.impl.WorkItemImpl workItem = new org.drools.core.process.instance.impl.WorkItemImpl();")) { writeNode("intermediateThrowEvent", writeExtensionElements(actionNode, xmlDump); if (action.getConsequence() != null) { xmlDump.append(" <script>" + XmlDumper.replaceIllegalChars(action.getConsequence()) + "</script>" + EOL);
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() ); } } } } }
} else if (actionNode.getAction() instanceof DroolsConsequenceAction) { DroolsConsequenceAction droolsAction = (DroolsConsequenceAction) actionNode.getAction(); String actionString = droolsAction.getConsequence(); if (actionString == null) { addErrorMessage(process,