コード例 #1
0
 /* (non-Javadoc)
  * @see ie.deri.wsmx.asm.State#add(org.omwg.logicalexpression.AttributeValueMolecule)
  */
 public void add(AttributeValueMolecule fact) {
   facts.add(
       cFactory.facts.createMoleculeFact(
           new HashSet<MembershipMolecule>(),
           new HashSet<AttributeValueMolecule>(
               Arrays.asList(new AttributeValueMolecule[] {fact}))));
   Axiom axiom =
       factory.createAxiom(
           factory.createIRI(
               "http://www.wsmx.org/choreography/state/attribute" + attributeCounter++));
   axiom.addDefinition(fact);
   try {
     logger.debug("Adding AVM axiom: " + fact);
     axioms.put(fact, axiom);
     state.addAxiom(axiom);
   } catch (SynchronisationException e) {
     logger.warn("Failed to add attribute value to state.", e);
   } catch (InvalidModelException e) {
     logger.warn("Failed to add attribute value to state.", e);
   }
   for (StateModificationListener listener : listeners) {
     listener.addedAttribute(this, fact);
   }
 }