All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.openl.codegen.template.RuleService-RuntimeContextConvertor.vm Maven / Gradle / Ivy

There is a newer version: 5.19.9
Show newest version
#foreach( $contextPropertyDefinition in $contextPropertyDefinitions )
#if ($tool.getTypeName($contextPropertyDefinition.Type.InstanceClass).contains('org.openl.rules.enumeration'))
    private static $tool.getTypeName($contextPropertyDefinition.Type.InstanceClass) convert$tool.formatAccessorName($contextPropertyDefinition.Name)($tool.getTypeName($contextPropertyDefinition.Type.InstanceClass).replaceAll('org.openl.rules.enumeration','org.openl.rules.ruleservice.context.enumeration') $contextPropertyDefinition.Name) {
		if ($contextPropertyDefinition.Name == null) {
			return null;
		}
    	return ${tool.getTypeName($contextPropertyDefinition.Type.InstanceClass)}.fromString(${contextPropertyDefinition.Name}.toString());
    }
    
#end
#end
	public static org.openl.rules.context.IRulesRuntimeContext covert(org.openl.rules.ruleservice.context.IRulesRuntimeContext context) {
	    org.openl.rules.context.IRulesRuntimeContext rulesRuntimeContext = RulesRuntimeContextFactory.buildRulesRuntimeContext();
#foreach( $contextPropertyDefinition in $contextPropertyDefinitions )
#if ($tool.getTypeName($contextPropertyDefinition.Type.InstanceClass).contains('org.openl.rules.enumeration'))
		rulesRuntimeContext.set$tool.formatAccessorName($contextPropertyDefinition.Name)(convert$tool.formatAccessorName($contextPropertyDefinition.Name)(context.get$tool.formatAccessorName($contextPropertyDefinition.Name)()));
#else
		rulesRuntimeContext.set$tool.formatAccessorName($contextPropertyDefinition.Name)(context.get$tool.formatAccessorName($contextPropertyDefinition.Name)());
#end
#end
		return rulesRuntimeContext;
	}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy