use of org.infinispan.protostream.impl.AnnotatedDescriptorImpl in project kogito-apps by kiegroup.
the class ProtoDomainModelProducer method onFileDescriptorRegistered.
public void onFileDescriptorRegistered(@Observes FileDescriptorRegisteredEvent event) {
FileDescriptor descriptor = event.getDescriptor();
String rootMessage = (String) descriptor.getOption("kogito_model").getValue();
String processId = (String) descriptor.getOption("kogito_id").getValue();
Map<String, Descriptor> map = descriptor.getMessageTypes().stream().collect(toMap(AnnotatedDescriptorImpl::getName, desc -> desc));
Descriptor rootDescriptor = map.remove(rootMessage);
DomainDescriptor domain = new DomainDescriptorMapper().apply(rootDescriptor);
List<DomainDescriptor> additionalTypes = map.values().stream().map(desc -> new DomainDescriptorMapper().apply(desc)).collect(toList());
domainEvent.fire(new DomainModelRegisteredEvent(processId, domain, additionalTypes));
}
Aggregations