Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.sdmlib.models.taskflows;
 
 import java.util.Timer;
 
 import  org.junit.Test;
public class TaskFlowModel
   private static final String STRING = "String";
   @Test
   public void taskFlowModel()
   {
      Storyboard storyboard = new Storyboard("src/main/replication");
      ClassModel model = new ClassModel("org.sdmlib.models.taskflows");
      Clazz taskFlowClass = model.createClazz("TaskFlow")
            .withAttribute("taskNo".)
            .withAttribute("idMap", DataType.ref(SDMLibJsonIdMap.class));
      taskFlowClass.withAssoc(taskFlowClass"subFlow"."parent".);
      model.createClazz("PeerProxy")
      .withAttribute("ip".)
      .withAttribute("port".)
      .withAttribute("idMap", DataType.ref(SDMLibJsonIdMap.class));
      model.createClazz("SocketThread")
      .withAttribute("ip".)
      .withAttribute("port".)
      .withAttribute("idMap", DataType.ref(SDMLibJsonIdMap.class))
      .withAttribute("defaultTargetThread".);
      model.createClazz("FetchFileFlow")
      .withAttribute("fileServer", DataType.ref(PeerProxy.class))
      .withAttribute("fileName".)
      .withSuperClazz(taskFlowClass)
      .withMethod("run".);
      Clazz loggerClazz = model.createClazz("Logger")
            .withAttribute("startPeer", DataType.ref(PeerProxy.class))
            .withSuperClazz(taskFlowClass);
      Clazz logEntryClass = model.createClazz("LogEntry")
            .withAttribute("nodeName".)
            .withAttribute("taskName".);
            
      loggerClazz.withAssoc(logEntryClass"entries"."logger".);
      logEntryClass.withAssoc(logEntryClass"children"."parent".);
      Clazz timerClass = model.createClazz(Timer.class.getName())
            .withExternal(true);
      model.createClazz("SDMTimer")
      .withSuperClazz(timerClass);
      // .withMethod("schedule", DataType.VOID, new Parameter(DataType.ref(TimerTask.class)));
      storyboard.addClassDiagram(model);
      model.generate("src/main/replication");
      storyboard.addToDo("WrapExistingClasses""backlog""zuendorf",
         "02.11.2012 13:42:42", 5, 0);
      storyboard.addToDo("SortIndex""done""zuendorf",
         "01.11.2012 14:43:42", 1, 0);
      storyboard.dumpHTML();
   }
New to GrepCode? Check out our FAQ X