ProcessDescr processDescr = new ProcessDescr(); processDescr.setName(process.getPackageName() + "." + process.getName()); processDescr.setResource( resource ); processDescr.setProcessId( process.getId() ); DialectCompiletimeRegistry dialectRegistry = pkgRegistry.getDialectCompiletimeRegistry(); Dialect dialect = dialectRegistry.getDialect( "java" );
StringUtils.ucFirst(context.getProcessDescr().getClassName())); context.getProcessDescr().getClassName() + StringUtils.ucFirst(className) + "Invoker");
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); }
JavaDialect javaDialect = ( JavaDialect ) dialectRegistry.getDialect( "java" ); ProcessDescr processDescr = new ProcessDescr(); processDescr.setClassName( "Process1" ); processDescr.setName( "Process1" );
DialectCompiletimeRegistry dialectRegistry = pkgBuilder.getPackageRegistry( pkg.getName() ).getDialectCompiletimeRegistry(); ProcessDescr processDescr = new ProcessDescr(); processDescr.setClassName("Process1"); processDescr.setName("Process1");
final InternalKnowledgePackage pkg = new KnowledgePackageImpl( "pkg1" ); ProcessDescr processDescr = new ProcessDescr(); processDescr.setClassName( "Process1" ); processDescr.setName( "Process1" );
ProcessDescr processDescr = new ProcessDescr(); processDescr.setName(process.getPackageName() + "." + process.getName()); processDescr.setResource( resource ); processDescr.setProcessId( process.getId() ); DialectCompiletimeRegistry dialectRegistry = pkgRegistry.getDialectCompiletimeRegistry(); Dialect dialect = dialectRegistry.getDialect( "java" );
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 ); }
buffer.append( "public class " + StringUtils.ucFirst( processDescr.getClassName() ) + " {" + lineSeparator ); buffer.append( " private static final long serialVersionUID = 510l;" + lineSeparator );
final InternalKnowledgePackage pkg = new KnowledgePackageImpl( "pkg1" ); ProcessDescr processDescr = new ProcessDescr(); processDescr.setClassName( "Process1" ); processDescr.setName( "Process1" );
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 generateTemplates(final String ruleTemplate, final String invokerTemplate, final ProcessBuildContext context, final String className, final Map vars, final Object invokerLookup, final BaseDescr descrLookup) { TemplateRegistry registry = getRuleTemplateRegistry(); context.getMethods().add((String) TemplateRuntime.execute(registry.getNamedTemplate(ruleTemplate), null, new MapVariableResolverFactory(vars), registry) ); registry = getInvokerTemplateRegistry(); final String invokerClassName = context.getPkg().getName() + "." + context.getProcessDescr().getClassName() + StringUtils.ucFirst(className) + "Invoker"; context.getInvokers().put(invokerClassName, (String)TemplateRuntime.execute(registry.getNamedTemplate(invokerTemplate), null, new MapVariableResolverFactory(vars), registry) ); context.addInvokerLookup(invokerClassName, invokerLookup); context.addDescrLookups(invokerClassName, descrLookup); }
returnValueDescr.setResource(processDescr.getResource());
context.getPkg().getName() + "." + processDescr.getClassName(), processDescr, processClass,
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() ); } } } } }
StringUtils.ucFirst(context.getProcessDescr().getClassName())); context.getProcessDescr().getClassName() + StringUtils.ucFirst(className) + "Invoker");
returnValueDescr.setResource(processDescr.getResource());
buffer.append( "public class " + StringUtils.ucFirst( processDescr.getClassName() ) + " {" + lineSeparator ); buffer.append( " private static final long serialVersionUID = 510l;" + lineSeparator );
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 generateTemplates(final String ruleTemplate, final String invokerTemplate, final ProcessBuildContext context, final String className, final Map vars, final Object invokerLookup, final BaseDescr descrLookup) { TemplateRegistry registry = getRuleTemplateRegistry(); context.getMethods().add((String) TemplateRuntime.execute(registry.getNamedTemplate(ruleTemplate), null, new MapVariableResolverFactory(vars), registry) ); registry = getInvokerTemplateRegistry(); final String invokerClassName = context.getPkg().getName() + "." + context.getProcessDescr().getClassName() + StringUtils.ucFirst(className) + "Invoker"; context.getInvokers().put(invokerClassName, (String)TemplateRuntime.execute(registry.getNamedTemplate(invokerTemplate), null, new MapVariableResolverFactory(vars), registry) ); context.addInvokerLookup(invokerClassName, invokerLookup); context.addDescrLookups(invokerClassName, descrLookup); }