Add Flow States.

pull/1/head
Ivan Olexyn 5 years ago
parent 1a6c687f67
commit 5711f03b44

@ -3,7 +3,6 @@ package com.olexyn.ensync;
import com.olexyn.ensync.artifacts.SyncDirectory; import com.olexyn.ensync.artifacts.SyncDirectory;
import com.olexyn.ensync.artifacts.SyncEntity; import com.olexyn.ensync.artifacts.SyncEntity;
import java.io.File;
import java.util.*; import java.util.*;
public class Main { public class Main {
@ -34,51 +33,8 @@ public class Main {
syncDirectory.updatePoolNew(); syncDirectory.updatePoolNew();
// //
for (File createdFile : syncDirectory.getListCreated()) {
for (Map.Entry<String, SyncDirectory> otherEntry : syncEntity.syncDirectories.entrySet()) {
SyncDirectory otherSyncDirectory = otherEntry.getValue();
if (!syncDirectory.equals(otherSyncDirectory)){
// Example:
// syncDirectory /foo
// otherSyncDirectory /bar
// createdFile /foo/hello/created-file.gif
// relativePath /hello/created-file.gif
String relativePath = createdFile.getPath().replace(syncDirectory.realPath, "");
String targetPath = otherSyncDirectory.realPath + relativePath;
String targetParentPath = new File(targetPath).getParent();
if (!new File(targetParentPath).exists()){
String[] cmd = new String[]{"mkdir",
"-p",
targetParentPath};
x.execute(cmd);
}
String[] cmd = new String[]{"cp",
createdFile.getPath(),
otherSyncDirectory.realPath + relativePath};
x.execute(cmd);
}
}
}
//
for (File deletedFile : syncDirectory.getListDeleted()) {
for (Map.Entry<String, SyncDirectory> otherEntry : syncEntity.syncDirectories.entrySet()) {
SyncDirectory otherSyncDirectory = otherEntry.getValue();
if (!syncDirectory.equals(otherSyncDirectory)){
String relativePath = deletedFile.getPath().replace(syncDirectory.realPath, "");
String[] cmd = new String[]{"rm", "-r",
otherSyncDirectory.realPath + relativePath};
x.execute(cmd);
}
}
}
syncDirectory.doSyncOps();
// //
@ -88,7 +44,7 @@ public class Main {
// -> create newFile -> update StateFileNew-> getListCreated contains newFile -> addToMapCreated -> create copies as needed -> updateStateFileOld -> OK // -> create newFile -> update StateFileNew-> getListCreated contains newFile -> addToMapCreated -> create copies as needed -> updateStateFileOld -> OK
// -> create newFile -> update StateFileOld -> getListDeletd contains newFile -> VERY BAD // -> create newFile -> update StateFileOld -> getListDeletd contains newFile -> VERY BAD
// //
syncDirectory.updateStateFileBoth(); syncDirectory.updateStateFileOld();
syncDirectory.updatePoolBoth(); syncDirectory.updatePoolBoth();

@ -0,0 +1,29 @@
package com.olexyn.ensync.artifacts;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
public class StateFile {
private final String[] types = new String[]{ "OLD" , "NEW"};
public String stateFilePath;
public File stateFileOld;
private Map<String, File> poolOld = new HashMap<>();
public StateFile(){
}
public void update(){
}
}

@ -1,12 +1,10 @@
package com.olexyn.ensync.artifacts; package com.olexyn.ensync.artifacts;
import com.olexyn.ensync.Execute;
import com.olexyn.ensync.Tools; import com.olexyn.ensync.Tools;
import java.io.File; import java.io.File;
import java.util.ArrayList; import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class SyncDirectory { public class SyncDirectory {
@ -20,9 +18,15 @@ public class SyncDirectory {
private Map<String, File> poolNew = new HashMap<>(); private Map<String, File> poolNew = new HashMap<>();
private List<File> listCreated = new ArrayList<>(); private List<File> listCreated = new ArrayList<>();
private List<File> listDeleted = new ArrayList<>(); private List<File> listDeleted = new ArrayList<>();
private SyncEntity syncEntity;
private String state = null;
// For an explanation of what the STATES mean, see the flow.png
private final List<String> STATES = new ArrayList<>(Arrays.asList( "NEW-1", "LIST-1" , "LIST-2" , "SYNC-1" , "NEW-2", "OLD-1"));
Tools tools = new Tools(); Tools tools = new Tools();
Execute x = new Execute();
/** /**
* Create a SyncDirectory from realPath. * Create a SyncDirectory from realPath.
@ -30,7 +34,9 @@ public class SyncDirectory {
* @param realPath * @param realPath
* @see SyncEntity * @see SyncEntity
*/ */
public SyncDirectory(String realPath) { public SyncDirectory(String realPath, SyncEntity syncEntity) {
this.realPath = realPath; this.realPath = realPath;
stateFileBasePath = "/tmp/find" + this.realPath.replace("/", "-"); stateFileBasePath = "/tmp/find" + this.realPath.replace("/", "-");
stateFileOldPath = stateFileBasePath + "-old"; stateFileOldPath = stateFileBasePath + "-old";
@ -39,6 +45,7 @@ public class SyncDirectory {
stateFileNew = getStateFileNew(); stateFileNew = getStateFileNew();
poolOld = getPoolOld(); poolOld = getPoolOld();
poolNew = getPoolNew(); poolNew = getPoolNew();
this.syncEntity = syncEntity;
} }
@ -61,9 +68,13 @@ public class SyncDirectory {
* WRITE a new StateFileNew to Disk. This is IMPORTANT in order to make sure that StateFileOld is NEVER newer than StateFileNew.<p> * WRITE a new StateFileNew to Disk. This is IMPORTANT in order to make sure that StateFileOld is NEVER newer than StateFileNew.<p>
* WRITE a new StateFileOld to Disk. * WRITE a new StateFileOld to Disk.
*/ */
public void updateStateFileBoth() { public void updateStateFileOld() {
// //
tools.generateStateFile(realPath, stateFileNewPath); if (state.equals(STATES.get(4))){
state = STATES.get(5);
} else {
return ;
}
tools.generateStateFile(realPath, stateFileOldPath); tools.generateStateFile(realPath, stateFileOldPath);
} }
@ -81,7 +92,19 @@ public class SyncDirectory {
*/ */
public void updateStateFileNew() { public void updateStateFileNew() {
// //
if (state == null || state.equals(STATES.get(5))){
state = STATES.get(0);
}else if (state.equals(STATES.get(3))){
state = STATES.get(4);
} else {
return;
}
tools.generateStateFile(realPath, stateFileNewPath); tools.generateStateFile(realPath, stateFileNewPath);
} }
@ -118,17 +141,89 @@ public class SyncDirectory {
} }
public List<File> getListCreated() { public List<File> getListCreated() {
if (state.equals(STATES.get(0))){
listCreated = tools.mapMinus(getPoolNew(), getPoolOld()); state = STATES.get(1);
} else {
return null;
}
updateListCreated();
return listCreated; return listCreated;
} }
public List<File> getListDeleted() { public void updateListCreated(){
if (state.equals(""))
listCreated = tools.mapMinus(getPoolNew(), getPoolOld());
}
public List<File> getListDeleted() {
if (state.equals(STATES.get(1))){
state = STATES.get(2);
} else {
return null;
}
listDeleted = tools.mapMinus(getPoolOld(), getPoolNew()); listDeleted = tools.mapMinus(getPoolOld(), getPoolNew());
return listDeleted; return listDeleted;
} }
public void doSyncOps(){
if (state.equals(STATES.get(2))){
state = STATES.get(3);
} else {
return ;
}
for (File createdFile : this.getListCreated()) {
for (Map.Entry<String, SyncDirectory> otherEntry : syncEntity.syncDirectories.entrySet()) {
SyncDirectory otherSyncDirectory = otherEntry.getValue();
if (!this.equals(otherSyncDirectory)){
// Example:
// syncDirectory /foo
// otherSyncDirectory /bar
// createdFile /foo/hello/created-file.gif
// relativePath /hello/created-file.gif
String relativePath = createdFile.getPath().replace(this.realPath, "");
String targetPath = otherSyncDirectory.realPath + relativePath;
String targetParentPath = new File(targetPath).getParent();
if (!new File(targetParentPath).exists()){
String[] cmd = new String[]{"mkdir",
"-p",
targetParentPath};
x.execute(cmd);
}
String[] cmd = new String[]{"cp",
createdFile.getPath(),
otherSyncDirectory.realPath + relativePath};
x.execute(cmd);
}
}
}
//
for (File deletedFile : this.getListDeleted()) {
for (Map.Entry<String, SyncDirectory> otherEntry : syncEntity.syncDirectories.entrySet()) {
SyncDirectory otherSyncDirectory = otherEntry.getValue();
if (!this.equals(otherSyncDirectory)){
String relativePath = deletedFile.getPath().replace(this.realPath, "");
String[] cmd = new String[]{"rm", "-r",
otherSyncDirectory.realPath + relativePath};
x.execute(cmd);
}
}
}
}
} }

@ -25,7 +25,6 @@ public class SyncEntity {
*/ */
public SyncEntity(String name) { public SyncEntity(String name) {
this.name = name; this.name = name;
} }
/** /**
@ -38,7 +37,7 @@ public class SyncEntity {
*/ */
public void addDirectory(String realPath) { public void addDirectory(String realPath) {
if (new File(realPath).isDirectory()) { if (new File(realPath).isDirectory()) {
syncDirectories.put(realPath, new SyncDirectory(realPath)); syncDirectories.put(realPath, new SyncDirectory(realPath, this));
} }
} }

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<diagram program="umlet" version="13.3">
<zoom_level>10</zoom_level>
<element>
<id>UMLClass</id>
<coordinates>
<x>20</x>
<y>20</y>
<w>340</w>
<h>50</h>
</coordinates>
<panel_attributes>SyncEntity
--
Map&lt;SyncDirectory&gt; directories
halign=left</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>520</x>
<y>110</y>
<w>230</w>
<h>200</h>
</coordinates>
<panel_attributes>SyncDirectory
--
String realPath
String stateFileBasePath
File stateFileOld
File stateFileNew
Map&lt;String,File&gt; poolOld
Map&lt;String,File&gt; poolNew
List&lt;String&gt; listCreated
List&lt;String&gt; listDeleted
halign=left</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>350</x>
<y>50</y>
<w>190</w>
<h>90</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>170.0;70.0;10.0;10.0</additional_attributes>
</element>
</diagram>

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

@ -4,585 +4,497 @@
<element> <element>
<id>UMLClass</id> <id>UMLClass</id>
<coordinates> <coordinates>
<x>250</x> <x>1350</x>
<y>120</y> <y>1220</y>
<w>140</w> <w>130</w>
<h>40</h> <h>60</h>
</coordinates> </coordinates>
<panel_attributes>File System <panel_attributes>StateFileOld
halign=left</panel_attributes> bg=yellow
halign=left
group=1</panel_attributes>
<additional_attributes/> <additional_attributes/>
</element> </element>
<element>
<id>Relation</id>
<coordinates>
<x>310</x>
<y>150</y>
<w>160</w>
<h>280</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>140.0;260.0;10.0;10.0</additional_attributes>
</element>
<element> <element>
<id>UMLClass</id> <id>UMLClass</id>
<coordinates> <coordinates>
<x>100</x> <x>1480</x>
<y>580</y> <y>1220</y>
<w>120</w> <w>130</w>
<h>60</h> <h>30</h>
</coordinates> </coordinates>
<panel_attributes>Collection of <panel_attributes>StateFileNew
Accepted bg=green
State Files halign=left
halign=left</panel_attributes> group=1</panel_attributes>
<additional_attributes/> <additional_attributes/>
</element> </element>
<element> <element>
<id>UMLState</id> <id>UMLClass</id>
<coordinates> <coordinates>
<x>370</x> <x>1480</x>
<y>410</y> <y>1250</y>
<w>170</w> <w>130</w>
<h>40</h> <h>30</h>
</coordinates> </coordinates>
<panel_attributes>User initiates a <panel_attributes>ListDeleted
File System update. halign=left
halign=left</panel_attributes> group=1</panel_attributes>
<additional_attributes/> <additional_attributes/>
</element> </element>
<element> <element>
<id>Relation</id> <id>UMLClass</id>
<coordinates> <coordinates>
<x>210</x> <x>1350</x>
<y>590</y> <y>1040</y>
<w>180</w> <w>130</w>
<h>30</h> <h>30</h>
</coordinates> </coordinates>
<panel_attributes>lt=.</panel_attributes> <panel_attributes>StateFileOld
<additional_attributes>10.0;10.0;160.0;10.0</additional_attributes> bg=yellow
halign=left
group=2</panel_attributes>
<additional_attributes/>
</element> </element>
<element> <element>
<id>UMLState</id> <id>UMLClass</id>
<coordinates> <coordinates>
<x>370</x> <x>1480</x>
<y>570</y> <y>1040</y>
<w>150</w> <w>130</w>
<h>60</h> <h>60</h>
</coordinates> </coordinates>
<panel_attributes>Check if a newer <panel_attributes>StateFileNew
State File bg=green
is available halign=left
halign=left</panel_attributes> group=2</panel_attributes>
<additional_attributes/> <additional_attributes/>
</element> </element>
<element> <element>
<id>UMLState</id> <id>UMLClass</id>
<coordinates> <coordinates>
<x>80</x> <x>1350</x>
<y>240</y> <y>1070</y>
<w>170</w> <w>130</w>
<h>40</h> <h>30</h>
</coordinates> </coordinates>
<panel_attributes>Update State File <panel_attributes>ListCreated
from File System halign=left
halign=left</panel_attributes> group=2</panel_attributes>
<additional_attributes/> <additional_attributes/>
</element> </element>
<element> <element>
<id>UMLClass</id> <id>UMLState</id>
<coordinates> <coordinates>
<x>100</x> <x>1090</x>
<y>500</y> <y>870</y>
<w>130</w> <w>120</w>
<h>40</h> <h>40</h>
</coordinates> </coordinates>
<panel_attributes>Last Accepted <panel_attributes>update
State File StateFileNew
bg=green
halign=left</panel_attributes> halign=left</panel_attributes>
<additional_attributes/> <additional_attributes/>
</element> </element>
<element> <element>
<id>UMLClass</id> <id>UMLState</id>
<coordinates> <coordinates>
<x>100</x> <x>1090</x>
<y>320</y> <y>1060</y>
<w>130</w> <w>120</w>
<h>40</h> <h>40</h>
</coordinates> </coordinates>
<panel_attributes>Current <panel_attributes>get
State File ListCreated
bg=yellow
halign=left</panel_attributes> halign=left</panel_attributes>
<additional_attributes/> <additional_attributes/>
</element> </element>
<element> <element>
<id>UMLState</id> <id>UMLState</id>
<coordinates> <coordinates>
<x>80</x> <x>1090</x>
<y>410</y> <y>1240</y>
<w>160</w> <w>120</w>
<h>40</h> <h>40</h>
</coordinates> </coordinates>
<panel_attributes>Accept State File</panel_attributes> <panel_attributes>get
ListDeleted
halign=left</panel_attributes>
<additional_attributes/> <additional_attributes/>
</element> </element>
<element> <element>
<id>Relation</id> <id>Relation</id>
<coordinates> <coordinates>
<x>430</x> <x>1130</x>
<y>440</y> <y>990</y>
<w>40</w>
<h>150</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>10.0;130.0;20.0;10.0</additional_attributes>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>150</x>
<y>350</y>
<w>30</w> <w>30</w>
<h>80</h> <h>90</h>
</coordinates> </coordinates>
<panel_attributes>lt=&lt;-</panel_attributes> <panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>10.0;60.0;10.0;10.0</additional_attributes> <additional_attributes>10.0;70.0;10.0;10.0</additional_attributes>
</element> </element>
<element> <element>
<id>Relation</id> <id>Relation</id>
<coordinates> <coordinates>
<x>310</x> <x>1120</x>
<y>620</y> <y>1170</y>
<w>150</w> <w>50</w>
<h>120</h> <h>90</h>
</coordinates> </coordinates>
<panel_attributes>lt=&lt;- <panel_attributes>lt=&lt;-</panel_attributes>
[YES]</panel_attributes> <additional_attributes>30.0;70.0;10.0;10.0</additional_attributes>
<additional_attributes>10.0;100.0;130.0;10.0</additional_attributes>
</element> </element>
<element> <element>
<id>UMLState</id> <id>UMLState</id>
<coordinates> <coordinates>
<x>240</x> <x>1090</x>
<y>720</y> <y>1380</y>
<w>170</w> <w>120</w>
<h>60</h> <h>40</h>
</coordinates> </coordinates>
<panel_attributes>Update File System <panel_attributes>do
according to newest SyncOps
State File</panel_attributes> halign=left
style=wordwrap</panel_attributes>
<additional_attributes/> <additional_attributes/>
</element> </element>
<element> <element>
<id>Relation</id> <id>Relation</id>
<coordinates> <coordinates>
<x>150</x> <x>1140</x>
<y>440</y> <y>1320</y>
<w>30</w> <w>60</w>
<h>80</h> <h>80</h>
</coordinates> </coordinates>
<panel_attributes>lt=&lt;-</panel_attributes> <panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>10.0;60.0;10.0;10.0</additional_attributes> <additional_attributes>40.0;60.0;10.0;10.0</additional_attributes>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>150</x>
<y>150</y>
<w>190</w>
<h>110</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>10.0;90.0;170.0;10.0</additional_attributes>
</element> </element>
<element> <element>
<id>Relation</id> <id>Relation</id>
<coordinates> <coordinates>
<x>150</x> <x>1120</x>
<y>270</y> <y>1090</y>
<w>30</w> <w>50</w>
<h>70</h> <h>90</h>
</coordinates> </coordinates>
<panel_attributes>lt=&lt;-</panel_attributes> <panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>10.0;50.0;10.0;10.0</additional_attributes> <additional_attributes>10.0;70.0;30.0;10.0</additional_attributes>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>150</x>
<y>530</y>
<w>30</w>
<h>70</h>
</coordinates>
<panel_attributes>lt=.</panel_attributes>
<additional_attributes>10.0;10.0;10.0;50.0</additional_attributes>
</element> </element>
<element> <element>
<id>UMLClass</id> <id>UMLClass</id>
<coordinates> <coordinates>
<x>860</x> <x>840</x>
<y>0</y> <y>840</y>
<w>340</w> <w>820</w>
<h>50</h> <h>1090</h>
</coordinates> </coordinates>
<panel_attributes>SyncEntity <panel_attributes>For Each SyncDirectory
-- halign=left
Map&lt;SyncDirectory&gt; directories layer=-1</panel_attributes>
halign=left</panel_attributes>
<additional_attributes/> <additional_attributes/>
</element> </element>
<element> <element>
<id>UMLClass</id> <id>UMLClass</id>
<coordinates> <coordinates>
<x>1300</x> <x>1340</x>
<y>90</y> <y>1030</y>
<w>230</w> <w>280</w>
<h>200</h> <h>80</h>
</coordinates> </coordinates>
<panel_attributes>SyncDirectory <panel_attributes>
halign=left
-- layer=-1
String realPath group=2</panel_attributes>
String stateFileBasePath
File stateFileOld
File stateFileNew
Map&lt;String,File&gt; poolOld
Map&lt;String,File&gt; poolNew
List&lt;String&gt; listCreated
List&lt;String&gt; listDeleted
halign=left</panel_attributes>
<additional_attributes/> <additional_attributes/>
</element> </element>
<element> <element>
<id>Relation</id> <id>Relation</id>
<coordinates> <coordinates>
<x>1190</x> <x>1200</x>
<y>30</y> <y>1240</y>
<w>130</w> <w>160</w>
<h>90</h> <h>40</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>110.0;70.0;10.0;10.0</additional_attributes>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>1620</x>
<y>740</y>
<w>130</w>
<h>60</h>
</coordinates> </coordinates>
<panel_attributes>StateFileOld <panel_attributes>lt=.</panel_attributes>
bg=yellow <additional_attributes>140.0;10.0;10.0;20.0</additional_attributes>
halign=left</panel_attributes>
<additional_attributes/>
</element> </element>
<element> <element>
<id>UMLClass</id> <id>Relation</id>
<coordinates> <coordinates>
<x>1750</x> <x>1150</x>
<y>740</y> <y>800</y>
<w>130</w> <w>30</w>
<h>30</h> <h>90</h>
</coordinates> </coordinates>
<panel_attributes>StateFileNew <panel_attributes>lt=&lt;-</panel_attributes>
bg=green <additional_attributes>10.0;70.0;10.0;10.0</additional_attributes>
halign=left</panel_attributes>
<additional_attributes/>
</element> </element>
<element> <element>
<id>UMLClass</id> <id>UMLSpecialState</id>
<coordinates> <coordinates>
<x>1750</x> <x>1150</x>
<y>770</y> <y>790</y>
<w>130</w> <w>20</w>
<h>30</h> <h>20</h>
</coordinates> </coordinates>
<panel_attributes>ListDeleted <panel_attributes>type=initial</panel_attributes>
halign=left</panel_attributes>
<additional_attributes/> <additional_attributes/>
</element> </element>
<element> <element>
<id>UMLClass</id> <id>UMLSpecialState</id>
<coordinates> <coordinates>
<x>1620</x> <x>1150</x>
<y>820</y> <y>1970</y>
<w>130</w> <w>20</w>
<h>30</h> <h>20</h>
</coordinates> </coordinates>
<panel_attributes>StateFileOld <panel_attributes>type=final</panel_attributes>
bg=yellow
halign=left</panel_attributes>
<additional_attributes/> <additional_attributes/>
</element> </element>
<element> <element>
<id>UMLClass</id> <id>Relation</id>
<coordinates> <coordinates>
<x>1750</x> <x>1130</x>
<y>820</y> <y>1500</y>
<w>130</w> <w>50</w>
<h>60</h> <h>90</h>
</coordinates> </coordinates>
<panel_attributes>StateFileNew <panel_attributes>lt=&lt;-</panel_attributes>
bg=green <additional_attributes>30.0;70.0;10.0;10.0</additional_attributes>
halign=left</panel_attributes>
<additional_attributes/>
</element> </element>
<element> <element>
<id>UMLClass</id> <id>Relation</id>
<coordinates> <coordinates>
<x>1620</x> <x>1150</x>
<y>850</y> <y>1900</y>
<w>130</w> <w>30</w>
<h>30</h> <h>90</h>
</coordinates> </coordinates>
<panel_attributes>ListCreated <panel_attributes>lt=&lt;-</panel_attributes>
halign=left</panel_attributes> <additional_attributes>10.0;70.0;10.0;10.0</additional_attributes>
<additional_attributes/>
</element> </element>
<element> <element>
<id>UMLState</id> <id>UMLState</id>
<coordinates> <coordinates>
<x>1220</x> <x>1070</x>
<y>650</y> <y>1720</y>
<w>170</w> <w>120</w>
<h>60</h> <h>50</h>
</coordinates> </coordinates>
<panel_attributes>update <panel_attributes>update
StateFileNew</panel_attributes> StateFileOld
halign=left
style=wordwrap</panel_attributes>
<additional_attributes/> <additional_attributes/>
</element> </element>
<element> <element>
<id>UMLState</id> <id>UMLState</id>
<coordinates> <coordinates>
<x>1190</x> <x>1100</x>
<y>770</y> <y>1160</y>
<w>120</w> <w>150</w>
<h>40</h> <h>20</h>
</coordinates> </coordinates>
<panel_attributes>get <panel_attributes>State 1 : LIST-1
ListCreated</panel_attributes> bg=orange</panel_attributes>
<additional_attributes/> <additional_attributes/>
</element> </element>
<element> <element>
<id>UMLState</id> <id>UMLState</id>
<coordinates> <coordinates>
<x>1310</x> <x>1070</x>
<y>770</y> <y>1570</y>
<w>120</w> <w>120</w>
<h>40</h> <h>40</h>
</coordinates> </coordinates>
<panel_attributes>get <panel_attributes>update
ListDeleted</panel_attributes> StateFileNew
halign=left
style=wordwrap</panel_attributes>
<additional_attributes/> <additional_attributes/>
</element> </element>
<element> <element>
<id>Relation</id> <id>UMLState</id>
<coordinates>
<x>1230</x>
<y>700</y>
<w>90</w>
<h>90</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>10.0;70.0;70.0;10.0</additional_attributes>
</element>
<element>
<id>Relation</id>
<coordinates> <coordinates>
<x>1310</x> <x>1110</x>
<y>700</y> <y>1490</y>
<w>80</w> <w>160</w>
<h>90</h> <h>20</h>
</coordinates> </coordinates>
<panel_attributes>lt=&lt;-</panel_attributes> <panel_attributes>State 3 : SYNC-1
<additional_attributes>60.0;70.0;10.0;10.0</additional_attributes> bg=orange</panel_attributes>
<additional_attributes/>
</element> </element>
<element> <element>
<id>UMLState</id> <id>UMLState</id>
<coordinates> <coordinates>
<x>1190</x> <x>1110</x>
<y>850</y> <y>1640</y>
<w>120</w> <w>150</w>
<h>40</h> <h>20</h>
</coordinates> </coordinates>
<panel_attributes>add to <panel_attributes>State 4 : NEW-2
MapCreated</panel_attributes> bg=orange</panel_attributes>
<additional_attributes/> <additional_attributes/>
</element> </element>
<element> <element>
<id>UMLState</id> <id>UMLState</id>
<coordinates> <coordinates>
<x>1310</x> <x>1110</x>
<y>850</y> <y>980</y>
<w>120</w> <w>140</w>
<h>40</h> <h>20</h>
</coordinates> </coordinates>
<panel_attributes>add to <panel_attributes>State 0 : NEW-1
MapDeleted</panel_attributes> bg=orange</panel_attributes>
<additional_attributes/> <additional_attributes/>
</element> </element>
<element> <element>
<id>Relation</id> <id>UMLState</id>
<coordinates> <coordinates>
<x>1360</x> <x>1120</x>
<y>800</y> <y>1790</y>
<w>30</w> <w>140</w>
<h>70</h> <h>20</h>
</coordinates> </coordinates>
<panel_attributes>lt=&lt;-</panel_attributes> <panel_attributes>State 5 : OLD-1
<additional_attributes>10.0;50.0;10.0;10.0</additional_attributes> bg=orange</panel_attributes>
<additional_attributes/>
</element> </element>
<element> <element>
<id>Relation</id> <id>Relation</id>
<coordinates> <coordinates>
<x>1240</x> <x>1130</x>
<y>800</y> <y>1650</y>
<w>30</w> <w>40</w>
<h>70</h> <h>90</h>
</coordinates> </coordinates>
<panel_attributes>lt=&lt;-</panel_attributes> <panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>10.0;50.0;10.0;10.0</additional_attributes> <additional_attributes>20.0;70.0;10.0;10.0</additional_attributes>
</element> </element>
<element> <element>
<id>UMLState</id> <id>UMLSpecialState</id>
<coordinates> <coordinates>
<x>1230</x> <x>1140</x>
<y>970</y> <y>1870</y>
<w>170</w> <w>40</w>
<h>60</h> <h>40</h>
</coordinates> </coordinates>
<panel_attributes>Perform <panel_attributes>type=decision</panel_attributes>
File Operations
for Sycronization</panel_attributes>
<additional_attributes/> <additional_attributes/>
</element> </element>
<element> <element>
<id>Relation</id> <id>Relation</id>
<coordinates> <coordinates>
<x>1310</x> <x>1150</x>
<y>880</y> <y>1800</y>
<w>80</w> <w>30</w>
<h>110</h> <h>90</h>
</coordinates> </coordinates>
<panel_attributes>lt=&lt;-</panel_attributes> <panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>10.0;90.0;60.0;10.0</additional_attributes> <additional_attributes>10.0;70.0;10.0;10.0</additional_attributes>
</element> </element>
<element> <element>
<id>Relation</id> <id>Relation</id>
<coordinates> <coordinates>
<x>1240</x> <x>920</x>
<y>880</y> <y>880</y>
<w>100</w> <w>240</w>
<h>110</h> <h>1030</h>
</coordinates> </coordinates>
<panel_attributes>lt=&lt;-</panel_attributes> <panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>80.0;90.0;10.0;10.0</additional_attributes> <additional_attributes>170.0;10.0;20.0;260.0;10.0;1010.0;220.0;1010.0</additional_attributes>
</element> </element>
<element> <element>
<id>UMLClass</id> <id>Relation</id>
<coordinates> <coordinates>
<x>1020</x> <x>1130</x>
<y>610</y> <y>900</y>
<w>440</w> <w>40</w>
<h>320</h> <h>100</h>
</coordinates> </coordinates>
<panel_attributes>For Each SyncDirectory <panel_attributes>lt=&lt;-</panel_attributes>
halign=left <additional_attributes>10.0;80.0;20.0;10.0</additional_attributes>
layer=-1</panel_attributes>
<additional_attributes/>
</element> </element>
<element> <element>
<id>UMLClass</id> <id>UMLClass</id>
<coordinates> <coordinates>
<x>1600</x> <x>1340</x>
<y>720</y> <y>1210</y>
<w>300</w> <w>280</w>
<h>180</h> <h>80</h>
</coordinates> </coordinates>
<panel_attributes> <panel_attributes>
halign=left halign=left
layer=-1</panel_attributes> layer=-1
group=1</panel_attributes>
<additional_attributes/> <additional_attributes/>
</element> </element>
<element> <element>
<id>Relation</id> <id>Relation</id>
<coordinates> <coordinates>
<x>1420</x> <x>1200</x>
<y>780</y> <y>1060</y>
<w>200</w> <w>160</w>
<h>50</h> <h>40</h>
</coordinates> </coordinates>
<panel_attributes>lt=.</panel_attributes> <panel_attributes>lt=.</panel_attributes>
<additional_attributes>180.0;30.0;10.0;10.0</additional_attributes> <additional_attributes>10.0;20.0;140.0;10.0</additional_attributes>
</element> </element>
<element> <element>
<id>Relation</id> <id>UMLState</id>
<coordinates>
<x>1280</x>
<y>580</y>
<w>40</w>
<h>90</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>10.0;70.0;20.0;10.0</additional_attributes>
</element>
<element>
<id>UMLSpecialState</id>
<coordinates> <coordinates>
<x>1290</x> <x>1120</x>
<y>570</y> <y>1310</y>
<w>20</w> <w>160</w>
<h>20</h> <h>20</h>
</coordinates> </coordinates>
<panel_attributes>type=initial</panel_attributes> <panel_attributes>State 2 : LIST-2
bg=orange</panel_attributes>
<additional_attributes/> <additional_attributes/>
</element> </element>
<element> <element>
<id>UMLSpecialState</id> <id>Relation</id>
<coordinates> <coordinates>
<x>1300</x> <x>1140</x>
<y>1200</y> <y>1270</y>
<w>20</w> <w>30</w>
<h>20</h> <h>60</h>
</coordinates> </coordinates>
<panel_attributes>type=final</panel_attributes> <panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes/> <additional_attributes>10.0;40.0;10.0;10.0</additional_attributes>
</element> </element>
<element> <element>
<id>Relation</id> <id>Relation</id>
<coordinates> <coordinates>
<x>1300</x> <x>1140</x>
<y>1020</y> <y>1760</y>
<w>30</w> <w>40</w>
<h>80</h> <h>50</h>
</coordinates> </coordinates>
<panel_attributes>lt=&lt;-</panel_attributes> <panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>10.0;60.0;10.0;10.0</additional_attributes> <additional_attributes>20.0;30.0;10.0;10.0</additional_attributes>
</element> </element>
<element> <element>
<id>Relation</id> <id>Relation</id>
<coordinates> <coordinates>
<x>1290</x> <x>1110</x>
<y>1130</y> <y>1600</y>
<w>40</w> <w>50</w>
<h>90</h> <h>60</h>
</coordinates> </coordinates>
<panel_attributes>lt=&lt;-</panel_attributes> <panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>20.0;70.0;10.0;10.0</additional_attributes> <additional_attributes>30.0;40.0;10.0;10.0</additional_attributes>
</element> </element>
<element> <element>
<id>UMLState</id> <id>Relation</id>
<coordinates> <coordinates>
<x>1220</x> <x>1130</x>
<y>1080</y> <y>1410</y>
<w>170</w> <w>60</w>
<h>60</h> <h>100</h>
</coordinates> </coordinates>
<panel_attributes>update <panel_attributes>lt=&lt;-</panel_attributes>
StateFileBoth</panel_attributes> <additional_attributes>10.0;80.0;40.0;10.0</additional_attributes>
<additional_attributes/>
</element> </element>
</diagram> </diagram>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Loading…
Cancel
Save