Exemplo n.º 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());
      * }
      */
   }
 }
Exemplo n.º 2
0
 private UmlStateMachine getStatemachineByName(final String statemachineName) {
   for (final UmlStateMachine machine : stateMachineMap.values()) {
     if (!statemachineName.equals(machine.getName())) {
       continue;
     }
     return machine;
   }
   final UmlStateMachine unknown = new UmlStateMachine(statemachineName);
   unknown.setId(Integer.MAX_VALUE - SRLEventReader.unknownIdCnt);
   SRLEventReader.unknownIdCnt++;
   stateMachineMap.put(statemachineName, unknown);
   return unknown;
 }