public ResultValue execute(DelegateExecution execution, String resource, String methodName, Object... args) throws Exception { String processDefinitionId = execution.getProcessDefinitionId(); RepositoryService repositoryService = execution.getEngineServices().getRepositoryService(); ProcessDefinition processDefinition = repositoryService.getProcessDefinition(processDefinitionId); @SuppressWarnings("rawtypes") ProjectEngineFactory projectEngineFactory = OpenLRulesHelper.getInstance() .get(processDefinition.getDeploymentId(), resource); Object instance = OpenLRulesHelper.getInstance().getInstance(processDefinition.getDeploymentId(), resource); Class<?> interfaceClass = projectEngineFactory.getInterfaceClass(); assert interfaceClass != null; // Always Non-null Object result = org.openl.rules.activiti.spring.OpenLEngine.findAndInvokeMethod(methodName, instance, interfaceClass, args); return new ResultValue(result); } }
public ResultValue execute(DelegateExecution execution, String resource, String methodName, Object... args) throws Exception { String processDefinitionId = execution.getProcessDefinitionId(); RepositoryService repositoryService = execution.getEngineServices().getRepositoryService(); ProcessDefinition processDefinition = repositoryService.getProcessDefinition(processDefinitionId); @SuppressWarnings("rawtypes") ProjectEngineFactory projectEngineFactory = OpenLRulesHelper.getInstance() .get(processDefinition.getDeploymentId(), resource); Object instance = OpenLRulesHelper.getInstance().getInstance(processDefinition.getDeploymentId(), resource); Class<?> interfaceClass = projectEngineFactory.getInterfaceClass(); assert interfaceClass != null; // Always Non-null Object result = org.openl.rules.activiti.spring.OpenLEngine.findAndInvokeMethod(methodName, instance, interfaceClass, args); return new ResultValue(result); } }