code: public static final synchronized BPMTaskService getTaskService(QName serviceDomainName, QName serviceName) {
          KnowledgeRuntimeManager runtimeManager = KnowledgeRuntimeManagerRegistry.getRuntimeManager(serviceDomainName, serviceName);
          if (runtimeManager != null) {
              RuntimeEngine runtimeEngine = runtimeManager.getRuntimeEngine();
              if (runtimeEngine != null) {
                  final TaskService taskService = runtimeEngine.getTaskService();
                  if (taskService != null) {
                      InvocationHandler ih = new InvocationHandler() {
                          @Override
                          public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
                              return method.invoke(taskService, args);
                          }
                      };
                      return (BPMTaskService)Proxy.newProxyInstance(BPMTaskService.class.getClassLoader(), new Class[] {BPMTaskService.class}, ih);
                  }
              }
          }
          return null;
      }
docs: Gets a task service.
  
  @param serviceDomainName the service domain name
  @param serviceName the service name
  @return the task service