Examples of ICreateElements


Examples of org.openiaml.model.inference.ICreateElements

       
        // set up the sub progress monitor
        subProgressMonitor = new InfiniteSubProgressMonitor(monitor, 45);
       
        // to save memory, we only create the handler here, in this scope
        final ICreateElements handler = handlerFactory.createHandler(model);

        // allow for rules to override execution
        final OverridableCreateElementsHelper overridableHandler =
          new OverridableCreateElementsHelper(handler);
       
        // need to set up these variables before we insert the model,
        // otherwise the agenda cannot be built (as the rule heads use
        // {@link #getHelperFunctions()}).
        queue = new DroolsInsertionQueue(trackInsertions);
      workingMemory.setGlobal("handler", overridableHandler);
    workingMemory.setGlobal("queue", queue);
    workingMemory.setGlobal("functions", getHelperFunctions());   

        //go !
        workingMemory.insert( model );
        if (monitor.isCanceled()) {
          return;
        }
        subProgressMonitor.done();
        subProgressMonitor = null;
       
        monitor.subTask("Inferring new model elements");
       
        /*
         * This simply adds the Rule source for inserted elements
         * (where possible).
         */
        if (logRuleSource) {
          workingMemory.addEventListener(new DefaultWorkingMemoryEventListener() {
 
        @Override
        public void objectInserted(ObjectInsertedEvent event) {
          if (event.getObject() instanceof GeneratedElement) {
            GeneratedElement e = (GeneratedElement) event.getObject();
            try {
              handler.setGeneratedRule(e, event.getPropagationContext().getRuleOrigin().getName());
            } catch (InferenceException e1) {
              throw new RuntimeException(e1.getMessage(), e1);
            }
          }
        }
View Full Code Here

Examples of org.openiaml.model.inference.ICreateElements

        return Status.CANCEL_STATUS;
     
      monitor.subTask("Inferring contained elements");
     
      // we need a runtime handler to prevent 'cannot access transaction' errors
      ICreateElements handler = new EmfInferenceHandler(
          part.getEditingDomain(),
          new ArrayList<Object>(), /* affected files */
          new SubProgressMonitor(monitor, 14),
          null /* IAdapter == null */,
          container.eResource()  /* eResource */
 
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.