String name = JcaWorkManagerDefinition.WmParameters.NAME.getAttribute().resolveModelAttribute(context, model).asString();
ServiceTarget serviceTarget = context.getServiceTarget();
WorkManager wm = new NamedWorkManager(name);
final WorkManagerService wmService = new WorkManagerService(wm);
ServiceBuilder builder = serviceTarget
.addService(ConnectorServices.WORKMANAGER_SERVICE.append(name), wmService);
builder.addDependency(ServiceBuilder.DependencyType.OPTIONAL, ThreadsServices.EXECUTOR.append(WORKMANAGER_LONG_RUNNING).append(name), Executor.class, wmService.getExecutorLongInjector());