예제 #1
0
 private void getStateMachineMap() {
   if (stateMachineMap == null) {
     return;
   }
   for (final UmlStateMachine machine : stateMachineMap.values()) {
     client.eventRead(
         new StateMachineArtifactInfo(
             machine.getId(),
             machine.getName(),
             EventFactory.STATE_MACHINE_EVENT_TYPE_ID,
             new FieldValues()));
     for (final UmlState state : machine.getStates()) {
       int parentId = -1;
       if (state.getParent() == null) {
         parentId = machine.getId();
       } else {
         parentId = state.getParent().getId();
       }
       client.eventRead(
           new StateArtifactInfo(
               state.getId(),
               state.getName(),
               parentId,
               EventFactory.STATE_EVENT_TYPE_ID,
               new FieldValues()));
     }
     /*
      * for (final UmlTransition trans : machine.getTransitions()) {
      * bin.writeInt(trans.getSource()); bin.writeInt(trans.getTarget());
      * }
      */
   }
 }
예제 #2
0
  private UmlState getStateByName(final String stateName, final UmlStateMachine machine) {
    if (stateName == null) {
      return null;
    }
    for (final UmlState state : machine.getStates()) {
      if (stateName.equals(state.getName())) {
        return state;
      }
    }

    final UmlState state = new UmlState(stateName, machine, 0);
    state.setId(Integer.MAX_VALUE - SRLEventReader.unknownIdCnt);
    SRLEventReader.unknownIdCnt++;
    machine.add(state);
    return state;
  }