private void marshalRHS( StringBuilder buf, RuleModel model, boolean isDSLEnhanced ) { String indentation = "\t\t"; if ( model.rhs != null ) { //Add boiler-plate for actions operating on Dates Map<String, List<ActionFieldValue>> classes = getRHSClassDependencies( model ); if ( classes.containsKey( SuggestionCompletionEngine.TYPE_DATE ) ) { buf.append( indentation ); buf.append( "java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat(\"" + System.getProperty( "drools.dateformat" ) + "\");\n" ); } //Add boiler-plate for actions operating on WorkItems if ( !getRHSWorkItemDependencies( model ).isEmpty() ) { buf.append( indentation ); buf.append( "org.drools.process.instance.WorkItemManager wim = (org.drools.process.instance.WorkItemManager) drools.getWorkingMemory().getWorkItemManager();\n" ); } //Marshall the model itself RHSActionVisitor actionVisitor = getRHSActionVisitor( isDSLEnhanced, buf, indentation ); for ( IAction action : model.rhs ) { actionVisitor.visit( action ); } } }
private void marshalRHS( StringBuilder buf, RuleModel model, boolean isDSLEnhanced ) { String indentation = "\t\t"; if ( model.rhs != null ) { //Add boiler-plate for actions operating on Dates Map<String, List<ActionFieldValue>> classes = getRHSClassDependencies( model ); if ( classes.containsKey( SuggestionCompletionEngine.TYPE_DATE ) ) { buf.append( indentation ); buf.append( "java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat(\"" + System.getProperty( "drools.dateformat" ) + "\");\n" ); } //Add boiler-plate for actions operating on WorkItems if ( !getRHSWorkItemDependencies( model ).isEmpty() ) { buf.append( indentation ); buf.append( "org.drools.process.instance.WorkItemManager wim = (org.drools.process.instance.WorkItemManager) drools.getWorkingMemory().getWorkItemManager();\n" ); } //Marshall the model itself RHSActionVisitor actionVisitor = getRHSActionVisitor( isDSLEnhanced, buf, indentation ); for ( IAction action : model.rhs ) { actionVisitor.visit( action ); } } }