Beispiel #1
0
void UmlState::solve(int context, Q3CString idref) {
  QMap<Q3CString, UmlItem *>::Iterator it = All.find(idref);
  
  if (it == All.end()) {
    if (!FileIn::isBypassedId(idref))
      UmlCom::trace("state : unknown reference '" + idref + "'<br>");
  }
  else if ((*it)->kind() == anOperation) {
    if (context == 3)
      set_Specification((UmlOperation *) *it);
    else {
      Q3CString b = (*it)->name() + "()";
      
      switch(context) {
      case 0:
	set_EntryBehavior(b);
	break;
      case 1:
	set_ExitBehavior(b);
	break;
      default:
	set_DoActivity(b);
	break;
      }
    }
  }
  else if (((*it)->kind() == aState) && (context == 4))
    set_Reference((UmlState *) *it);
}
Beispiel #2
0
void UmlState::importActivity(FileIn & in, Token & token)
{
    WrapperStr k = token.what();
    const char * kstr = k;
    WrapperStr b = token.valueOf("body");

    if (b.isEmpty()) {
        if (! token.closed()) {
            while (in.read(), !token.close(kstr)) {
                WrapperStr s = token.what();

                if (s == "body") {
                    b = in.body("body");
                    in.finish(k);
                    break;
                }
                else if ((s == "node") &&
                         (token.xmiType() == "uml:CallOperationAction")) {
                    s = token.valueOf("operation");

                    if (! s.isEmpty()) {
                        if (k == "entry")
                            UnresolvedWithContext::add(this, s, 0);
                        else if (k == "exit")
                            UnresolvedWithContext::add(this, s, 1);
                        else
                            UnresolvedWithContext::add(this, s, 2);
                    }

                    if (! token.closed())
                        in.finish("node");

                    in.finish(k);
                    return;
                }
                else if (! token.closed())
                    in.finish(s);
            }
        }
    }
    else if (! token.closed())
        in.finish(k);

    if (! b.isEmpty()) {
        if (k == "entry")
            set_EntryBehavior(b);
        else if (k == "exit")
            set_ExitBehavior(b);
        else
            set_DoActivity(b);
    }

}