コード例 #1
0
 @Override
 public void doWork() throws OperatorException {
   AlignmentAnalyzerParametersImpl params;
   try {
     params = parseParameters();
   } catch (IOException e) {
     throw new OperatorException(e.getMessage());
   }
   PluginContext context =
       ProMPluginContextManager.instance()
           .getFutureResultAwareContext(AlignmentAPNAnalyzerPlugin.class);
   XSEventStream stream = getStreamPort().getData(XSEventStreamIOObject.class).getArtifact();
   XLogArray arr = new XLogArray();
   for (InputPort i : referenceLogsPort.getManagedPorts()) {
     try {
       arr.add(i.getData(XLogIOObject.class).getArtifact());
     } catch (UserError e) {
     }
   }
   // TODO: use meta-data to process classifiers!
   List<XEventClassifier> classifiers = fetchClassifiers(arr);
   params.setClassifier(classifiers.get(0));
   List<XSEventStreamToAcceptingPetriNetReader> algos =
       new ArrayList<XSEventStreamToAcceptingPetriNetReader>();
   for (InputPort i : getAlgorithmsPort().getManagedPorts()) {
     try {
       algos.add(
           (XSEventStreamToAcceptingPetriNetReader)
               i.getData(XSEventStreamToAcceptingPetriNetReaderIOObject.class).getArtifact());
     } catch (UserError e) {
     }
   }
   XSStreamAnalyzer<
           XSEvent,
           Map<XSReader<XSEvent, AcceptingPetriNet>, Map<Long, Iterable<Iterable<Double>>>>,
           AcceptingPetriNet>
       analyzer =
           AlignmentAPNAnalyzerPlugin.run(
               context,
               stream,
               arr,
               params,
               algos.toArray(new XSEventStreamToAcceptingPetriNetReader[algos.size()]));
   getAnalyzerPort()
       .deliver(
           new XSStreamAnalyzerIOObject<
               XSEvent,
               Map<XSReader<XSEvent, AcceptingPetriNet>, Map<Long, Iterable<Iterable<Double>>>>,
               AcceptingPetriNet>(analyzer, context));
 }
コード例 #2
0
 public AlignmentAPNAnalyzerOperator(OperatorDescription description) {
   super(description, new AlignmentAnalyzerParametersImpl());
   referenceLogsPort.start();
 }