Package nexj.core.meta

Examples of nexj.core.meta.MetadataException


      {
         action.setType(Action.AROUND);
      }
      else
      {
         throw new MetadataException("err.meta.actionType", new Object[]{sType});
      }

      action.validate(m_metadata, m_helper.getWarnings());

      final String sRelativeName = XMLUtil.getStringAttr(actionElement, "relative");

      if (sRelativeName != null)
      {
         if (action.getType() == Action.MAIN)
         {
            throw new MetadataException("err.meta.relativeMainAction");
         }

         m_actionFixupList.add(new ContextFixup(m_helper)
         {
            public void fixup()
            {
               action.setNextAction(sRelativeName);
            }
         });
      }

      Lookup posMap = new IdentityHashTab();

      action.setCondition(m_helper.parse(XMLUtil.getStringAttr(actionElement, "condition"),
         false, posMap, Boolean.TRUE, m_metadata.getGlobalEnvironment()));

      String sMethodName = XMLUtil.getStringAttr(actionElement, "method");

      if (sMethodName != null)
      {
         int i = sMethodName.lastIndexOf('.');

         if (i < 0)
         {
            throw new MetadataException("err.meta.methodName", new Object[]{sMethodName});
         }

         if (!isRuntimeExcluded())
         {
            String sClassName = sMethodName.substring(0, i);
            sMethodName = sMethodName.substring(i + 1);
            Method[] methodArray;

            try
            {
               Class clazz = Class.forName(sClassName);
               methodArray = clazz.getMethods();
            }
            catch (Exception e)
            {
               throw new MetadataException("err.meta.classLoad", new Object[]{sClassName}, e);
            }

            Method method = null;

            for (i = 0; i < methodArray.length; ++i)
            {
               Method meth = methodArray[i];

               if (Modifier.isPublic(meth.getModifiers()) &&
                  meth.getName().equals(sMethodName))
               {
                  Class[] paramArray = meth.getParameterTypes();

                  if (paramArray.length == action.getEvent().getArgumentCount() + 2)
                  {
                     if (method != null)
                     {
                        throw new MetadataException("err.meta.javaMethodDup", new Object[]{sMethodName, sClassName});
                     }

                     method = meth;
                  }
               }
            }

            if (method == null)
            {
               throw new MetadataException("err.meta.javaMethodLookup",
                  new Object[]{sMethodName, sClassName});
            }

            action.setMethod(method);
         }
      }

      Object body = m_helper.parse(m_helper.getElementValue(actionElement),
         true, posMap, null, m_metadata.getGlobalEnvironment());

      if (body != null)
      {
         if (action.getMethod() != null)
         {
            throw new MetadataException("err.meta.scriptAndMethod", new Object[]{action.getName()});
         }

         action.setBody(body);
      }
View Full Code Here


         {
            final String sAssociation = XMLUtil.getStringAttr(enumerationElement, "association");

            if (sAssociation == null)
            {
               throw new MetadataException("err.meta.missingEnumAssoc", new Object[]{sEnumerationName});
            }

            final String sReverse = XMLUtil.getStringAttr(enumerationElement, "reverse");

            if (sReverse == null)
            {
               throw new MetadataException("err.meta.missingEnumReverse", new Object[]{sEnumerationName});
            }

            XMLMetadataHelper.validateName(sAssociation);

            m_attributeGenerationList.add(new ContextFixup(m_helper)
            {
               public void fixup()
               {
                  final Metaclass parentMetaclass = m_metadata.getMetaclass(sParentEnumeration);

                  final Attribute parentAttribute = new Attribute(sReverse);

                  parentAttribute.setMetaclass(metaclass);
                  parentAttribute.setDeclarator(metaclass);
                  parentAttribute.setType(parentMetaclass);
                  parentAttribute.setRequired(true);

                  metaclass.addAttribute(parentAttribute);

                  final Attribute childAttribute = new Attribute(sAssociation);

                  childAttribute.setMetaclass(parentMetaclass);
                  childAttribute.setDeclarator(parentMetaclass);
                  childAttribute.setType(metaclass);
                  childAttribute.setCollection(true);
                  childAttribute.setReverse(parentAttribute);

                  parentMetaclass.addAttribute(childAttribute);

                  m_persistenceMappingGenerationList.add(new ContextFixup(m_helper)
                  {
                     public void fixup()
                     {
                        copyAttributeMapping(parentAttribute, metaclass.getAttribute("parent"));
                        copyAttributeMapping(childAttribute, parentMetaclass.getAttribute("children"));
                     }

                     protected void copyAttributeMapping(Attribute dst, Attribute src)
                     {
                        PersistenceMapping mapping = src.getMetaclass().getPersistenceMapping();

                        if (mapping.getAttributeMapping(dst) != null)
                        {
                           return;
                        }

                        for (PersistenceMapping baseMapping = mapping;
                           baseMapping != null && baseMapping.isCompatible(mapping);
                           baseMapping = baseMapping.getBaseMapping())
                        {
                           Attribute attribute = baseMapping.getMetaclass().findAttribute(src.getName());

                           if (attribute != null)
                           {
                              AttributeMapping attributeMapping = baseMapping.getAttributeMapping(attribute);

                              if (attributeMapping != null)
                              {
                                 attributeMapping = (AttributeMapping)attributeMapping.clone();

                                 attributeMapping.setPersistenceMapping(mapping);
                                 attributeMapping.setAttribute(dst);

                                 ((ClassMapping)attributeMapping).setMapping(((Metaclass)dst.getType()).getPersistenceMapping());

                                 mapping.addAttributeMapping(attributeMapping);

                                 return;
                              }
                           }
                        }

                        throw new MetadataException("err.meta.enumAssociation",
                           new Object[]{src.getName(), src.getMetaclass().getName()});
                     }
                  });
               }
            });
         }

         final String sTypeCode = XMLUtil.getReqStringAttr(enumerationElement, "typeCode");

         m_inheritance1stPassFixupList.add(new ContextFixup(m_helper)
         {
            public void fixup()
            {
               Attribute attribute = null;

               for (PersistenceMapping mapping = metaclass.getPersistenceMapping();
                  mapping != null; mapping = mapping.getBaseMapping())
               {
                  attribute = mapping.getTypeCodeAttribute();

                  if (attribute != null)
                  {
                     attribute = metaclass.getDerivedAttribute(attribute);

                     break;
                  }
               }

               if (attribute == null)
               {
                  throw new MetadataException("err.meta.noTypeCodeAttribute",
                     new Object[]{metaclass.getName()});
               }

               attribute.setValue(attribute.getType().convert(sTypeCode));
            }
         });
      }

      if (m_bValidatedOnly)
      {
         XMLUtil.withFirstChildElement(enumerationElement, "Locales", false, new ElementHandler()
         {
            public void handleElement(Element localesElement)
            {
               final Set localeSet = new HashHolder();

               XMLUtil.forEachChildElement(localesElement, "Locale",
                  m_helper.new ElementHandler("locale")
               {
                  public void handleElement(Element localeElement, String sLocale)
                  {
                     if (!localeSet.add(sLocale))
                     {
                        throw new MetadataException("err.meta.enumLocaleDup",
                           new Object[]{sLocale, sEnumerationName});
                     }

                     XMLUtil.getReqStringAttr(localeElement, "caption");
                  }
               });
            }
         });
      }

      final Set valueSet = new HashHolder();
      m_enumerationValueMap.put(sEnumerationName, valueSet);

      XMLUtil.withFirstChildElement(enumerationElement, "Values", false, new ElementHandler()
      {
         public void handleElement(Element valuesElement)
         {
            final Set nameSet = new HashHolder();
            final Set behaveAsSet = new HashHolder();
            final Set externSet = new HashHolder();
            final List fixupList = new ArrayList();

            XMLUtil.forEachChildElement(valuesElement, "Value",
               m_helper.new ElementHandler("value")
            {
               public void handleElement(Element valueElement, String sName)
               {
                  XMLMetadataHelper.validateName(sName);

                  fixupList.add(sName);

                  if (!nameSet.add(sName))
                  {
                     throw new MetadataException("err.meta.enumValueNameDup",
                        new Object[]{sName, sEnumerationName});
                  }

                  final String sValue = XMLUtil.getReqStringAttr(valueElement, "value");

                  if (!valueSet.add(sValue))
                  {
                     throw new MetadataException("err.meta.enumValueDup",
                        new Object[]{sValue, sEnumerationName});
                  }

                  fixupList.add(sValue);

                  boolean bHasBehavior = XMLUtil.getBooleanAttr(valueElement, "hasBehavior", false);

                  fixupList.add(Boolean.valueOf(bHasBehavior));

                  String sBehaveAsValue = XMLUtil.getStringAttr(valueElement, "behaveAsValue");

                  if (sBehaveAsValue != null)
                  {
                     if (bHasBehavior)
                     {
                        if (!sBehaveAsValue.equals(sValue))
                        {
                           throw new MetadataException("err.meta.enumBehaveAsValueMismatch",
                              new Object[]{sBehaveAsValue, sValue, sEnumerationName});
                        }
                     }
                     else
                     {
                        if (sBehaveAsValue.equals(sValue))
                        {
                           throw new MetadataException("err.meta.enumInvalidSelfReference",
                              new Object[]{sValue, sEnumerationName});
                        }

                        behaveAsSet.add(sBehaveAsValue);
                     }
                  }

                  String sExternValue = XMLUtil.getStringAttr(valueElement, "externalValue");

                  if (sExternValue != null)
                  {
                     if (!externSet.add(sExternValue))
                     {
                        throw new MetadataException("err.meta.enumExternValueDup",
                           new Object[]{sExternValue, sEnumerationName});
                     }
                  }

                  final String sParentValue = XMLUtil.getStringAttr(valueElement, "parentValue");

                  if (sParentValue != null)
                  {
                     if (sParentEnumeration == null)
                     {
                        throw new MetadataException("err.meta.enumParentValue", new Object[]{sEnumerationName});
                     }

                     m_inheritanceFixupList.add(new ContextFixup(m_helper)
                     {
                        public void fixup()
                        {
                           Metaclass parent = m_metadata.getMetaclass(sParentEnumeration);

                           if (!((Set)m_enumerationValueMap.get(sParentEnumeration)).contains(parent.getAttribute("value").getType().convert(sParentValue)))
                           {
                              throw new MetadataLookupException("err.meta.enumParentValueLookup", sParentValue, sParentEnumeration);
                           }
                        }
                     });
                  }
                  else
                  {
                     if (sParentEnumeration != null)
                     {
                        throw new MetadataException("err.meta.enumNoParentValue", new Object[]{sValue, sEnumerationName});
                     }
                  }

                  if (m_bValidatedOnly)
                  {
                     XMLUtil.withFirstChildElement(valueElement, "Locales", false, new ElementHandler()
                     {
                        public void handleElement(Element localesElement)
                        {
                           final Set localeSet = new HashHolder();

                           XMLUtil.forEachChildElement(localesElement, "Locale",
                              m_helper.new ElementHandler("locale")
                           {
                              public void handleElement(Element localeElement, String sLocale)
                              {
                                 if (!localeSet.add(sLocale))
                                 {
                                    throw new MetadataException("err.meta.enumValueLocaleDup",
                                       new Object[]{sLocale, sValue, sEnumerationName});
                                 }

                                 XMLUtil.getReqStringAttr(localeElement, "caption");
                              }
                           });
                        }
                     });
                  }
               }
            });

            if (behaveAsSet.size() != 0)
            {
               // Remove the values that have no behavior
               for (int i = 0, n = fixupList.size(); i != n; i += 3)
               {
                  if (!((Boolean)fixupList.get(i + 2)).booleanValue())
                  {
                     valueSet.remove(fixupList.get(i + 1));
                  }
               }

               for (Iterator itr = behaveAsSet.iterator(); itr.hasNext();)
               {
                  String sValue = (String)itr.next();

                  if (!valueSet.contains(sValue))
                  {
                     throw new MetadataLookupException("err.meta.enumBehaveAsValueLookup",
                        sValue, sEnumerationName);
                  }
               }
            }

            valueSet.clear();

            m_attributeGenerationList.add(new ContextFixup(m_helper)
            {
               public void fixup()
               {
                  Primitive type = null;

                  for (Metaclass base = ((metaclass == null) ?
                     m_metadata.getMetaclass(sEnumerationName) : metaclass).getBase();
                     base != null; base = base.getBase())
                  {
                     Attribute attribute = base.findAttribute("value");

                     if (attribute != null)
                     {
                        if (!attribute.getType().isPrimitive())
                        {
                           throw new MetadataException("err.meta.enumBaseValueType",
                              new Object[]{base.getName(), sEnumerationName});
                        }

                        if (attribute.isStatic())
                        {
                           throw new MetadataException("err.meta.enumBaseValueScope",
                              new Object[]{base.getName(), sEnumerationName});
                        }

                        type = (Primitive)attribute.getType();

                        break;
                     }
                  }

                  if (type == null)
                  {
                     throw new MetadataException("err.meta.enumBaseValue", new Object[]{sEnumerationName});
                  }

                  for (int i = 0, n = fixupList.size(); i != n; i += 3)
                  {
                     Object value = fixupList.get(i + 1);

                     if (type != Primitive.STRING)
                     {
                        value = type.convert(value);
                     }

                     if (!valueSet.add(value))
                     {
                        throw new MetadataException("err.meta.enumValueDup",
                           new Object[]{value, sEnumerationName});
                     }

                     if (metaclass != null && ((Boolean)fixupList.get(i + 2)).booleanValue())
                     {
View Full Code Here

      }

      if (flow instanceof Workflow && !macro.isWorkflowCompatible() ||
         flow instanceof Service && !macro.isServiceCompatible())
      {
         throw new MetadataException("err.meta." + flow.getPropName() + ".incompatibleMacro",
            new Object[]{macro.getName(), flow.getFullName()});
      }

      FlowMacroScript script = new FlowMacroScript(sStepName);

      script.setActivity(activity);
      script.setMacro(macro);

      NamedNodeMap attributeMap = stepElement.getAttributes();
      Set attributeSet = new HashHolder(attributeMap.getLength());

      for (int i = 0; i < attributeMap.getLength(); ++i)
      {
         attributeSet.add(attributeMap.item(i).getNodeName());
      }

      Object[] args = new Object[macro.getArgumentCount()];

      for (int i = 0, n = macro.getArgumentCount(); i < n; ++i)
      {
         FlowMacro.Argument arg = macro.getArgument(i);
         String sValue = stepElement.getAttribute(arg.getName());

         if (arg.getType() == null || arg.getType() == Primitive.ANY)
         {
            Object value = helper.parse(sValue, arg.getType() == null,
               flow.getPosMap(), Undefined.VALUE,
               machine.getGlobalEnvironment());

            if (bFull)
            {
               script.setArgumentValue(i, value);
            }

            args[i] = (value == Undefined.VALUE) ? arg.getDefault() : value;
         }
         else
         {
            if (sValue == null)
            {
               args[i] = arg.getDefault();

               if (bFull)
               {
                  script.setArgumentValue(i, Undefined.VALUE);
               }
            }
            else
            {
               args[i] = arg.getType().convert(sValue);

               if (bFull)
               {
                  script.setArgumentValue(i, args[i]);
               }
            }
         }

         if (args[i] == Undefined.VALUE)
         {
            throw new MetadataException("err.meta." + flow.getPropName() + ".missingMacroArg",
               new Object[]{arg.getName(), macro.getName(), flow.getFullName()});
         }

         attributeSet.remove(arg.getName());
      }

      attributeSet.remove("name");
      attributeSet.remove("caption");
      attributeSet.remove("description");
      attributeSet.remove("layout");

      if (attributeSet.size() != 0)
      {
         throw new MetadataException("err.meta." + flow.getPropName() + ".macroArgLookup",
            new Object[]{attributeSet.iterator().next(), macro.getName(), flow.getFullName()});
      }

      script.setBody(new Pair(machine.invoke(macro.getFunction(), args)));
View Full Code Here

         {
            nVersion = Integer.parseInt(sWorkflowName.substring(i + 1));
         }
         catch (NumberFormatException e)
         {
            throw new MetadataException("err.meta.workflow.version", new Object[]{sWorkflowName.substring(i + 1)}, e);
         }

         sWorkflowName = sWorkflowName.substring(0, i);
      }
View Full Code Here

      if (XMLUtil.getStringAttr(element, "args") != null ||
         XMLUtil.getStringAttr(element, "association") != null ||
         XMLUtil.getStringAttr(element, "condition") != null)
      {
         throw new MetadataException("err.meta.workflow.actionEventAttributes");
      }

      return false;
   }
View Full Code Here

            if (sElement.equals("TimerEvent"))
            {
               if (m_bTimer)
               {
                  throw new MetadataException("err.meta.workflow.multipleQueueTimers",
                     new Object[]{assignment.getName()});
               }

               Timeout timeout = new Timeout();

               timeout.setActivity(activity);
               timeout.setValue(m_helper.parse(XMLUtil.getReqStringAttr(eventElement, "value"),
                  false, activity.getFlow().getPosMap(), null, m_metadata.getGlobalEnvironment()));
               activity.addStep(timeout);

               Wait wait = new Wait(timeout);

               timeout.setNext(wait);
               activity.addStep(wait);

               m_bTimer = true;
            }
            else if (sElement.equals("ClassEvent"))
            {
               AutoCompletion completion = new AutoCompletion(assignment);

               loadWorkflowHandler(eventElement, completion, activity.getFlow());
               activity.addStep(completion);
            }
            else if (sElement.equals("ManualEvent"))
            {
               Object condition = m_helper.parse(XMLUtil.getStringAttr(eventElement, "condition"),
                  false, assignment.getActivity().getFlow().getPosMap(),
                  Boolean.TRUE, m_metadata.getGlobalEnvironment());
               boolean bTarget = loadTarget(eventElement, assignment, condition, sEventName, false);
               Element first = XMLUtil.findFirstElement(child);

               if (first != null && first.getNodeName().equals("UIAction"))
               {
                  loadTarget(first, assignment, condition, sEventName, bTarget);
                  child = first.getNextSibling();
               }

               if (assignment.getManualCompletion() == null)
               {
                  ManualCompletion completion = new ManualCompletion(assignment);

                  activity.addStep(completion);
               }
               else
               {
                  activity = null;
               }
            }
            else if (sElement.equals("ProcessEvent"))
            {
               branch = new Branch();
               decision.addBranch(branch);

               assignment.setSemaphore(true);

               Semaphore semaphore = new Semaphore(assignment.getName() + ":Semaphore", assignment);

               semaphore.setActivity(activity);
               activity.addStep(semaphore);

               Block block = new Block();

               block.setActivity(branch);
               branch.addStep(block);
               loadActivity(child, block.getContainedActivity());
               block.setCleanupCode(semaphore.getExitCode());
            }
            else
            {
               throw new MetadataException("err.meta.workflow.invalidQueueElement",
                  new Object[]{sElement, assignment.getName()});
            }

            if (eventMap.put(sEventName, Boolean.TRUE) != null)
            {
               throw new MetadataException("err.meta.workflow.queueEventDup",
                  new Object[]{sEventName, assignment.getName()});
            }

            Variable var = assignment.getActivity().getFlow().findVariable(assignment.getName());

            if (var == null)
            {
               var = new Variable(assignment.getName());
               assignment.getActivity().getFlow().addVariable(var);
            }

            if (activity != null)
            {
               Object code;

               if (activity.getStep(0) instanceof ManualCompletion)
               {
                  // ((:state'bind ('<assignment>'targetFunction)) '() (:flow'getToken <step>))
                  code =
                     Pair.list(
                        Pair.list(Symbol._STATE, Pair.quote(Symbol.BIND),
                           Pair.list(Pair.quote(assignment), Pair.quote(Symbol.TARGETFUNCTION))),
                        null,
                        Pair.list(Symbol._FLOW, Pair.quote(Symbol.GETTOKEN), Pair.quote(activity.getStep(0))));
               }
               else
               {
                  code = sEventName;
               }

               Script script = new Script();

               script.setBody(Pair.list(Pair.list(Symbol.SET, var.getSymbol(), code)));
               activity.addStep(script);
               fork.addConcurrent(activity);
            }

            if (branch == null)
            {
               branch = new Branch();
               decision.addBranch(branch);
               loadActivity(child, branch);
            }

            branch.setCondition(Pair.list(Symbol.EQUAL_P, var.getSymbol(), sEventName));
         }
      });

      if (fork.getConcurrentCount() == 0)
      {
         throw new MetadataException("err.meta.workflow.eventlessQueue",
            new Object[]{assignment.getName()});
      }

      if (fork.getConcurrentCount() == 1)
      {
View Full Code Here

         return false;
      }

      if (bCheckDup)
      {
         throw new MetadataException("err.meta.workflow.superfluousUIAction",
            new Object[]{assignment.getName()});
      }

      String sMode = XMLUtil.getStringAttr(element, "uimode", "modeless");
      int nMode;

      if (sMode.equals("modal"))
      {
         nMode = Assignment.MODAL;
      }
      else if (sMode.equals("modeless"))
      {
         nMode = Assignment.MODELESS;
      }
      else if (sMode.equals("sdi"))
      {
         nMode = Assignment.SDI;
      }
      else
      {
         throw new MetadataException("err.meta.uimode", new Object[]{sMode});
      }

      assignment.addTarget(condition, sTarget, sForm, nMode, sBranch);

      return true;
View Full Code Here

               {
                  join.setAny(true);
               }
               else
               {
                  throw new MetadataException("err.meta.workflow.joinType",
                     new Object[]{sType, activity.getFlow().getFullName()});
               }

               XMLUtil.forEachChildElement(element, "Activity", new ElementHandler()
               {
                  public void handleElement(Element activityElement)
                  {
                     Concurrent concurrent = new Concurrent();

                     concurrent.setFork(fork);
                     loadActivity(activityElement.getFirstChild(), concurrent);
                     fork.addConcurrent(concurrent);
                  }
               });

               activity.addStep(fork);
               step = join;
            }
            else if (sElement.equals("Assignment"))
            {
               Flow workflow = activity.getFlow();
               Assignment assignment = new Assignment(sStepName);

               assignment.setActivity(activity);
               assignment.setQueue(parseQueueName(XMLUtil.getStringAttr(element, "queue"), activity, m_machine));
               assignment.setPriority(m_helper.parse(XMLUtil.getStringAttr(element, "priority"),
                  false, workflow.getPosMap(), assignment.getPriority(), m_metadata.getGlobalEnvironment()));
               assignment.setAssignee(m_helper.parse(XMLUtil.getStringAttr(element, "assignee"),
                  false, workflow.getPosMap(), assignment.getAssignee(), m_metadata.getGlobalEnvironment()));
               assignment.setOwner(m_helper.parse(XMLUtil.getStringAttr(element, "owner"),
                  false, workflow.getPosMap(), assignment.getOwner(), m_metadata.getGlobalEnvironment()));
               assignment.setCaption(m_helper.parse(XMLUtil.getStringAttr(element, "title"),
                  false, workflow.getPosMap(), XMLUtil.getStringAttr(element, "caption"),
                  m_metadata.getGlobalEnvironment()));
               assignment.setFactory((Pair)m_helper.parse(XMLUtil.getStringAttr(element, "factory"),
                  true, workflow.getPosMap(), assignment.getFactory(),
                  m_metadata.getGlobalEnvironment()));

               boolean bTarget = loadTarget(element, assignment, Boolean.TRUE, null, false);

               activity.addStep(assignment);

               if (isWorkflowHandler(element))
               {
                  AutoCompletion unassignment = new AutoCompletion(assignment);

                  loadWorkflowHandler(element, unassignment, workflow);
                  step = unassignment;
               }
               else
               {
                  step = new ManualCompletion(assignment);
               }

               nextElement = XMLUtil.findFirstElement(element.getNextSibling());

               if (nextElement != null)
               {
                  if (nextElement.getNodeName().equals("UIAction"))
                  {
                     loadTarget(element, assignment, Boolean.TRUE, null, bTarget);
                  }
                  else
                  {
                     nextElement = null;
                  }
               }

               assignment.setNext(step);
            }
            else if (sElement.equals("Semaphore"))
            {
               step = loadSemaphore(element, sStepName, activity, m_machine, new ActivityLoader()
               {
                  public void loadActivity(Element element, Activity activity)
                  {
                     XMLMetadataLoader.this.loadActivity(element.getFirstChild(), activity);
                  }
               });
            }
            else if (sElement.equals("Goto"))
            {
               step = new Goto();
               step.setActivity(activity);
            }
            else if (sElement.equals("Queue"))
            {
               final Flow workflow = activity.getFlow();
               Assignment assignment = new Assignment(sStepName);

               assignment.setActivity(activity);
               assignment.setQueue(parseQueueName(XMLUtil.getStringAttr(element, "queue"), activity, m_machine));
               assignment.setPriority(m_helper.parse(XMLUtil.getStringAttr(element, "priority"),
                  false, workflow.getPosMap(), assignment.getPriority(), m_metadata.getGlobalEnvironment()));
               assignment.setAssignee(m_helper.parse(XMLUtil.getStringAttr(element, "assignee"),
                  false, workflow.getPosMap(), assignment.getAssignee(), m_metadata.getGlobalEnvironment()));
               assignment.setOwner(m_helper.parse(XMLUtil.getStringAttr(element, "owner"),
                  false, workflow.getPosMap(), assignment.getOwner(), m_metadata.getGlobalEnvironment()));
               assignment.setCaption(m_helper.parse(XMLUtil.getStringAttr(element, "title"),
                  false, workflow.getPosMap(), XMLUtil.getStringAttr(element, "caption"),
                  m_metadata.getGlobalEnvironment()));
               assignment.setFactory((Pair)m_helper.parse(XMLUtil.getStringAttr(element, "factory"),
                  true, workflow.getPosMap(), assignment.getFactory(),
                  m_metadata.getGlobalEnvironment()));

               activity.addStep(assignment);
               step = loadQueue(element, assignment);
            }
            else if (sElement.equals("UIAction"))
            {
               m_helper.restoreMarker(nCookie);
               throw new MetadataException("err.meta.workflow.misplacedElement",
                  new Object[]{sElement, activity.getFlow().getFullName()});
            }
            else
            {
               step = loadFlowMacroScript(element, sStepName, activity);

               if (step == null)
               {
                  m_helper.restoreMarker(nCookie);
                  throw new MetadataException("err.meta.workflow.invalidElement",
                     new Object[]{sElement, activity.getFlow().getFullName()});
               }
            }

            final String sNextStepName = XMLUtil.getStringAttr(element, "next");
View Full Code Here

         for (int i = 0; i < xsdMsgArray.length; i++)
         {
            if (messageMap.put(xsdMsgArray[i].getName(), xsdMsgArray[i]) != null)
            {
               throw new MetadataException("err.meta.messageDup",
                  new Object[]
                  {
                     xsdMsgArray[i].getName(),
                     m_metadata.getName()
                  }
               );
            }
         }
      }
      catch (IOException ex)
      {
         throw new MetadataException("err.meta.resourceOpen", new Object[] {sName}, ex);
      }
   }
View Full Code Here

      {
         message.setDerivation(Message.DERIVATION_ABSTRACT);
      }
      else
      {
         throw new MetadataException("err.meta.integration.messageDerivation",
            new Object[] {sDerivation, message.getName()});
      }

      final String sBaseMessage = XMLUtil.getStringAttr(messageElement, "base");
View Full Code Here

TOP

Related Classes of nexj.core.meta.MetadataException

Copyright © 2018 www.massapicom. 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.