summaryrefslogtreecommitdiff
path: root/source/com/c2kernel/lifecycle
diff options
context:
space:
mode:
authorabranson <andrew.branson@cern.ch>2011-08-04 00:42:34 +0200
committerabranson <andrew.branson@cern.ch>2011-08-04 00:42:34 +0200
commit0ec8481c10cd8277d84c7c1a785483a0a739e5a0 (patch)
tree5f6e5d9ae75193e67e6f3b3dfa488960c5cde1d5 /source/com/c2kernel/lifecycle
parent036cbdba66f804743c4c838ed598d6972c4b3e17 (diff)
More code cleanup:
Refactored Entity Proxy Subscription to handle generics better Rewrote RemoteMap to use TreeMap instead of the internal array for order. It now sorts its keys by number if they parse, else as strings. Removed a no-longer-in-progress outcome form class
Diffstat (limited to 'source/com/c2kernel/lifecycle')
-rw-r--r--source/com/c2kernel/lifecycle/ActivityDef.java18
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/ActivitySlotDef.java31
-rw-r--r--source/com/c2kernel/lifecycle/AndSplitDef.java7
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/CompositeActivityDef.java26
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/JoinDef.java5
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/LoopDef.java24
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/NextDef.java7
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/OrSplitDef.java1
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/WfCastorHashMap.java2
-rw-r--r--source/com/c2kernel/lifecycle/WfVertexDef.java16
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/XOrSplitDef.java3
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/chooser/ActivityChooser.java24
-rw-r--r--source/com/c2kernel/lifecycle/chooser/LDAPEntryChooser.java17
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/chooser/LDAPFileChooser.java10
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/chooser/WorkflowDialogue.java2
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/gui/model/WfDefGraphPanel.java3
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/gui/model/WfEdgeDefFactory.java3
-rw-r--r--source/com/c2kernel/lifecycle/gui/model/WfVertexDefFactory.java5
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/gui/model/WfVertexDefOutlineCreator.java3
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/gui/view/ActivitySlotDefRenderer.java11
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/gui/view/CompActDefOutcomeHandler.java79
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/gui/view/ElemActDefOutcomeHandler.java53
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/gui/view/SplitJoinDefRenderer.java7
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/gui/view/WfDirectedEdgeDefRenderer.java4
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/gui/view/WfVertexDefRenderer.java3
-rw-r--r--source/com/c2kernel/lifecycle/instance/Activity.java36
-rw-r--r--source/com/c2kernel/lifecycle/instance/AdvancementCalculator.java49
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/instance/AndSplit.java5
-rw-r--r--source/com/c2kernel/lifecycle/instance/CompositeActivity.java77
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/instance/EventStorage.java6
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/instance/JobPusher.java9
-rw-r--r--source/com/c2kernel/lifecycle/instance/Join.java19
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/instance/Loop.java21
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/instance/Next.java3
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/instance/OrSplit.java10
-rw-r--r--source/com/c2kernel/lifecycle/instance/ParserWF.java21
-rw-r--r--source/com/c2kernel/lifecycle/instance/Split.java40
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/instance/WfVertex.java27
-rw-r--r--source/com/c2kernel/lifecycle/instance/Workflow.java22
-rw-r--r--source/com/c2kernel/lifecycle/instance/XOrSplit.java22
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/instance/gui/model/WfEdgeFactory.java5
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/instance/gui/model/WfGraphPanel.java3
-rw-r--r--source/com/c2kernel/lifecycle/instance/gui/model/WfVertexFactory.java9
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/instance/gui/model/WfVertexOutlineCreator.java3
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/instance/gui/view/ActivityRenderer.java9
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/instance/gui/view/FindActDefPanel.java13
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/instance/gui/view/SplitJoinRenderer.java9
-rw-r--r--source/com/c2kernel/lifecycle/instance/gui/view/TransitionPanel.java47
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/instance/gui/view/WfDirectedEdgeRenderer.java4
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/instance/gui/view/WfVertexRenderer.java3
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/instance/predefined/AddC2KObject.java5
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/instance/predefined/AddDomainPath.java3
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/instance/predefined/AddStepsFromDescription.java1
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/instance/predefined/AssignItemToSlot.java26
-rw-r--r--source/com/c2kernel/lifecycle/instance/predefined/CreateItemFromDescription.java67
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/instance/predefined/Erase.java13
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/instance/predefined/Import.java21
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/instance/predefined/PredefinedStep.java25
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/instance/predefined/PredefinedStepContainer.java10
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/instance/predefined/RemoveC2KObject.java5
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/instance/predefined/RemoveDomainPath.java3
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/instance/predefined/ReplaceDomainWorkflow.java1
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/instance/predefined/ServerPredefinedStepContainer.java5
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/instance/predefined/WriteProperty.java5
-rw-r--r--source/com/c2kernel/lifecycle/instance/predefined/entitycreation/Aggregation.java10
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/instance/predefined/entitycreation/AggregationMember.java2
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/instance/predefined/entitycreation/CreateNewAgent.java3
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/instance/predefined/entitycreation/CreateNewItem.java3
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/instance/predefined/entitycreation/Dependency.java13
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/instance/predefined/entitycreation/DependencyMember.java4
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/instance/predefined/entitycreation/Geometry.java2
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/instance/predefined/entitycreation/NewAgent.java19
-rw-r--r--source/com/c2kernel/lifecycle/instance/predefined/entitycreation/NewItem.java47
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/instance/predefined/entitycreation/Property.java2
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/instance/stateMachine/StateMachine.java24
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/instance/stateMachine/States.java2
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/instance/stateMachine/Transitions.java4
-rw-r--r--[-rwxr-xr-x]source/com/c2kernel/lifecycle/routingHelpers/ViewpointDataHelper.java10
78 files changed, 650 insertions, 521 deletions
diff --git a/source/com/c2kernel/lifecycle/ActivityDef.java b/source/com/c2kernel/lifecycle/ActivityDef.java
index 42385a4..235275f 100644
--- a/source/com/c2kernel/lifecycle/ActivityDef.java
+++ b/source/com/c2kernel/lifecycle/ActivityDef.java
@@ -33,6 +33,7 @@ public class ActivityDef extends WfVertexDef implements C2KLocalObject
/**
* @see com.c2kernel.graph.model.Vertex#setID(int)
*/
+ @Override
public void setID(int id)
{
mId = id;
@@ -42,6 +43,7 @@ public class ActivityDef extends WfVertexDef implements C2KLocalObject
/**
* @see com.c2kernel.graph.model.Vertex#getID()
*/
+ @Override
public int getID()
{
return mId;
@@ -49,6 +51,7 @@ public class ActivityDef extends WfVertexDef implements C2KLocalObject
/**
* @see com.c2kernel.graph.model.Vertex#setName(java.lang.String)
*/
+ @Override
public void setName(String n)
{
mName = n;
@@ -56,11 +59,12 @@ public class ActivityDef extends WfVertexDef implements C2KLocalObject
/**
* @see com.c2kernel.graph.model.Vertex#getName()
*/
+ @Override
public String getName()
{
return mName;
}
-
+
public void setVersion(String v)
{
mVersion = v;
@@ -71,17 +75,18 @@ public class ActivityDef extends WfVertexDef implements C2KLocalObject
public String getVersion()
{
return mVersion;
- }
+ }
/**
* @see com.c2kernel.lifecycle.WfVertexDef#getErrors()
*/
+ @Override
public String getErrors()
{
return super.getErrors();
}
/**
* Method linkToSlot.
- *
+ *
* @param actSl
* @param name
*/
@@ -95,6 +100,7 @@ public class ActivityDef extends WfVertexDef implements C2KLocalObject
/**
* @see com.c2kernel.lifecycle.WfVertexDef#verify()
*/
+ @Override
public boolean verify()
{
return true;
@@ -102,6 +108,7 @@ public class ActivityDef extends WfVertexDef implements C2KLocalObject
/**
* @see com.c2kernel.entity.C2KLocalObject#getClusterType()
*/
+ @Override
public String getClusterType()
{
return null;
@@ -113,14 +120,15 @@ public class ActivityDef extends WfVertexDef implements C2KLocalObject
/*
* (non-Javadoc)
- *
+ *
* @see com.c2kernel.lifecycle.commonInterface.ActType#getDescName()
*/
public String getDescName()
{
return getName();
}
-
+
+ @Override
public WfVertex instantiate() throws ObjectNotFoundException, InvalidDataException{
return instantiate(getName());
}
diff --git a/source/com/c2kernel/lifecycle/ActivitySlotDef.java b/source/com/c2kernel/lifecycle/ActivitySlotDef.java
index 10f6778..74d8305 100755..100644
--- a/source/com/c2kernel/lifecycle/ActivitySlotDef.java
+++ b/source/com/c2kernel/lifecycle/ActivitySlotDef.java
@@ -14,10 +14,10 @@ import com.c2kernel.utils.LocalObjectLoader;
public class ActivitySlotDef extends WfVertexDef
{
private String activityDef;
-
+
/**
* Method setActivityDef.
- *
+ *
* @param oActivityDef
*/
public void setActivityDef(String oActivityDef)
@@ -26,7 +26,7 @@ public class ActivitySlotDef extends WfVertexDef
}
/**
* Method getActivityDef.
- *
+ *
* @return String
*/
public String getActivityDef()
@@ -42,7 +42,7 @@ public class ActivitySlotDef extends WfVertexDef
getProperties().put("Version", "last");
}
- public ActivityDef getTheActivityDef() throws ObjectNotFoundException, InvalidDataException
+ public ActivityDef getTheActivityDef() throws ObjectNotFoundException, InvalidDataException
{
ActivityDef actDef = LocalObjectLoader.getActDef(getActivityDef(), getActVersion());
if (actDef instanceof CompositeActivityDef)
@@ -53,6 +53,7 @@ public class ActivitySlotDef extends WfVertexDef
* @see com.c2kernel.lifecycle.WfVertexDef#verify()
*/
/** launch the verification of the ActivityDef */
+ @Override
public boolean verify()
{
mErrors.removeAllElements();
@@ -87,10 +88,9 @@ public class ActivitySlotDef extends WfVertexDef
Vertex[] outV = getOutGraphables();
Vertex[] anteVertices = GraphTraversal.getTraversal(getParent().getChildrenGraphModel(), this, GraphTraversal.kUp, false);
boolean errInLoop = false;
- for (int i = 0; i < outV.length; i++)
- {
- for (int j = 0; j < anteVertices.length; j++)
- if (!loop() && outV[i].getID() == anteVertices[j].getID())
+ for (Vertex element : outV) {
+ for (Vertex anteVertice : anteVertices)
+ if (!loop() && element.getID() == anteVertice.getID())
errInLoop = true;
}
if (errInLoop)
@@ -103,7 +103,7 @@ public class ActivitySlotDef extends WfVertexDef
}
/**
* Method getNextWfVertices.
- *
+ *
* @return WfVertexDef[]
*/
public WfVertexDef[] getNextWfVertices()
@@ -122,21 +122,21 @@ public class ActivitySlotDef extends WfVertexDef
}
/**
* Method getInfo.
- *
+ *
* @return CastorHashMap
*/
public void configureInstance(Activity act)
{
KeyValuePair[] k = getProperties().getKeyValuePairs();
- for (int i = 0; i < k.length; i++)
- act.getProperties().put(k[i].getKey(), k[i].getValue());
+ for (KeyValuePair element : k)
+ act.getProperties().put(element.getKey(), element.getValue());
act.setCentrePoint(getCentrePoint());
act.setOutlinePoints(getOutlinePoints());
act.setInEdgeIds(getInEdgeIds());
act.setOutEdgeIds(getOutEdgeIds());
act.setName(getActName());
act.setID(getID());
- }
+ }
public String getActName()
{
@@ -145,8 +145,9 @@ public class ActivitySlotDef extends WfVertexDef
public String getActVersion()
{
return (String) getProperties().get("Version");
- }
-
+ }
+
+ @Override
public WfVertex instantiate() throws ObjectNotFoundException, InvalidDataException {
Activity newActivity = (Activity)getTheActivityDef().instantiate();
configureInstance(newActivity);
diff --git a/source/com/c2kernel/lifecycle/AndSplitDef.java b/source/com/c2kernel/lifecycle/AndSplitDef.java
index 80c27df..af87b18 100644
--- a/source/com/c2kernel/lifecycle/AndSplitDef.java
+++ b/source/com/c2kernel/lifecycle/AndSplitDef.java
@@ -26,6 +26,7 @@ public class AndSplitDef extends WfVertexDef
/**
* @see com.c2kernel.lifecycle.WfVertexDef#verify()
*/
+ @Override
public boolean verify()
{
mErrors.removeAllElements();
@@ -81,8 +82,9 @@ public class AndSplitDef extends WfVertexDef
}
return err;
}
-
- public boolean loop()
+
+ @Override
+ public boolean loop()
{
boolean loop2 = false;
if (!loopTested)
@@ -102,6 +104,7 @@ public class AndSplitDef extends WfVertexDef
return loop2;
}
+ @Override
public WfVertex instantiate() {
AndSplit newSplit = new AndSplit();
configureInstance(newSplit);
diff --git a/source/com/c2kernel/lifecycle/CompositeActivityDef.java b/source/com/c2kernel/lifecycle/CompositeActivityDef.java
index a46cc50..86b6f88 100755..100644
--- a/source/com/c2kernel/lifecycle/CompositeActivityDef.java
+++ b/source/com/c2kernel/lifecycle/CompositeActivityDef.java
@@ -51,7 +51,7 @@ public class CompositeActivityDef extends ActivityDef
/**
* Method addNextDef.
- *
+ *
* @param origin
* @param terminus
* @return NextDef
@@ -64,7 +64,7 @@ public class CompositeActivityDef extends ActivityDef
}
/**
* Method addExistingActivityDef.
- *
+ *
* @param actDef
* @param point
*/
@@ -78,7 +78,7 @@ public class CompositeActivityDef extends ActivityDef
}
/**
* Method newChild.
- *
+ *
* @param Name
* @param Type
* @param location
@@ -149,13 +149,15 @@ public class CompositeActivityDef extends ActivityDef
}
/**
* Method instantiateAct.
- *
+ *
* @return CompositeActivity
*/
+ @Override
public WfVertex instantiate() throws ObjectNotFoundException, InvalidDataException {
return instantiate(getName());
}
-
+
+ @Override
public WfVertex instantiate(String name) throws ObjectNotFoundException, InvalidDataException
{
CompositeActivity cAct = new CompositeActivity();
@@ -186,18 +188,17 @@ public class CompositeActivityDef extends ActivityDef
/**
* Method hasGoodNumberOfActivity.
- *
+ *
* @return boolean
*/
-
+
public boolean hasGoodNumberOfActivity()
{
int endingAct = 0;
GraphableVertex[] graphableVertices = this.getLayoutableChildren();
if (graphableVertices != null)
- for (int i = 0; i < graphableVertices.length; i++)
- {
- WfVertexDef vertex = (WfVertexDef) graphableVertices[i];
+ for (GraphableVertex graphableVertice : graphableVertices) {
+ WfVertexDef vertex = (WfVertexDef) graphableVertice;
if (getChildrenGraphModel().getOutEdges(vertex).length == 0)
endingAct++;
}
@@ -209,17 +210,18 @@ public class CompositeActivityDef extends ActivityDef
/**
* @see com.c2kernel.graph.model.GraphableVertex#getPath()
*/
+ @Override
public String getPath()
{
if (getParent() == null)
return getName();
return super.getPath();
}
-
+
//deprecated
public String[] getCastorNonLayoutableChildren() {
return new String[0];
}
-
+
public void setCastorNonLayoutableChildren(String[] dummy) { }
}
diff --git a/source/com/c2kernel/lifecycle/JoinDef.java b/source/com/c2kernel/lifecycle/JoinDef.java
index 71bc95c..95e2ec4 100755..100644
--- a/source/com/c2kernel/lifecycle/JoinDef.java
+++ b/source/com/c2kernel/lifecycle/JoinDef.java
@@ -18,6 +18,7 @@ public class JoinDef extends WfVertexDef
/**
* @see com.c2kernel.lifecycle.WfVertexDef#verify()
*/
+ @Override
public boolean verify()
{
mErrors.removeAllElements();
@@ -52,11 +53,13 @@ public class JoinDef extends WfVertexDef
}
return true;
}
+ @Override
public boolean isJoin()
{
return true;
}
-
+
+ @Override
public WfVertex instantiate() {
Join newJoin = new Join();
configureInstance(newJoin);
diff --git a/source/com/c2kernel/lifecycle/LoopDef.java b/source/com/c2kernel/lifecycle/LoopDef.java
index bee97c5..36108ad 100755..100644
--- a/source/com/c2kernel/lifecycle/LoopDef.java
+++ b/source/com/c2kernel/lifecycle/LoopDef.java
@@ -26,6 +26,7 @@ public class LoopDef extends XOrSplitDef
/**
* @see com.c2kernel.lifecycle.WfVertexDef#loop()
*/
+ @Override
public boolean loop()
{
return true;
@@ -34,6 +35,7 @@ public class LoopDef extends XOrSplitDef
/**
* @see com.c2kernel.lifecycle.WfVertexDef#verify()
*/
+ @Override
public boolean verify()
{
if (!super.verify()) return false;
@@ -43,11 +45,11 @@ public class LoopDef extends XOrSplitDef
int k = 0;
int l = 0;
Vertex[] brothers = getParent().getChildren();
- for (int i = 0; i < brothers.length; i++)
- if (brothers[i] instanceof LoopDef) l++;
- for (int i = 0; i < nexts.length; i++)
- for (int j = 0; j < anteVertices.length; j++)
- if (nexts[i].equals(anteVertices[j]))
+ for (Vertex brother : brothers)
+ if (brother instanceof LoopDef) l++;
+ for (Vertex next : nexts)
+ for (Vertex anteVertice : anteVertices)
+ if (next.equals(anteVertice))
k++;
if (k != 1 && !(l>1))
{
@@ -60,15 +62,17 @@ public class LoopDef extends XOrSplitDef
// }
return true;
}
-
- public boolean isLoop() {
+
+ @Override
+ public boolean isLoop() {
return true;
- }
-
+ }
+
+ @Override
public WfVertex instantiate() {
Loop newLoop = new Loop();
configureInstance(newLoop);
return newLoop;
}
-
+
}
diff --git a/source/com/c2kernel/lifecycle/NextDef.java b/source/com/c2kernel/lifecycle/NextDef.java
index 6bddabf..d196066 100755..100644
--- a/source/com/c2kernel/lifecycle/NextDef.java
+++ b/source/com/c2kernel/lifecycle/NextDef.java
@@ -16,7 +16,7 @@ public class NextDef extends GraphableEdge
}
/**
* Method verify.
- *
+ *
* @return boolean
*/
public boolean verify()
@@ -25,7 +25,7 @@ public class NextDef extends GraphableEdge
}
/**
* Method NextDef.
- *
+ *
* @param pre
* @param nex
*/
@@ -47,6 +47,7 @@ public class NextDef extends GraphableEdge
pre.getProperties().put("LastNum", String.valueOf(num + 1));
}
}
+ @Override
public boolean containsPoint(GraphPoint p)
{
GraphPoint originPoint = getOriginPoint();
@@ -80,7 +81,7 @@ public class NextDef extends GraphableEdge
int maxY = midPoint.y + 10;
return (p.x >= minX) && (p.x <= maxX) && (p.y >= minY) && (p.y <= maxY);
}
-
+
public Next instantiate() {
Next next = new Next();
next.setID(getID());
diff --git a/source/com/c2kernel/lifecycle/OrSplitDef.java b/source/com/c2kernel/lifecycle/OrSplitDef.java
index 14931a1..df68f22 100755..100644
--- a/source/com/c2kernel/lifecycle/OrSplitDef.java
+++ b/source/com/c2kernel/lifecycle/OrSplitDef.java
@@ -15,6 +15,7 @@ public class OrSplitDef extends AndSplitDef
super();
}
+ @Override
public WfVertex instantiate() {
OrSplit newSplit = new OrSplit();
configureInstance(newSplit);
diff --git a/source/com/c2kernel/lifecycle/WfCastorHashMap.java b/source/com/c2kernel/lifecycle/WfCastorHashMap.java
index 1e6a308..7d88ea9 100755..100644
--- a/source/com/c2kernel/lifecycle/WfCastorHashMap.java
+++ b/source/com/c2kernel/lifecycle/WfCastorHashMap.java
@@ -28,6 +28,6 @@ public class WfCastorHashMap extends CastorHashMap
put("SchemaVersion", "");
put("ScriptName", "");
put("ScriptVersion", "");
- put("Viewpoint", "");
+ put("Viewpoint", "");
}
}
diff --git a/source/com/c2kernel/lifecycle/WfVertexDef.java b/source/com/c2kernel/lifecycle/WfVertexDef.java
index 221f6ae..6a46bee 100644
--- a/source/com/c2kernel/lifecycle/WfVertexDef.java
+++ b/source/com/c2kernel/lifecycle/WfVertexDef.java
@@ -29,11 +29,11 @@ public abstract class WfVertexDef extends GraphableVertex
}
public abstract WfVertex instantiate() throws ObjectNotFoundException, InvalidDataException;
-
+
public void configureInstance(WfVertex newVertex) {
KeyValuePair[] k = getProperties().getKeyValuePairs();
- for (int i = 0; i < k.length; i++)
- newVertex.getProperties().put(k[i].getKey(), k[i].getValue());
+ for (KeyValuePair element : k)
+ newVertex.getProperties().put(element.getKey(), element.getValue());
newVertex.setID(getID());
if (getIsLayoutable()) {
newVertex.setInEdgeIds(getInEdgeIds());
@@ -42,17 +42,17 @@ public abstract class WfVertexDef extends GraphableVertex
newVertex.setOutlinePoints(getOutlinePoints());
}
}
-
+
/**
* Method verify.
- *
+ *
* @return boolean
*/
public abstract boolean verify();
/**
* Method getErrors.
- *
+ *
* @return String
*/
public String getErrors()
@@ -60,12 +60,12 @@ public abstract class WfVertexDef extends GraphableVertex
if (mErrors.size() == 0)
return "No error";
else
- return (String) mErrors.elementAt(0);
+ return mErrors.elementAt(0);
}
/**
* Method loop.
- *
+ *
* @return boolean
*/
public boolean loop()
diff --git a/source/com/c2kernel/lifecycle/XOrSplitDef.java b/source/com/c2kernel/lifecycle/XOrSplitDef.java
index 550fb88..73c578f 100755..100644
--- a/source/com/c2kernel/lifecycle/XOrSplitDef.java
+++ b/source/com/c2kernel/lifecycle/XOrSplitDef.java
@@ -19,7 +19,8 @@ public class XOrSplitDef extends AndSplitDef
{
super();
}
-
+
+ @Override
public WfVertex instantiate() {
XOrSplit newSplit = new XOrSplit();
configureInstance(newSplit);
diff --git a/source/com/c2kernel/lifecycle/chooser/ActivityChooser.java b/source/com/c2kernel/lifecycle/chooser/ActivityChooser.java
index f79dedf..4b0ae4c 100755..100644
--- a/source/com/c2kernel/lifecycle/chooser/ActivityChooser.java
+++ b/source/com/c2kernel/lifecycle/chooser/ActivityChooser.java
@@ -1,6 +1,6 @@
/*
* Created on 1 sept. 2003
- *
+ *
* To change the template for this generated file go to Window>Preferences>Java>Code Generation>Code and Comments
*/
package com.c2kernel.lifecycle.chooser;
@@ -22,15 +22,13 @@ import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
-import com.c2kernel.lifecycle.ActivityDef;
import com.c2kernel.utils.Language;
-import com.c2kernel.utils.LocalObjectLoader;
import com.c2kernel.utils.Logger;
import com.c2kernel.utils.Resource;
/**
* @author Developpement
- *
+ *
* To change the template for this generated type comment go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
@@ -52,9 +50,9 @@ public class ActivityChooser extends JFrame
private JLabel label = null;
- HashMap mhashmap = null;
+ HashMap<?, ?> mhashmap = null;
- public ActivityChooser(String message, String title, Image img, WorkflowDialogue parent, HashMap hashmap)
+ public ActivityChooser(String message, String title, Image img, WorkflowDialogue parent, HashMap<?, ?> hashmap)
{
super(title);
mMessage = message;
@@ -93,7 +91,7 @@ public class ActivityChooser extends JFrame
{
Logger.error(mExc);
}
- }
+ }
return mLDAPFileChooserActivity;
}
@@ -101,14 +99,9 @@ public class ActivityChooser extends JFrame
{
getJButtonOK().addActionListener(new ActionListener()
{
- public void actionPerformed(ActionEvent e)
+ @Override
+ public void actionPerformed(ActionEvent e)
{
- try
- {
- ActivityDef act = LocalObjectLoader.getActDef(mLDAPFileChooserActivity.getEntryName(), "last");
- } catch (Exception ex)
- {
- }
Logger.debug(5, "mLDAPFileChooserActivity.getEntryName()" + mLDAPFileChooserActivity.getEntryName());
setCursor(new Cursor(Cursor.WAIT_CURSOR));
mParent.loadThisWorkflow(mLDAPFileChooserActivity.getEntryName(), mhashmap);
@@ -118,7 +111,8 @@ public class ActivityChooser extends JFrame
});
getJButtonCancel().addActionListener(new ActionListener()
{
- public void actionPerformed(ActionEvent e)
+ @Override
+ public void actionPerformed(ActionEvent e)
{
close();
}
diff --git a/source/com/c2kernel/lifecycle/chooser/LDAPEntryChooser.java b/source/com/c2kernel/lifecycle/chooser/LDAPEntryChooser.java
index e8143be..d86c0a0 100644
--- a/source/com/c2kernel/lifecycle/chooser/LDAPEntryChooser.java
+++ b/source/com/c2kernel/lifecycle/chooser/LDAPEntryChooser.java
@@ -17,10 +17,10 @@ import com.c2kernel.utils.Logger;
public class LDAPEntryChooser extends JComboBox<String>
{
-
+
DomainPath mDomainPath = null;
ArrayList<String> allItems = new ArrayList<String>();
-
+
public LDAPEntryChooser(DomainPath domPath, boolean editable)
{
super();
@@ -28,12 +28,12 @@ public class LDAPEntryChooser extends JComboBox<String>
mDomainPath = domPath;
initialise();
}
-
+
private void initialise()
{
try
{
- Enumeration children = Gateway.getLDAPLookup().searchAliases(mDomainPath);
+ Enumeration<?> children = Gateway.getLDAPLookup().searchAliases(mDomainPath);
while (children.hasMoreElements())
{
DomainPath domPath = (DomainPath)children.nextElement();
@@ -44,13 +44,13 @@ public class LDAPEntryChooser extends JComboBox<String>
{
Logger.exceptionDialog(ex);
}
-
+
Collections.sort(allItems);
addItem("");
for (String element : allItems) {
addItem(element);
}
-
+
}
public void reload()
@@ -58,8 +58,9 @@ public class LDAPEntryChooser extends JComboBox<String>
removeAllItems();
initialise();
}
-
- public synchronized Dimension getSize()
+
+ @Override
+ public synchronized Dimension getSize()
{
if ("1".equals(Gateway.getProperty("ResizeCombo")))
return new Dimension(super.getSize().width<400?400:super.getSize().width,super.getSize().height);
diff --git a/source/com/c2kernel/lifecycle/chooser/LDAPFileChooser.java b/source/com/c2kernel/lifecycle/chooser/LDAPFileChooser.java
index 08f4387..9843d61 100755..100644
--- a/source/com/c2kernel/lifecycle/chooser/LDAPFileChooser.java
+++ b/source/com/c2kernel/lifecycle/chooser/LDAPFileChooser.java
@@ -22,7 +22,7 @@ public class LDAPFileChooser extends JPanel
public static String SCHEMA_CHOOSER = "Schema";
public static String ACTIVITY_CHOOSER = "Activity";
private String chooserMode = null;
- private HashMap mHashList = null;
+ private HashMap<?, ?> mHashList = null;
public LDAPEntryChooser mLec;
private boolean mEditable = false;
DomainPath domainPath;
@@ -83,7 +83,7 @@ public class LDAPFileChooser extends JPanel
public void setSelectedItem(String name, String version)
{
Logger.debug(5,"setSelectedItem " + name + " " + version);
- if (name == null||name.equals("-1")) name="";
+ if (name == null||name.equals("-1")) name="";
mLec.setSelectedItem(name);
}
@@ -106,13 +106,15 @@ public class LDAPFileChooser extends JPanel
mLec.setEditable(b);
}
- public void updateUI()
+ @Override
+ public void updateUI()
{
if (mLec!=null) mLec.updateUI();
super.updateUI();
}
- public void setEnabled(boolean enabled)
+ @Override
+ public void setEnabled(boolean enabled)
{
mLec.setEnabled(enabled);
}
diff --git a/source/com/c2kernel/lifecycle/chooser/WorkflowDialogue.java b/source/com/c2kernel/lifecycle/chooser/WorkflowDialogue.java
index 8453ad2..2ddd489 100755..100644
--- a/source/com/c2kernel/lifecycle/chooser/WorkflowDialogue.java
+++ b/source/com/c2kernel/lifecycle/chooser/WorkflowDialogue.java
@@ -16,5 +16,5 @@ import java.util.HashMap;
*/
public interface WorkflowDialogue
{
- public void loadThisWorkflow(String name, HashMap hashMap);
+ public void loadThisWorkflow(String name, HashMap<?, ?> hashMap);
}
diff --git a/source/com/c2kernel/lifecycle/gui/model/WfDefGraphPanel.java b/source/com/c2kernel/lifecycle/gui/model/WfDefGraphPanel.java
index 973fcbf..e0f4f65 100755..100644
--- a/source/com/c2kernel/lifecycle/gui/model/WfDefGraphPanel.java
+++ b/source/com/c2kernel/lifecycle/gui/model/WfDefGraphPanel.java
@@ -18,6 +18,7 @@ public class WfDefGraphPanel extends GraphPanel
super(d,v);
}
// Draws the highlight of the specified edge
+ @Override
protected void drawEdgeHighlight(Graphics2D g2d, DirectedEdge edge)
{
GraphPoint originPoint = edge.getOriginPoint();
@@ -49,7 +50,7 @@ public class WfDefGraphPanel extends GraphPanel
int minX = midPoint.x - 10;
int minY = midPoint.y - 10;
int maxX = midPoint.x + 10;
- int maxY = midPoint.y + 10;
+ int maxY = midPoint.y + 10;
g2d.drawLine(minX, minY, maxX, minY);
g2d.drawLine(maxX, minY, maxX, maxY);
g2d.drawLine(maxX, maxY, minX, maxY);
diff --git a/source/com/c2kernel/lifecycle/gui/model/WfEdgeDefFactory.java b/source/com/c2kernel/lifecycle/gui/model/WfEdgeDefFactory.java
index d6fd41c..6e6727a 100755..100644
--- a/source/com/c2kernel/lifecycle/gui/model/WfEdgeDefFactory.java
+++ b/source/com/c2kernel/lifecycle/gui/model/WfEdgeDefFactory.java
@@ -8,6 +8,7 @@ import com.c2kernel.lifecycle.NextDef;
import com.c2kernel.lifecycle.WfVertexDef;
public class WfEdgeDefFactory implements EdgeFactory
{
+ @Override
public void create(
GraphModelManager graphModelManager,
Vertex origin,
@@ -20,7 +21,7 @@ public class WfEdgeDefFactory implements EdgeFactory
graphModelManager.getModel().addEdgeAndCreateId(nextDef, origin, terminus);
}
}
- private boolean validCreation(GraphModelManager graphModelManager, Vertex origin, Vertex terminus)
+ private static boolean validCreation(GraphModelManager graphModelManager, Vertex origin, Vertex terminus)
{
DirectedEdge[] connectingEdgesAToB = graphModelManager.getModel().getConnectingEdges(origin.getID(), terminus.getID());
DirectedEdge[] connectingEdgesBToA = graphModelManager.getModel().getConnectingEdges(terminus.getID(), origin.getID());
diff --git a/source/com/c2kernel/lifecycle/gui/model/WfVertexDefFactory.java b/source/com/c2kernel/lifecycle/gui/model/WfVertexDefFactory.java
index 2ef9508..da59efd 100644
--- a/source/com/c2kernel/lifecycle/gui/model/WfVertexDefFactory.java
+++ b/source/com/c2kernel/lifecycle/gui/model/WfVertexDefFactory.java
@@ -20,6 +20,7 @@ import com.c2kernel.utils.Resource;
public class WfVertexDefFactory implements VertexFactory, WorkflowDialogue
{
protected CompositeActivityDef mCompositeActivityDef = null;
+ @Override
public void create(GraphModelManager graphModelManager, Point location, TypeNameAndConstructionInfo typeNameAndConstructionInfo)
{
String vertexTypeId = null;
@@ -46,7 +47,8 @@ public class WfVertexDefFactory implements VertexFactory, WorkflowDialogue
mCompositeActivityDef.newChild("", vertexTypeId, location);
}
}
- public void loadThisWorkflow(String newName, HashMap hashMap)
+ @Override
+ public void loadThisWorkflow(String newName, HashMap<?, ?> hashMap)
{
String vertexTypeId = (String) hashMap.get("P1");
Point location = (Point) hashMap.get("P2");
@@ -86,6 +88,7 @@ public class WfVertexDefFactory implements VertexFactory, WorkflowDialogue
mCompositeActivityDef.newChild(newName, vertexTypeId, location);
}
}
+ @Override
public void setCreationContext(Object newContext)
{
if (newContext != null && newContext instanceof CompositeActivityDef)
diff --git a/source/com/c2kernel/lifecycle/gui/model/WfVertexDefOutlineCreator.java b/source/com/c2kernel/lifecycle/gui/model/WfVertexDefOutlineCreator.java
index 3727f35..63d3b2f 100755..100644
--- a/source/com/c2kernel/lifecycle/gui/model/WfVertexDefOutlineCreator.java
+++ b/source/com/c2kernel/lifecycle/gui/model/WfVertexDefOutlineCreator.java
@@ -12,7 +12,8 @@ public class WfVertexDefOutlineCreator implements VertexOutlineCreator
private final int mSplitJoinWidth = 60;
private final int mSplitJoinHeight = 25;
- public void setOutline(Vertex vertex)
+ @Override
+ public void setOutline(Vertex vertex)
{
GraphPoint centrePoint = vertex.getCentrePoint();
GraphPoint[] outlinePoints = new GraphPoint[ 4 ];
diff --git a/source/com/c2kernel/lifecycle/gui/view/ActivitySlotDefRenderer.java b/source/com/c2kernel/lifecycle/gui/view/ActivitySlotDefRenderer.java
index 5746673..c4309ee 100755..100644
--- a/source/com/c2kernel/lifecycle/gui/view/ActivitySlotDefRenderer.java
+++ b/source/com/c2kernel/lifecycle/gui/view/ActivitySlotDefRenderer.java
@@ -19,7 +19,8 @@ public class ActivitySlotDefRenderer implements VertexRenderer
private Paint mTextPaint = Color.black;
- public void draw( Graphics2D g2d, Vertex vertex)
+ @Override
+ public void draw( Graphics2D g2d, Vertex vertex)
{
ActivitySlotDef activitySlotDef = ( ActivitySlotDef )vertex;
boolean hasError = activitySlotDef.verify();
@@ -28,12 +29,12 @@ public class ActivitySlotDefRenderer implements VertexRenderer
GraphPoint centrePoint = activitySlotDef.getCentrePoint();
int vertexHeight = activitySlotDef.getHeight();
int vertexWidth = activitySlotDef.getWidth();
-
+
String[] linesOfText = new String[2+(hasError?0:1)];
FontMetrics metrics = g2d.getFontMetrics();
int lineWidth = 0;
int lineHeight = metrics.getHeight();
- int linesHeight = lineHeight * linesOfText.length;
+ int linesHeight = lineHeight * linesOfText.length;
int linesStartY = centrePoint.y - linesHeight / 2 + lineHeight * 2 / 3;
int x = 0;
int y = 0;
@@ -41,7 +42,7 @@ public class ActivitySlotDefRenderer implements VertexRenderer
linesOfText[0]="("+activitySlotDef.getActivityDef()+")";
linesOfText[1]=(String)activitySlotDef.getProperties().get("Name");
-
+
if (!hasError)linesOfText[2]=Language.translate(activitySlotDef.getErrors());
g2d.setPaint( !hasError ? mErrorPaint : isComposite ? mCompositePaint : mInactivePaint );
@@ -53,7 +54,7 @@ public class ActivitySlotDefRenderer implements VertexRenderer
vertexHeight,
true
);
-
+
g2d.setPaint( mTextPaint );
// Draw the lines of text
diff --git a/source/com/c2kernel/lifecycle/gui/view/CompActDefOutcomeHandler.java b/source/com/c2kernel/lifecycle/gui/view/CompActDefOutcomeHandler.java
index cb0ef59..58964aa 100755..100644
--- a/source/com/c2kernel/lifecycle/gui/view/CompActDefOutcomeHandler.java
+++ b/source/com/c2kernel/lifecycle/gui/view/CompActDefOutcomeHandler.java
@@ -15,7 +15,11 @@ import com.c2kernel.graph.layout.DefaultGraphLayoutGenerator;
import com.c2kernel.graph.view.EditorPanel;
import com.c2kernel.graph.view.VertexPropertyPanel;
import com.c2kernel.gui.MainFrame;
-import com.c2kernel.gui.tabs.outcome.*;
+import com.c2kernel.gui.tabs.outcome.InvalidOutcomeException;
+import com.c2kernel.gui.tabs.outcome.InvalidSchemaException;
+import com.c2kernel.gui.tabs.outcome.OutcomeException;
+import com.c2kernel.gui.tabs.outcome.OutcomeHandler;
+import com.c2kernel.gui.tabs.outcome.OutcomeNotInitialisedException;
import com.c2kernel.lifecycle.CompositeActivityDef;
import com.c2kernel.lifecycle.gui.model.WfDefGraphPanel;
import com.c2kernel.lifecycle.gui.model.WfEdgeDefFactory;
@@ -44,26 +48,26 @@ public class CompActDefOutcomeHandler
protected JButton mLoadButton = new JButton(Resource.getImageResource("graph/load.png"));
protected JButton mLayoutButton = new JButton(Resource.getImageResource("graph/autolayout.png"));
protected JButton[] mOtherToolBarButtons = { mLayoutButton, mLoadButton };
-
+
protected CompositeActivityDef mCompActDef = null;
protected WfEdgeDefFactory mWfEdgeDefFactory = new WfEdgeDefFactory();
- protected WfVertexDefFactory mWfVertexDefFactory = new WfVertexDefFactory();
+ protected WfVertexDefFactory mWfVertexDefFactory = new WfVertexDefFactory();
protected EditorPanel mEditorPanel;
protected VertexPropertyPanel mPropertyPanel;
protected JSplitPane mSplitPane;
boolean unsaved;
-
+
public CompActDefOutcomeHandler() {
super();
- mPropertyPanel = loadPropertyPanel();
- mPropertyPanel.createLayout(new FindActDefPanel());
+ mPropertyPanel = loadPropertyPanel();
+ mPropertyPanel.createLayout(new FindActDefPanel());
mEditorPanel =
new EditorPanel(
mWfEdgeDefFactory,
mWfVertexDefFactory,
new WfVertexDefOutlineCreator(),
- true,
+ true,
mOtherToolBarButtons,
new WfDefGraphPanel(new WfDirectedEdgeDefRenderer(),
new WfVertexDefRenderer()));
@@ -92,7 +96,8 @@ public class CompActDefOutcomeHandler
protected void createListeners()
{
mLoadButton.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent ae) {
+ @Override
+ public void actionPerformed(ActionEvent ae) {
File selectedFile = null;
int returnValue = MainFrame.xmlChooser.showOpenDialog(null);
@@ -110,32 +115,34 @@ public class CompActDefOutcomeHandler
}
case JFileChooser.CANCEL_OPTION :
case JFileChooser.ERROR_OPTION :
-
+
default :
}
}
});
-
+
mLayoutButton.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent ae) {
+ @Override
+ public void actionPerformed(ActionEvent ae) {
DefaultGraphLayoutGenerator.layoutGraph(mEditorPanel.mGraphModelManager.getModel());
}
});
- }
-
+ }
+
public void setUpGraphEditor() {
mEditorPanel.mGraphModelManager.setModel(mCompActDef.getChildrenGraphModel());
// Give the editor panel the edge and vertex types
mEditorPanel.updateVertexTypes(mCompActDef.getVertexTypeNameAndConstructionInfo());
mEditorPanel.updateEdgeTypes(mCompActDef.getEdgeTypeNameAndConstructionInfo());
mEditorPanel.enterSelectMode();
- mWfVertexDefFactory.setCreationContext(mCompActDef);
+ mWfVertexDefFactory.setCreationContext(mCompActDef);
}
-
+
/**
*
*/
- public void setOutcome(String outcome) throws InvalidOutcomeException {
+ @Override
+ public void setOutcome(String outcome) throws InvalidOutcomeException {
try {
CompositeActivityDef newAct = (CompositeActivityDef)CastorXMLUtility.unmarshall(outcome);
if (mCompActDef != null)
@@ -149,14 +156,16 @@ public class CompActDefOutcomeHandler
/**
*
*/
- public void setDescription(String description)
+ @Override
+ public void setDescription(String description)
throws InvalidSchemaException {
- // ignore - always the same
+ // ignore - always the same
}
/**
*
*/
- public void setReadOnly(boolean readOnly) {
+ @Override
+ public void setReadOnly(boolean readOnly) {
mLayoutButton.setEnabled(!readOnly);
mLoadButton.setEnabled(!readOnly);
mEditorPanel.setEditable(!readOnly);
@@ -165,13 +174,15 @@ public class CompActDefOutcomeHandler
/**
*
*/
- public JPanel getPanel() throws OutcomeNotInitialisedException {
+ @Override
+ public JPanel getPanel() throws OutcomeNotInitialisedException {
return this;
}
/**
*
*/
- public String getOutcome() throws OutcomeException {
+ @Override
+ public String getOutcome() throws OutcomeException {
try {
return CastorXMLUtility.marshall(mCompActDef);
} catch (Exception ex) {
@@ -181,20 +192,21 @@ public class CompActDefOutcomeHandler
/**
*
*/
- public void run() {
- Thread.currentThread().setName("Composite Act Def Viewer");
+ @Override
+ public void run() {
+ Thread.currentThread().setName("Composite Act Def Viewer");
createLayout();
createListeners();
- mPropertyPanel.setGraphModelManager(mEditorPanel.mGraphModelManager);
- setUpGraphEditor();
+ mPropertyPanel.setGraphModelManager(mEditorPanel.mGraphModelManager);
+ setUpGraphEditor();
}
-
+
public VertexPropertyPanel loadPropertyPanel()
{
String wfPanelClass = Gateway.getProperty("WfPropertyPanel");
if (wfPanelClass != null) {
try {
- Class panelClass = Class.forName(wfPanelClass);
+ Class<?> panelClass = Class.forName(wfPanelClass);
return (VertexPropertyPanel)panelClass.newInstance();
} catch (Exception ex) {
Logger.error("Could not load wf props panel:"+wfPanelClass);
@@ -203,15 +215,18 @@ public class CompActDefOutcomeHandler
}
return new VertexPropertyPanel();
}
-
- public boolean isUnsaved() {
+
+ @Override
+ public boolean isUnsaved() {
return unsaved;
}
-
- public void saved() {
+
+ @Override
+ public void saved() {
unsaved = false;
}
-
+
+ @Override
public void export(File targetFile) throws Exception {
ElemActDefOutcomeHandler.exportAct(targetFile.getParentFile(), mCompActDef);
}
diff --git a/source/com/c2kernel/lifecycle/gui/view/ElemActDefOutcomeHandler.java b/source/com/c2kernel/lifecycle/gui/view/ElemActDefOutcomeHandler.java
index a30491e..c37e5a7 100755..100644
--- a/source/com/c2kernel/lifecycle/gui/view/ElemActDefOutcomeHandler.java
+++ b/source/com/c2kernel/lifecycle/gui/view/ElemActDefOutcomeHandler.java
@@ -41,7 +41,8 @@ public class ElemActDefOutcomeHandler extends VertexPropertyPanel implements Out
/**
*
*/
- public void setOutcome(String outcome) throws InvalidOutcomeException {
+ @Override
+ public void setOutcome(String outcome) throws InvalidOutcomeException {
try {
act = (ActivityDef)CastorXMLUtility.unmarshall(outcome);
setVertex(act);
@@ -54,7 +55,8 @@ public class ElemActDefOutcomeHandler extends VertexPropertyPanel implements Out
/**
*
*/
- public void setDescription(String description)
+ @Override
+ public void setDescription(String description)
throws InvalidSchemaException {
// ignore
}
@@ -62,7 +64,8 @@ public class ElemActDefOutcomeHandler extends VertexPropertyPanel implements Out
/**
*
*/
- public void setReadOnly(boolean readOnly) {
+ @Override
+ public void setReadOnly(boolean readOnly) {
setEditable(!readOnly);
}
@@ -70,48 +73,54 @@ public class ElemActDefOutcomeHandler extends VertexPropertyPanel implements Out
/**
*
*/
- public JPanel getPanel() throws OutcomeNotInitialisedException {
+ @Override
+ public JPanel getPanel() throws OutcomeNotInitialisedException {
return this;
}
/**
*
*/
- public String getOutcome() throws OutcomeException {
+ @Override
+ public String getOutcome() throws OutcomeException {
try {
return CastorXMLUtility.marshall(act);
} catch (Exception ex) {
Logger.error(ex);
throw new OutcomeException();
- }
+ }
}
/**
*
*/
- public void run() {
+ @Override
+ public void run() {
validate();
}
-
- public boolean isUnsaved() {
+
+ @Override
+ public boolean isUnsaved() {
return unsaved;
}
-
- public void saved() {
+
+ @Override
+ public void saved() {
unsaved = false;
}
-
+
+ @Override
public void export(File targetFile) throws Exception {
exportAct(targetFile.getParentFile(), act);
}
-
+
public static void exportAct(File dir, ActivityDef actDef) throws Exception {
FileStringUtility.string2File(new File(dir, actDef.getActName()+".xml"), CastorXMLUtility.marshall(actDef));
// Export associated schema
exportSchema((String)actDef.getProperties().get("SchemaType"), (String)actDef.getProperties().get("SchemaVersion"), dir);
// Export associated script
exportScript((String)actDef.getProperties().get("ScriptName"), (String)actDef.getProperties().get("ScriptVersion"), dir);
-
+
//Export child act if composite
if (actDef instanceof CompositeActivityDef) {
CompositeActivityDef compActDef = (CompositeActivityDef)actDef;
@@ -121,32 +130,32 @@ public class ElemActDefOutcomeHandler extends VertexPropertyPanel implements Out
exportScript((String)vert.getProperties().get("RoutingScriptName"), (String)vert.getProperties().get("RoutingScriptVersion"), dir);
}
GraphableVertex[] childDefs = compActDef.getLayoutableChildren();
- for (int i=0; i<childDefs.length; i++) {
- if (childDefs[i] instanceof ActivitySlotDef)
- exportAct(dir, ((ActivitySlotDef)childDefs[i]).getTheActivityDef());
+ for (GraphableVertex childDef : childDefs) {
+ if (childDef instanceof ActivitySlotDef)
+ exportAct(dir, ((ActivitySlotDef)childDef).getTheActivityDef());
}
}
}
-
+
public static void exportScript(String name, String version, File dir) {
if (name == null || name.length()==0) return;
try {
- FileStringUtility.string2File(new File(dir, name+"_"+version+".xml"),
+ FileStringUtility.string2File(new File(dir, name+"_"+version+".xml"),
LocalObjectLoader.getScript(name, version));
} catch (Exception ex) {
Logger.error(ex);
JOptionPane.showMessageDialog(null, "Could not export script "+name+"_"+version, "Error", JOptionPane.ERROR_MESSAGE);
}
}
-
+
public static void exportSchema(String name, String version, File dir) {
if (name == null || name.length()==0) return;
try {
- FileStringUtility.string2File(new File(dir, name+"_"+version+".xsd"),
+ FileStringUtility.string2File(new File(dir, name+"_"+version+".xsd"),
LocalObjectLoader.getSchema(name, Integer.parseInt(version)).schema);
} catch (Exception ex) {
Logger.error(ex);
JOptionPane.showMessageDialog(null, "Could not export schema "+name+"_"+version, "Error", JOptionPane.ERROR_MESSAGE);
}
- }
+ }
}
diff --git a/source/com/c2kernel/lifecycle/gui/view/SplitJoinDefRenderer.java b/source/com/c2kernel/lifecycle/gui/view/SplitJoinDefRenderer.java
index 1c6f1ba..84be70c 100755..100644
--- a/source/com/c2kernel/lifecycle/gui/view/SplitJoinDefRenderer.java
+++ b/source/com/c2kernel/lifecycle/gui/view/SplitJoinDefRenderer.java
@@ -39,7 +39,8 @@ public class SplitJoinDefRenderer implements VertexRenderer
private String mXXXText = "XXX";
private int mXXXTextXOffset = 0;
- public void draw( Graphics2D g2d, Vertex vertex)
+ @Override
+ public void draw( Graphics2D g2d, Vertex vertex)
{
GraphPoint centrePoint = vertex.getCentrePoint();
String text = null;
@@ -75,9 +76,9 @@ public class SplitJoinDefRenderer implements VertexRenderer
textXOffset = mAndTextXOffset;
}
else if ( vertex instanceof JoinDef)
- {
+ {
String type= (String)((JoinDef)vertex).getProperties().get("Type");
- if (type!=null && type.equals("Route"))
+ if (type!=null && type.equals("Route"))
{
text = mRouteText;
textXOffset = mRouteTextXOffset;
diff --git a/source/com/c2kernel/lifecycle/gui/view/WfDirectedEdgeDefRenderer.java b/source/com/c2kernel/lifecycle/gui/view/WfDirectedEdgeDefRenderer.java
index 7eb646f..12df7a1 100755..100644
--- a/source/com/c2kernel/lifecycle/gui/view/WfDirectedEdgeDefRenderer.java
+++ b/source/com/c2kernel/lifecycle/gui/view/WfDirectedEdgeDefRenderer.java
@@ -4,6 +4,7 @@ import java.awt.Graphics2D;
import java.awt.Shape;
import java.awt.geom.AffineTransform;
import java.awt.geom.GeneralPath;
+
import com.c2kernel.graph.model.DirectedEdge;
import com.c2kernel.graph.model.GraphPoint;
import com.c2kernel.graph.view.DirectedEdgeRenderer;
@@ -17,6 +18,7 @@ public class WfDirectedEdgeDefRenderer implements DirectedEdgeRenderer
mArrowTemplate.lineTo(0, 0);
mArrowTemplate.lineTo(5, 5);
}
+ @Override
public void draw(Graphics2D g2d, DirectedEdge directedEdge)
{
GraphPoint originPoint = directedEdge.getOriginPoint();
@@ -91,7 +93,7 @@ public class WfDirectedEdgeDefRenderer implements DirectedEdgeRenderer
if (text != null)
g2d.drawString(text, midPoint.x + 10, midPoint.y);
}
- private double calcArrowAngle(int originX, int originY, int terminusX, int terminusY)
+ private static double calcArrowAngle(int originX, int originY, int terminusX, int terminusY)
{
double width = terminusX - originX;
double height = terminusY - originY;
diff --git a/source/com/c2kernel/lifecycle/gui/view/WfVertexDefRenderer.java b/source/com/c2kernel/lifecycle/gui/view/WfVertexDefRenderer.java
index 5f17888..9199615 100755..100644
--- a/source/com/c2kernel/lifecycle/gui/view/WfVertexDefRenderer.java
+++ b/source/com/c2kernel/lifecycle/gui/view/WfVertexDefRenderer.java
@@ -14,7 +14,8 @@ public class WfVertexDefRenderer implements VertexRenderer
protected SplitJoinDefRenderer mSplitJoinDefRenderer = new SplitJoinDefRenderer();
- public void draw( Graphics2D g2d, Vertex vertex)
+ @Override
+ public void draw( Graphics2D g2d, Vertex vertex)
{
if ( vertex instanceof ActivitySlotDef )
{
diff --git a/source/com/c2kernel/lifecycle/instance/Activity.java b/source/com/c2kernel/lifecycle/instance/Activity.java
index a0df570..226f0af 100644
--- a/source/com/c2kernel/lifecycle/instance/Activity.java
+++ b/source/com/c2kernel/lifecycle/instance/Activity.java
@@ -101,6 +101,7 @@ public class Activity extends WfVertex
/**
* adds a New link between the current Activity and the WfVertex passed in param
*/
+ @Override
public Next addNext(WfVertex vertex)
{
return new Next(this, vertex);
@@ -188,13 +189,6 @@ public class Activity extends WfVertex
|| transitionID == Transitions.PROCEED)
try
{
- try
- {
- GTimeStamp t = DateUtility.setToNow(new GTimeStamp());
- }
- catch (Exception e)
- {
- }
runNext(agent);
}
catch (ScriptingEngineException e)
@@ -258,6 +252,7 @@ public class Activity extends WfVertex
return result;
}
/** launch the verification of the activity */
+ @Override
public boolean verify()
{
mErrors.removeAllElements();
@@ -306,6 +301,7 @@ public class Activity extends WfVertex
return true;
}
/** Used in verify() */
+ @Override
public boolean loop()
{
boolean loop2 = false;
@@ -319,6 +315,7 @@ public class Activity extends WfVertex
return loop2;
}
/** sets the next activity available if possible */
+ @Override
public void runNext(AgentPath agent) throws ScriptingEngineException
{
setActive(false);
@@ -372,6 +369,7 @@ public class Activity extends WfVertex
return null;
}
/** reinitialises the Activity and propagate (for Loop) */
+ @Override
public void reinit(int idLoop)
{
Logger.debug(7, "reinit " + getItemEntityPath().getSysKey() + " " + getPath());
@@ -384,16 +382,17 @@ public class Activity extends WfVertex
}
}
/** return the String that identifies the errors found in th activity */
+ @Override
public String getErrors()
{
- String errors = "";
if (mErrors.size() == 0)
return "No error";
- return (String) mErrors.elementAt(0);
+ return mErrors.elementAt(0);
}
/**
* called by precedent Activity runNext() for setting the activity able to be executed
*/
+ @Override
public void run(AgentPath agent) throws ScriptingEngineException
{
Logger.debug(8, getPath() + " run " + getCurrentState());
@@ -418,6 +417,7 @@ public class Activity extends WfVertex
/**
* sets the activity available to be executed on start of Workflow or composite activity (when it is the first one of the (sub)process
*/
+ @Override
public void runfirst(AgentPath agent) throws ScriptingEngineException
{
Logger.debug(8, getPath() + " runfirst");
@@ -613,7 +613,7 @@ public class Activity extends WfVertex
{
String agentRole = getCurrentAgentRole();
if (agentRole == null || agentRole.length()==0) return;
-
+
LDAPRoleManager roleMan = Gateway.getLDAPLookup().getRoleManager();
RolePath myRole;
try {
@@ -625,12 +625,12 @@ public class Activity extends WfVertex
if (myRole.hasJobList())
new JobPusher(this, myRole).start();
- }
-
+ }
+
/**
* Returns the activeDate.
- *
+ *
* @return GTimeStamp
*/
public GTimeStamp getActiveDate()
@@ -638,7 +638,7 @@ public class Activity extends WfVertex
return mActiveDate;
} /**
* Returns the startDate.
- *
+ *
* @return GTimeStamp
*/
public GTimeStamp getStartDate()
@@ -646,7 +646,7 @@ public class Activity extends WfVertex
return mStartDate;
} /**
* Sets the activeDate.
- *
+ *
* @param activeDate
* The activeDate to set
*/
@@ -655,7 +655,7 @@ public class Activity extends WfVertex
mActiveDate = activeDate;
} /**
* Sets the startDate.
- *
+ *
* @param startDate
* The startDate to set
*/
@@ -664,7 +664,7 @@ public class Activity extends WfVertex
mStartDate = startDate;
} /**
* Returns the type.
- *
+ *
* @return String
*/
public String getType()
@@ -672,7 +672,7 @@ public class Activity extends WfVertex
return mType;
} /**
* Sets the type.
- *
+ *
* @param type
* The type to set
*/
diff --git a/source/com/c2kernel/lifecycle/instance/AdvancementCalculator.java b/source/com/c2kernel/lifecycle/instance/AdvancementCalculator.java
index a0d4aab..6a3abe7 100644
--- a/source/com/c2kernel/lifecycle/instance/AdvancementCalculator.java
+++ b/source/com/c2kernel/lifecycle/instance/AdvancementCalculator.java
@@ -47,14 +47,14 @@ public class AdvancementCalculator implements Serializable
{
current.isMarked.put(v, "");
Vertex[] nexts = current.activity.getChildGraphModel().getOutVertices(v);
- for (int i = 0; i < nexts.length; i++)
- if (current.isMarked.get(nexts[i]) != null)
- current.HasNextMarked.put(v, nexts[i]);
+ for (Vertex next : nexts)
+ if (current.isMarked.get(next) != null)
+ current.HasNextMarked.put(v, next);
else
- check(nexts[i], current);
+ check(next, current);
int j=0;
- for (int i = 0; i < nexts.length; i++)
- if (current.HasNextMarked.get(nexts[i]) != null)
+ for (Vertex next : nexts)
+ if (current.HasNextMarked.get(next) != null)
j++;
if (j != 0 && j==nexts.length) current.HasNextMarked.put(v, nexts[0]);
}
@@ -133,33 +133,30 @@ public class AdvancementCalculator implements Serializable
long NbActpassedWithCurrent = 0;
long NbActLeftWithCurrent = 0;
long NbActLeftWithoutCurrent = 0;
- boolean isbranchFinished = true;
boolean hasNobranchFinished = true;
boolean hasNoBranchActive = true;
- for (int i = 0; i < advs.length; i++)
- {
- if (advs[i].mIsbranchActive)
+ for (AdvancementCalculator adv : advs) {
+ if (adv.mIsbranchActive)
hasNoBranchActive = false;
- if (advs[i].mIsbranchFinished)
+ if (adv.mIsbranchFinished)
hasNobranchFinished = false;
}
- for (int i = 0; i < advs.length; i++)
- {
+ for (AdvancementCalculator adv : advs) {
- if (maximuNbActexp < advs[i].mMaximuNbActexp)
- maximuNbActexp = advs[i].mMaximuNbActexp;
- if (advs[i].mIsbranchActive || advs[i].mIsbranchFinished || (hasNoBranchActive && hasNobranchFinished))
+ if (maximuNbActexp < adv.mMaximuNbActexp)
+ maximuNbActexp = adv.mMaximuNbActexp;
+ if (adv.mIsbranchActive || adv.mIsbranchFinished || (hasNoBranchActive && hasNobranchFinished))
{
- if (NbActpassed < advs[i].mNbActpassed)
- NbActpassed = advs[i].mNbActpassed;
- if (NbActpassedWithCurrent < advs[i].mNbActpassedWithCurrent)
- NbActpassedWithCurrent = advs[i].mNbActpassedWithCurrent;
- if (NbActLeftWithCurrent < advs[i].mNbActLeftWithCurrent)
- NbActLeftWithCurrent = advs[i].mNbActLeftWithCurrent;
- if (NbActLeftWithoutCurrent < advs[i].mNbActLeftWithoutCurrent)
- NbActLeftWithoutCurrent += advs[i].mNbActLeftWithoutCurrent;
- if (currentNbActExp < advs[i].mCurrentNbActExp)
- currentNbActExp = advs[i].mCurrentNbActExp;
+ if (NbActpassed < adv.mNbActpassed)
+ NbActpassed = adv.mNbActpassed;
+ if (NbActpassedWithCurrent < adv.mNbActpassedWithCurrent)
+ NbActpassedWithCurrent = adv.mNbActpassedWithCurrent;
+ if (NbActLeftWithCurrent < adv.mNbActLeftWithCurrent)
+ NbActLeftWithCurrent = adv.mNbActLeftWithCurrent;
+ if (NbActLeftWithoutCurrent < adv.mNbActLeftWithoutCurrent)
+ NbActLeftWithoutCurrent += adv.mNbActLeftWithoutCurrent;
+ if (currentNbActExp < adv.mCurrentNbActExp)
+ currentNbActExp = adv.mCurrentNbActExp;
}
}
current.mCurrentNbActExp += currentNbActExp;
diff --git a/source/com/c2kernel/lifecycle/instance/AndSplit.java b/source/com/c2kernel/lifecycle/instance/AndSplit.java
index 7a2055d..63b5640 100755..100644
--- a/source/com/c2kernel/lifecycle/instance/AndSplit.java
+++ b/source/com/c2kernel/lifecycle/instance/AndSplit.java
@@ -15,12 +15,13 @@ public class AndSplit extends Split
{
super();
}
+ @Override
public void runNext(AgentPath agent) throws ScriptingEngineException
{
AdvancementCalculator adv = new AdvancementCalculator();
adv.calculate((CompositeActivity) getParent());
Vertex[] outVertices = getOutGraphables();
- for (int i = 0; i < outVertices.length; i++)
- ((WfVertex) outVertices[i]).run(agent);
+ for (Vertex outVertice : outVertices)
+ ((WfVertex) outVertice).run(agent);
}
}
diff --git a/source/com/c2kernel/lifecycle/instance/CompositeActivity.java b/source/com/c2kernel/lifecycle/instance/CompositeActivity.java
index 797a5db..c080a37 100644
--- a/source/com/c2kernel/lifecycle/instance/CompositeActivity.java
+++ b/source/com/c2kernel/lifecycle/instance/CompositeActivity.java
@@ -49,7 +49,8 @@ public class CompositeActivity extends Activity
* Functions--------------- --------------------------------------------
*/
/** launch the verification of the subprocess() */
- public boolean verify()
+ @Override
+ public boolean verify()
{
boolean err = super.verify();
GraphableVertex[] vChildren = getChildren();
@@ -66,14 +67,14 @@ public class CompositeActivity extends Activity
/**
* Method initChild.
- *
+ *
* @param act
* @param first
* @param point
*/
/**
* Create an initialize a Activity attached to the current activity
- *
+ *
* @param first :
* if true, the activity Waiting will be one of the first
* launched by the parent activity
@@ -90,7 +91,7 @@ public class CompositeActivity extends Activity
/**
* Method newChild.
- *
+ *
* @param Name
* @param Type
* @param point
@@ -105,7 +106,7 @@ public class CompositeActivity extends Activity
/**
* Method newChild.
- *
+ *
* @param Name
* @param Type
* @param point
@@ -120,7 +121,7 @@ public class CompositeActivity extends Activity
/**
* Method newChild.
- *
+ *
* @param vertexTypeId
* @param point
* @return WfVertex
@@ -161,7 +162,7 @@ public class CompositeActivity extends Activity
/**
* Method newCompChild.
- *
+ *
* @param id
* @param first
* @param point
@@ -178,13 +179,13 @@ public class CompositeActivity extends Activity
/**
* Method newAtomChild.
- *
+ *
* @param id
* @param first
* @param point
* @return Activity Create an initialize an Atomic Activity attached to the
* current activity
- *
+ *
*/
public Activity newAtomChild(String id, boolean first, Point point)
{
@@ -196,7 +197,7 @@ public class CompositeActivity extends Activity
/**
* Method newSplitChild.
- *
+ *
* @param Type
* @param point
* @return Split
@@ -223,7 +224,7 @@ public class CompositeActivity extends Activity
/**
* Method newJoinChild.
- *
+ *
* @param point
* @return Join
*/
@@ -245,7 +246,7 @@ public class CompositeActivity extends Activity
/**
* Method search.
- *
+ *
* @param ids
* @return WfVertex
*/
@@ -275,17 +276,19 @@ public class CompositeActivity extends Activity
/**
* @see com.c2kernel.lifecycle.instance.WfVertex#run()
*/
- public void run(AgentPath agent) throws ScriptingEngineException
+ @Override
+ public void run(AgentPath agent) throws ScriptingEngineException
{
super.run(agent);
if (getChildrenGraphModel().getStartVertex() != null && getMachine().getCurrentState() != States.FINISHED && ((Boolean) getProperties().get(StateMachine.AUTOSTART)).booleanValue())
{
WfVertex first = (WfVertex) getChildrenGraphModel().getStartVertex();
- ((WfVertex) getChildrenGraphModel().getStartVertex()).run(agent);
+ first.run(agent);
}
}
- public void runNext(AgentPath agent) throws ScriptingEngineException
+ @Override
+ public void runNext(AgentPath agent) throws ScriptingEngineException
{
if (getMachine().state != States.FINISHED)
getMachine().traverse(Transitions.COMPLETE);
@@ -296,7 +299,8 @@ public class CompositeActivity extends Activity
* @see com.c2kernel.lifecycle.instance.Activity#query(com.c2kernel.common.AgentInfo,
* java.lang.String, boolean)
*/
- public Activity[] query(AgentPath agent, int stateID, boolean filter)
+ @Override
+ public Activity[] query(AgentPath agent, int stateID, boolean filter)
{
Vector<Activity[]> steps = new Vector<Activity[]>();
Activity[] returnArray = null;
@@ -307,7 +311,7 @@ public class CompositeActivity extends Activity
}
int j = 0;
for (int i = 0; i < steps.size(); i++)
- j += ((Activity[]) steps.elementAt(i)).length;
+ j += steps.elementAt(i).length;
Activity[] tmp = super.query(agent, stateID, filter);
if (tmp.length == 1)
{
@@ -318,9 +322,9 @@ public class CompositeActivity extends Activity
j = 0;
for (int i = 0; i < steps.size(); i++)
{
- Activity[] stepArray = (Activity[]) steps.elementAt(i);
- for (int k = 0; k < stepArray.length; k++)
- returnArray[j++] = stepArray[k];
+ Activity[] stepArray = steps.elementAt(i);
+ for (Activity element : stepArray)
+ returnArray[j++] = element;
}
return returnArray;
}
@@ -328,7 +332,8 @@ public class CompositeActivity extends Activity
/**
* @see com.c2kernel.lifecycle.instance.Activity#calculateJobs()
*/
- public ArrayList<Job> calculateJobs(AgentPath agent, boolean recurse)
+ @Override
+ public ArrayList<Job> calculateJobs(AgentPath agent, boolean recurse)
{
ArrayList<Job> jobs = new ArrayList<Job>();
boolean childActive = false;
@@ -345,7 +350,8 @@ public class CompositeActivity extends Activity
return jobs;
}
- public ArrayList<Job> calculateAllJobs(AgentPath agent, boolean recurse)
+ @Override
+ public ArrayList<Job> calculateAllJobs(AgentPath agent, boolean recurse)
{
ArrayList<Job> jobs = new ArrayList<Job>();
if (recurse)
@@ -361,7 +367,7 @@ public class CompositeActivity extends Activity
/**
* Method addNext.
- *
+ *
* @param origin
* @param terminus
* @return Next
@@ -373,7 +379,7 @@ public class CompositeActivity extends Activity
/**
* Method addNext.
- *
+ *
* @param originID
* @param terminusID
* @return Next
@@ -388,7 +394,7 @@ public class CompositeActivity extends Activity
/**
* Method hasGoodNumberOfActivity.
- *
+ *
* @return boolean
*/
public boolean hasGoodNumberOfActivity()
@@ -408,7 +414,8 @@ public class CompositeActivity extends Activity
/**
* @see com.c2kernel.lifecycle.instance.Activity#getType()
*/
- public String getType()
+ @Override
+ public String getType()
{
if (getName().equals("domain"))
return "domain";
@@ -416,16 +423,18 @@ public class CompositeActivity extends Activity
}
/**
- *
+ *
*/
- public void reinit(int idLoop)
+ @Override
+ public void reinit(int idLoop)
{
super.reinit(idLoop);
if (getChildrenGraphModel().getStartVertex() != null && getMachine().getCurrentState() != States.FINISHED)
((WfVertex) getChildrenGraphModel().getStartVertex()).reinit(idLoop);
}
- public void request(AgentPath agent, int transitionID, String requestData) throws AccessRightsException, InvalidTransitionException, InvalidDataException, ObjectAlreadyExistsException
+ @Override
+ public void request(AgentPath agent, int transitionID, String requestData) throws AccessRightsException, InvalidTransitionException, InvalidDataException, ObjectAlreadyExistsException
{
if (getChildrenGraphModel().getStartVertex() != null && getMachine().getCurrentState() != States.FINISHED && transitionID == Transitions.START)
try
@@ -440,10 +449,10 @@ public class CompositeActivity extends Activity
public void refreshJobs()
{
GraphableVertex[] children = getChildren();
- for (int i = 0; i < children.length; i++)
- if (children[i] instanceof CompositeActivity)
- ((CompositeActivity) children[i]).refreshJobs();
- else if (children[i] instanceof Activity)
- ((Activity) children[i]).pushJobsToAgents();
+ for (GraphableVertex element : children)
+ if (element instanceof CompositeActivity)
+ ((CompositeActivity) element).refreshJobs();
+ else if (element instanceof Activity)
+ ((Activity) element).pushJobsToAgents();
}
} \ No newline at end of file
diff --git a/source/com/c2kernel/lifecycle/instance/EventStorage.java b/source/com/c2kernel/lifecycle/instance/EventStorage.java
index a78a2bf..40cffaf 100755..100644
--- a/source/com/c2kernel/lifecycle/instance/EventStorage.java
+++ b/source/com/c2kernel/lifecycle/instance/EventStorage.java
@@ -8,7 +8,7 @@ import java.util.Hashtable;
*/
public class EventStorage implements Serializable
{
- private Hashtable mLists;
+ private Hashtable<?, ?> mLists;
private EventList[] dummy = new EventList[0];
public Integer lastTransitionStored;
@@ -16,9 +16,9 @@ public class EventStorage implements Serializable
{
return dummy;
}
-
+
public void setLists(EventList[] lists)
{
}
-
+
}
diff --git a/source/com/c2kernel/lifecycle/instance/JobPusher.java b/source/com/c2kernel/lifecycle/instance/JobPusher.java
index e58170d..c6e5d26 100755..100644
--- a/source/com/c2kernel/lifecycle/instance/JobPusher.java
+++ b/source/com/c2kernel/lifecycle/instance/JobPusher.java
@@ -22,10 +22,11 @@ final class JobPusher extends Thread {
this.myRole = role;
}
- public void run()
+ @Override
+ public void run()
{
Thread.currentThread().setName("Agent job pusher for "+activity.getName()+" to role "+myRole);
- for (Enumeration e = myRole.getChildren(); e.hasMoreElements();)
+ for (Enumeration<?> e = myRole.getChildren(); e.hasMoreElements();)
{
AgentPath nextAgent = (AgentPath)e.nextElement();
Logger.msg(7, "Activity.pushJobsToAgents() - Calculating jobs for " + nextAgent.getAgentName());
@@ -34,7 +35,7 @@ final class JobPusher extends Thread {
// get joblist for user
JobArrayList jobList = new JobArrayList(this.activity.calculateJobs(nextAgent, false));
// only transmit start, complete and resume jobs
- for (Iterator element = jobList.list.iterator(); element.hasNext();)
+ for (Iterator<?> element = jobList.list.iterator(); element.hasNext();)
{
Job thisJob = (Job) element.next();
if (thisJob.getPossibleTransition() != Transitions.START
@@ -64,6 +65,6 @@ final class JobPusher extends Thread {
Logger.error(ex);
}
}
-
+
}
} \ No newline at end of file
diff --git a/source/com/c2kernel/lifecycle/instance/Join.java b/source/com/c2kernel/lifecycle/instance/Join.java
index b61100e..3a4fd7d 100644
--- a/source/com/c2kernel/lifecycle/instance/Join.java
+++ b/source/com/c2kernel/lifecycle/instance/Join.java
@@ -26,6 +26,7 @@ public class Join extends WfVertex
/**
* @see com.c2kernel.lifecycle.instance.WfVertex#runNext()
*/
+ @Override
public void runNext(AgentPath agent) throws ScriptingEngineException
{
AdvancementCalculator adv = new AdvancementCalculator();
@@ -44,7 +45,7 @@ public class Join extends WfVertex
}
/**
* Method addNext.
- *
+ *
* @param idNext
*/
public void addNext(String idNext)
@@ -54,6 +55,7 @@ public class Join extends WfVertex
/**
* @see com.c2kernel.lifecycle.instance.WfVertex#reinit(int)
*/
+ @Override
public void reinit(int idLoop)
{
Vertex[] outVertices = getOutGraphables();
@@ -65,7 +67,7 @@ public class Join extends WfVertex
}
/**
* Method getItemSystemKey.
- *
+ *
* @return String
*/
/*
@@ -77,7 +79,7 @@ public class Join extends WfVertex
}
/**
* Method setItemSystemKey.
- *
+ *
* @param itemSystemKey
*/
public void setItemSystemKey(String itemSystemKey)
@@ -90,6 +92,7 @@ public class Join extends WfVertex
// public void initItemSystemKey(String systemKey) {
// this.setItemSystemKey(systemKey);
// }
+ @Override
public boolean verify()
{
mErrors.removeAllElements();
@@ -153,16 +156,18 @@ public class Join extends WfVertex
/**
* @see com.c2kernel.lifecycle.instance.WfVertex#getErrors()
*/
+ @Override
public String getErrors()
{
if (mErrors.size() == 0)
return "No error";
else
- return (String) mErrors.elementAt(0);
+ return mErrors.elementAt(0);
}
/**
* @see com.c2kernel.lifecycle.instance.WfVertex#run()
*/
+ @Override
public void run(AgentPath agent) throws ScriptingEngineException
{
runNext(agent);
@@ -170,6 +175,7 @@ public class Join extends WfVertex
/**
* @see com.c2kernel.lifecycle.instance.WfVertex#addNext(com.c2kernel.lifecycle.instance.WfVertex)
*/
+ @Override
public Next addNext(WfVertex vertex)
{
return new Next(this, vertex);
@@ -177,6 +183,7 @@ public class Join extends WfVertex
/**
* @see com.c2kernel.lifecycle.instance.WfVertex#loop()
*/
+ @Override
public boolean loop()
{
boolean loop2 = false;
@@ -191,15 +198,17 @@ public class Join extends WfVertex
loopTested = false;
return loop2;
}
+ @Override
public void runfirst(AgentPath agent) throws ScriptingEngineException
{
runNext(agent);
}
/*
* (non-Javadoc)
- *
+ *
* @see com.c2kernel.graph.model.Vertex#isJoin()
*/
+ @Override
public boolean isJoin()
{
return true;
diff --git a/source/com/c2kernel/lifecycle/instance/Loop.java b/source/com/c2kernel/lifecycle/instance/Loop.java
index 556a9ca..8228ba9 100755..100644
--- a/source/com/c2kernel/lifecycle/instance/Loop.java
+++ b/source/com/c2kernel/lifecycle/instance/Loop.java
@@ -20,10 +20,12 @@ public class Loop extends XOrSplit
/**
* @see com.c2kernel.lifecycle.instance.WfVertex#loop()
*/
+ @Override
public boolean loop()
{
return true;
}
+ @Override
public void followNext(Next activeNext, AgentPath agent) throws ScriptingEngineException
{
WfVertex v = activeNext.getTerminusVertex();
@@ -38,6 +40,7 @@ public class Loop extends XOrSplit
/**
* @see com.c2kernel.lifecycle.instance.WfVertex#reinit(int)
*/
+ @Override
public void reinit(int idLoop)
{
Logger.msg(8, "Loop.reinit");
@@ -56,6 +59,7 @@ public class Loop extends XOrSplit
/**
* @see com.c2kernel.lifecycle.instance.WfVertex#verify()
*/
+ @Override
public boolean verify()
{
boolean err = super.verify();
@@ -64,13 +68,12 @@ public class Loop extends XOrSplit
int k = 0;
int l = 0;
Vertex[] brothers = getParent().getChildren();
- for (int i = 0; i < brothers.length; i++)
- if (brothers[i] instanceof Loop)
+ for (Vertex brother : brothers)
+ if (brother instanceof Loop)
l++;
- for (int i = 0; i < nexts.length; i++)
- {
- for (int j = 0; j < anteVertices.length; j++)
- if (nexts[i].getID() == anteVertices[j].getID())
+ for (Vertex next : nexts) {
+ for (Vertex anteVertice : anteVertices)
+ if (next.getID() == anteVertice.getID())
k++;
}
if (k != 1 && !(l > 1))
@@ -88,15 +91,15 @@ public class Loop extends XOrSplit
{
int id = vertex.getID();
Vertex[] anteVertices = GraphTraversal.getTraversal(getParent().getChildrenGraphModel(), this, GraphTraversal.kUp, false);
- for (int i = 0; i < anteVertices.length; i++)
- {
- if (anteVertices[i].getID() == id)
+ for (Vertex anteVertice : anteVertices) {
+ if (anteVertice.getID() == id)
{
return true;
}
}
return false;
}
+ @Override
public boolean isLoop()
{
return true;
diff --git a/source/com/c2kernel/lifecycle/instance/Next.java b/source/com/c2kernel/lifecycle/instance/Next.java
index 059dbf8..4df775c 100755..100644
--- a/source/com/c2kernel/lifecycle/instance/Next.java
+++ b/source/com/c2kernel/lifecycle/instance/Next.java
@@ -28,7 +28,7 @@ public class Next extends GraphableEdge
{
super(pre, nex);
getProperties().put("Alias","");
- getProperties().put("Type","Straight");
+ getProperties().put("Type","Straight");
}
/**
@@ -43,6 +43,7 @@ public class Next extends GraphableEdge
{
return (WfVertex)((CompositeActivity)getParent()).getWf().search(getParent().getPath()+"/"+this.getTerminusVertexId());
}
+ @Override
public boolean containsPoint(GraphPoint p)
{
GraphPoint originPoint = getOriginPoint();
diff --git a/source/com/c2kernel/lifecycle/instance/OrSplit.java b/source/com/c2kernel/lifecycle/instance/OrSplit.java
index f0fcdd5..aea34b2 100755..100644
--- a/source/com/c2kernel/lifecycle/instance/OrSplit.java
+++ b/source/com/c2kernel/lifecycle/instance/OrSplit.java
@@ -18,6 +18,7 @@ public class OrSplit extends Split
{
super();
}
+ @Override
public void runNext(AgentPath agent) throws ScriptingEngineException
{
String nexts =
@@ -36,9 +37,8 @@ public class OrSplit extends Split
{
String thisNext = tok.nextToken();
Logger.msg(7, "Finding next " + thisNext);
- for (int i = 0; i < outEdges.length; i++)
- {
- Next nextEdge = (Next) outEdges[i];
+ for (DirectedEdge outEdge : outEdges) {
+ Next nextEdge = (Next) outEdge;
if (thisNext != null && thisNext.equals(nextEdge.getProperties().get("Alias")))
{
WfVertex term = nextEdge.getTerminusVertex();
@@ -57,6 +57,6 @@ public class OrSplit extends Split
if (active == 0)
throw new ScriptingEngineException("No nexts were activated!");
}
-
-
+
+
}
diff --git a/source/com/c2kernel/lifecycle/instance/ParserWF.java b/source/com/c2kernel/lifecycle/instance/ParserWF.java
index 35fed90..02a0c6d 100644
--- a/source/com/c2kernel/lifecycle/instance/ParserWF.java
+++ b/source/com/c2kernel/lifecycle/instance/ParserWF.java
@@ -35,7 +35,6 @@ public class ParserWF
nexts = new Vector<String[]>(1, 1);
i = 0;
file = xmlfile;
- int c;
while (i < file.length() - 5)
{
if (file.substring(i, i + 5).equals("<STEP"))
@@ -52,12 +51,12 @@ public class ParserWF
{
for (int k = j + 1; k < nexts.size(); k++)
{
- if (((String[]) nexts.elementAt(j))[0].equals(((String[]) nexts.elementAt(k))[0]))
+ if (nexts.elementAt(j)[0].equals(nexts.elementAt(k)[0]))
{
int tmp = act.newSplitChild("And", new Point(0, 0)).getID();
- ((WfVertex) act.search(((String[]) nexts.elementAt(k))[0])).addNext(act.search(tmp));
- ((Split) act.search(tmp)).addNext((WfVertex) act.search(((String[]) nexts.elementAt(k))[1]));
- ((Split) act.search(tmp)).addNext((WfVertex) act.search(((String[]) nexts.elementAt(j))[1]));
+ ((WfVertex) act.search(nexts.elementAt(k)[0])).addNext(act.search(tmp));
+ ((Split) act.search(tmp)).addNext((WfVertex) act.search(nexts.elementAt(k)[1]));
+ ((Split) act.search(tmp)).addNext((WfVertex) act.search(nexts.elementAt(j)[1]));
nexts.removeElementAt(k--);
flag = true;
}
@@ -72,12 +71,12 @@ public class ParserWF
{
for (int k = j + 1; k < nexts.size(); k++)
{
- if (((String[]) nexts.elementAt(j))[1].equals(((String[]) nexts.elementAt(k))[1]))
+ if (nexts.elementAt(j)[1].equals(nexts.elementAt(k)[1]))
{
int tmp = act.newJoinChild(new Point(0, 0)).getID();
- ((WfVertex) act.search(((String[]) nexts.elementAt(j))[0])).addNext(act.search(tmp));
- ((WfVertex) act.search(((String[]) nexts.elementAt(k))[0])).addNext(act.search(tmp));
- ((Join) act.search(tmp)).addNext(((String[]) nexts.elementAt(j))[1]);
+ ((WfVertex) act.search(nexts.elementAt(j)[0])).addNext(act.search(tmp));
+ ((WfVertex) act.search(nexts.elementAt(k)[0])).addNext(act.search(tmp));
+ ((Join) act.search(tmp)).addNext(nexts.elementAt(j)[1]);
nexts.removeElementAt(k--);
flag = true;
}
@@ -92,8 +91,8 @@ public class ParserWF
{
Logger.msg(
7,
- "try to add next " + ((String[]) nexts.elementAt(j))[1] + " to " + ((String[]) nexts.elementAt(j))[0]);
- ((Activity) act.search(((String[]) nexts.elementAt(j))[0])).addNext(((String[]) nexts.elementAt(j))[1]);
+ "try to add next " + nexts.elementAt(j)[1] + " to " + nexts.elementAt(j)[0]);
+ ((Activity) act.search(nexts.elementAt(j)[0])).addNext(nexts.elementAt(j)[1]);
}
if (act instanceof Workflow)
try
diff --git a/source/com/c2kernel/lifecycle/instance/Split.java b/source/com/c2kernel/lifecycle/instance/Split.java
index e7b275c..4fe1bfc 100644
--- a/source/com/c2kernel/lifecycle/instance/Split.java
+++ b/source/com/c2kernel/lifecycle/instance/Split.java
@@ -32,11 +32,12 @@ public abstract class Split extends WfVertex
/**
* @see com.c2kernel.lifecycle.instance.WfVertex#runNext()
*/
- public abstract void runNext(AgentPath agent) throws ScriptingEngineException;
+ @Override
+ public abstract void runNext(AgentPath agent) throws ScriptingEngineException;
/**
* Method addNext.
- *
+ *
* @param idNext
*/
void addNext(String idNext)
@@ -47,7 +48,8 @@ public abstract class Split extends WfVertex
/**
* @see com.c2kernel.lifecycle.instance.WfVertex#addNext(com.c2kernel.lifecycle.instance.WfVertex)
*/
- public Next addNext(WfVertex vertex)
+ @Override
+ public Next addNext(WfVertex vertex)
{
Next nxt = new Next(this, vertex);
int num = getOutGraphables().length;
@@ -64,7 +66,7 @@ public abstract class Split extends WfVertex
/**
* Method getItemSystemKey.
- *
+ *
* @return int
*/
public int getItemSystemKey()
@@ -74,7 +76,7 @@ public abstract class Split extends WfVertex
/**
* Method setItemSystemKey.
- *
+ *
* @param itemSystemKey
*/
public void setItemSystemKey(int itemSystemKey)
@@ -88,17 +90,19 @@ public abstract class Split extends WfVertex
// public void initItemSystemKey(String systemKey) {
// setItemSystemKey(systemKey);
// }
- public void reinit(int idLoop)
+ @Override
+ public void reinit(int idLoop)
{
Vertex[] outVertices = getOutGraphables();
- for (int i = 0; i < outVertices.length; i++)
- ((WfVertex) outVertices[i]).reinit(idLoop);
+ for (Vertex outVertice : outVertices)
+ ((WfVertex) outVertice).reinit(idLoop);
}
/**
* @see com.c2kernel.lifecycle.instance.WfVertex#verify()
*/
- public boolean verify()
+ @Override
+ public boolean verify()
{
mErrors.removeAllElements();
int nbInEdgres = getParent().getChildrenGraphModel().getInEdges(this).length;
@@ -151,18 +155,20 @@ public abstract class Split extends WfVertex
/**
* @see com.c2kernel.lifecycle.instance.WfVertex#getErrors()
*/
- public String getErrors()
+ @Override
+ public String getErrors()
{
if (mErrors.size() == 0)
return "No error";
else
- return (String) mErrors.elementAt(0);
+ return mErrors.elementAt(0);
}
/**
* @see com.c2kernel.lifecycle.instance.WfVertex#run()
*/
- public void run(AgentPath agent) throws ScriptingEngineException
+ @Override
+ public void run(AgentPath agent) throws ScriptingEngineException
{
runNext(agent);
}
@@ -170,7 +176,8 @@ public abstract class Split extends WfVertex
/**
* @see com.c2kernel.lifecycle.instance.WfVertex#loop()
*/
- public boolean loop()
+ @Override
+ public boolean loop()
{
boolean loop2 = false;
if (!loopTested)
@@ -203,13 +210,14 @@ public abstract class Split extends WfVertex
{
if (test == null)
return false;
- for (int i = 0; i < list.length; i++)
- if (test.equals(list[i]))
+ for (String element : list)
+ if (test.equals(element))
return true;
return false;
}
- public void runfirst(AgentPath agent) throws ScriptingEngineException
+ @Override
+ public void runfirst(AgentPath agent) throws ScriptingEngineException
{
runNext(agent);
}
diff --git a/source/com/c2kernel/lifecycle/instance/WfVertex.java b/source/com/c2kernel/lifecycle/instance/WfVertex.java
index 7285916..f6cec33 100755..100644
--- a/source/com/c2kernel/lifecycle/instance/WfVertex.java
+++ b/source/com/c2kernel/lifecycle/instance/WfVertex.java
@@ -27,7 +27,7 @@ public abstract class WfVertex extends GraphableVertex
/**sets the activity available to be executed on start of Workflow or composite activity (when it is the first one of the
* (sub)process*/
public abstract void runfirst(AgentPath agent) throws ScriptingEngineException;
-
+
/**
* @see java.lang.Object#Object()
*/
@@ -88,7 +88,7 @@ public abstract class WfVertex extends GraphableVertex
* @param vertex
*/
public abstract Next addNext(WfVertex vertex);
-
+
protected Object evaluateScript(String scriptName, String scriptVersion) throws ScriptingEngineException
{
@@ -98,12 +98,11 @@ public abstract class WfVertex extends GraphableVertex
Script script = getScript(scriptName, scriptVersion);
KeyValuePair[] k = getProperties().getKeyValuePairs();
- HashMap requiredInput = script.getAllInputParams();
- for (int i = 0; i < k.length; i++)
- {
- if (requiredInput.containsKey(k[i].getKey()))
+ HashMap<?, ?> requiredInput = script.getAllInputParams();
+ for (KeyValuePair element : k) {
+ if (requiredInput.containsKey(element.getKey()))
{
- String value = k[i].getStringValue();
+ String value = element.getStringValue();
Object inputParam = value;
if (value.startsWith("viewpoint//"))
@@ -126,11 +125,11 @@ public abstract class WfVertex extends GraphableVertex
inputParam = null;
}
}
- Logger.msg(5, "Split.evaluateScript() - Setting param " + k[i].getKey() + " to " + inputParam.toString());
- script.setInputParamValue(k[i].getKey(), inputParam);
+ Logger.msg(5, "Split.evaluateScript() - Setting param " + element.getKey() + " to " + inputParam.toString());
+ script.setInputParamValue(element.getKey(), inputParam);
}
}
-
+
if (requiredInput.containsKey("item")) {
script.setInputParamValue("item", Gateway.getProxyManager().getProxy(entity));
}
@@ -150,8 +149,8 @@ public abstract class WfVertex extends GraphableVertex
throw new ScriptingEngineException();
}
}
-
- private Script getScript(String name, String version) throws ScriptingEngineException
+
+ private static Script getScript(String name, String version) throws ScriptingEngineException
{
Script script;
try
@@ -171,8 +170,8 @@ public abstract class WfVertex extends GraphableVertex
return script;
}
-
-
+
+
public Workflow getWf()
{
return ((CompositeActivity)getParent()).getWf();
diff --git a/source/com/c2kernel/lifecycle/instance/Workflow.java b/source/com/c2kernel/lifecycle/instance/Workflow.java
index 4c8aa94..1d12ee6 100644
--- a/source/com/c2kernel/lifecycle/instance/Workflow.java
+++ b/source/com/c2kernel/lifecycle/instance/Workflow.java
@@ -46,7 +46,7 @@ public class Workflow extends CompositeActivity implements C2KLocalObject
{
getProperties().put("ItemSystemKey", null);
}
-
+
public Workflow(CompositeActivity domain) {
this();
domain.setName("domain");
@@ -54,10 +54,10 @@ public class Workflow extends CompositeActivity implements C2KLocalObject
PredefinedStepContainer act = new PredefinedStepContainer();
addChild(act, new GraphPoint(300, 100));
}
-
+
/**
* Method getVertexTypeNameAndConstructionInfo.
- *
+ *
* @return TypeNameAndConstructionInfo[]
*/
/** getVertexTypeNameAndConstructionInfo() added by Steve */
@@ -67,7 +67,7 @@ public class Workflow extends CompositeActivity implements C2KLocalObject
}
/**
* Method getEdgeTypeNameAndConstructionInfo.
- *
+ *
* @return TypeNameAndConstructionInfo[]
*/
/** getVertexTypeNameAndConstructionInfo() added by Steve */
@@ -77,7 +77,7 @@ public class Workflow extends CompositeActivity implements C2KLocalObject
}
/**
* Method requestAction.
- *
+ *
* @param agentInfo
* @param stepPath
* @param transitionID
@@ -101,6 +101,7 @@ public class Workflow extends CompositeActivity implements C2KLocalObject
/**
* @see com.c2kernel.graph.model.GraphableVertex#getPath()
*/
+ @Override
public String getPath()
{
return "workflow";
@@ -108,6 +109,7 @@ public class Workflow extends CompositeActivity implements C2KLocalObject
/**
* @see com.c2kernel.graph.model.Vertex#getName()
*/
+ @Override
public String getName()
{
return "workflow";
@@ -115,6 +117,7 @@ public class Workflow extends CompositeActivity implements C2KLocalObject
/**
* @see com.c2kernel.lifecycle.instance.Activity#getType()
*/
+ @Override
public String getType()
{
return "workflow";
@@ -122,12 +125,14 @@ public class Workflow extends CompositeActivity implements C2KLocalObject
/**
* @see com.c2kernel.graph.model.Vertex#setName(java.lang.String)
*/
+ @Override
public void setName(String name)
{
}
/**
* @see com.c2kernel.lifecycle.instance.WfVertex#verify()
*/
+ @Override
public boolean verify()
{
for (int i = 0; i < getChildren().length; i++)
@@ -143,13 +148,14 @@ public class Workflow extends CompositeActivity implements C2KLocalObject
/**
* @see com.c2kernel.lifecycle.instance.Activity#getWf()
*/
+ @Override
public Workflow getWf()
{
return this;
}
/**
* Method initialise.
- *
+ *
* @param systemKey
*/
public void initialise(int systemKey, AgentPath agent)
@@ -166,7 +172,7 @@ public class Workflow extends CompositeActivity implements C2KLocalObject
}
/**
* Method calculateJobs.
- *
+ *
* @param type
* @return JobList
*/
@@ -185,6 +191,7 @@ public class Workflow extends CompositeActivity implements C2KLocalObject
/**
* @see com.c2kernel.lifecycle.instance.CompositeActivity#hasGoodNumberOfActivity()
*/
+ @Override
public boolean hasGoodNumberOfActivity()
{
return true;
@@ -192,6 +199,7 @@ public class Workflow extends CompositeActivity implements C2KLocalObject
/**
* @see com.c2kernel.entity.C2KLocalObject#getClusterType()
*/
+ @Override
public String getClusterType()
{
return ClusterStorage.LIFECYCLE;
diff --git a/source/com/c2kernel/lifecycle/instance/XOrSplit.java b/source/com/c2kernel/lifecycle/instance/XOrSplit.java
index 108aa61..25baf0b 100644
--- a/source/com/c2kernel/lifecycle/instance/XOrSplit.java
+++ b/source/com/c2kernel/lifecycle/instance/XOrSplit.java
@@ -21,32 +21,32 @@ public class XOrSplit extends Split
super();
}
- public void runNext(AgentPath agent) throws ScriptingEngineException
+ @Override
+ public void runNext(AgentPath agent) throws ScriptingEngineException
{
ArrayList<DirectedEdge> nextsToFollow = new ArrayList<DirectedEdge>();
String nexts = this.evaluateScript(
- (String) getProperties().get("RoutingScriptName"),
+ (String) getProperties().get("RoutingScriptName"),
(String) getProperties().get("RoutingScriptVersion")).toString();
-
+
StringTokenizer tok = new StringTokenizer(nexts,",");
String[] nextsTab = new String[tok.countTokens()];
for (int i=0;i<nextsTab.length;i++)
- nextsTab[i] = tok.nextToken();
+ nextsTab[i] = tok.nextToken();
DirectedEdge[] outEdges = getOutEdges();
- for (int i = 0; i < outEdges.length; i++)
- {
- if (isInTable((String)((Next)outEdges[i]).getProperties().get("Alias"), nextsTab))
- nextsToFollow.add(outEdges[i]);
+ for (DirectedEdge outEdge : outEdges) {
+ if (isInTable((String)((Next)outEdge).getProperties().get("Alias"), nextsTab))
+ nextsToFollow.add(outEdge);
}
// Logger.debug(0, getID()+" following "+nexts);
if (nextsToFollow.size() != 1)
throw new ScriptingEngineException("not good number of active next");
-
+
followNext((Next)nextsToFollow.get(0), agent);
-
+
}
-
+
public void followNext(Next activeNext, AgentPath agent) throws ScriptingEngineException {
activeNext.getTerminusVertex().run(agent);
}
diff --git a/source/com/c2kernel/lifecycle/instance/gui/model/WfEdgeFactory.java b/source/com/c2kernel/lifecycle/instance/gui/model/WfEdgeFactory.java
index f79d312..e96ef37 100755..100644
--- a/source/com/c2kernel/lifecycle/instance/gui/model/WfEdgeFactory.java
+++ b/source/com/c2kernel/lifecycle/instance/gui/model/WfEdgeFactory.java
@@ -9,7 +9,8 @@ import com.c2kernel.lifecycle.instance.WfVertex;
public class WfEdgeFactory implements EdgeFactory
{
- public void create
+ @Override
+ public void create
(
GraphModelManager graphModelManager,
Vertex origin,
@@ -22,7 +23,7 @@ public class WfEdgeFactory implements EdgeFactory
}
- private boolean validCreation( GraphModelManager graphModelManager, Vertex origin, Vertex terminus )
+ private static boolean validCreation( GraphModelManager graphModelManager, Vertex origin, Vertex terminus )
{
DirectedEdge[] connectingEdgesAToB = graphModelManager.getModel().getConnectingEdges( origin.getID() , terminus.getID() );
DirectedEdge[] connectingEdgesBToA = graphModelManager.getModel().getConnectingEdges( terminus.getID(), origin.getID() );
diff --git a/source/com/c2kernel/lifecycle/instance/gui/model/WfGraphPanel.java b/source/com/c2kernel/lifecycle/instance/gui/model/WfGraphPanel.java
index 752e1fa..16c8e16 100755..100644
--- a/source/com/c2kernel/lifecycle/instance/gui/model/WfGraphPanel.java
+++ b/source/com/c2kernel/lifecycle/instance/gui/model/WfGraphPanel.java
@@ -18,6 +18,7 @@ public class WfGraphPanel extends GraphPanel
super(d,v);
}
// Draws the highlight of the specified edge
+ @Override
protected void drawEdgeHighlight(Graphics2D g2d, DirectedEdge edge)
{
GraphPoint originPoint = edge.getOriginPoint();
@@ -49,7 +50,7 @@ public class WfGraphPanel extends GraphPanel
int minX = midPoint.x - 10;
int minY = midPoint.y - 10;
int maxX = midPoint.x + 10;
- int maxY = midPoint.y + 10;
+ int maxY = midPoint.y + 10;
g2d.drawLine(minX, minY, maxX, minY);
g2d.drawLine(maxX, minY, maxX, maxY);
g2d.drawLine(maxX, maxY, minX, maxY);
diff --git a/source/com/c2kernel/lifecycle/instance/gui/model/WfVertexFactory.java b/source/com/c2kernel/lifecycle/instance/gui/model/WfVertexFactory.java
index d363dc6..0b6c9e4 100644
--- a/source/com/c2kernel/lifecycle/instance/gui/model/WfVertexFactory.java
+++ b/source/com/c2kernel/lifecycle/instance/gui/model/WfVertexFactory.java
@@ -19,6 +19,7 @@ import com.c2kernel.utils.Resource;
public class WfVertexFactory implements VertexFactory, WorkflowDialogue
{
protected CompositeActivity mRootAct = null;
+ @Override
public void create(GraphModelManager graphModelManager, Point location, TypeNameAndConstructionInfo typeNameAndConstructionInfo)
{
String vertexTypeId = null;
@@ -44,12 +45,14 @@ public class WfVertexFactory implements VertexFactory, WorkflowDialogue
mRootAct.newChild(vertexTypeId, location);
}
}
+ @Override
public void setCreationContext(Object newContext)
{
if (newContext != null && newContext instanceof CompositeActivity)
mRootAct = (CompositeActivity) newContext;
}
- public void loadThisWorkflow(String newName, HashMap hashMap)
+ @Override
+ public void loadThisWorkflow(String newName, HashMap<?, ?> hashMap)
{
String vertexTypeId = (String) hashMap.get("P1");
Point location = (Point) hashMap.get("P2");
@@ -69,7 +72,7 @@ public class WfVertexFactory implements VertexFactory, WorkflowDialogue
Resource.getImageResource("graph/newvertex_large.png"),
null,
null);
- if (newName == null || newName.equals(""))
+ if (newName.equals(""))
return;
}
Activity act = null;
@@ -80,7 +83,7 @@ public class WfVertexFactory implements VertexFactory, WorkflowDialogue
}
catch (Exception e)
{
- }
+ }
if (act == null)
mRootAct.newChild(unicName, vertexTypeId, location);
else
diff --git a/source/com/c2kernel/lifecycle/instance/gui/model/WfVertexOutlineCreator.java b/source/com/c2kernel/lifecycle/instance/gui/model/WfVertexOutlineCreator.java
index dd4b8af..e8cb303 100755..100644
--- a/source/com/c2kernel/lifecycle/instance/gui/model/WfVertexOutlineCreator.java
+++ b/source/com/c2kernel/lifecycle/instance/gui/model/WfVertexOutlineCreator.java
@@ -14,7 +14,8 @@ public class WfVertexOutlineCreator implements VertexOutlineCreator,Serializable
private final int mSplitJoinWidth = 60;
private final int mSplitJoinHeight = 25;
- public void setOutline(Vertex vertex)
+ @Override
+ public void setOutline(Vertex vertex)
{
GraphPoint centrePoint = vertex.getCentrePoint();
GraphPoint[] outlinePoints = new GraphPoint[ 4 ];
diff --git a/source/com/c2kernel/lifecycle/instance/gui/view/ActivityRenderer.java b/source/com/c2kernel/lifecycle/instance/gui/view/ActivityRenderer.java
index a67b4fd..046ed7c 100755..100644
--- a/source/com/c2kernel/lifecycle/instance/gui/view/ActivityRenderer.java
+++ b/source/com/c2kernel/lifecycle/instance/gui/view/ActivityRenderer.java
@@ -21,6 +21,7 @@ public class ActivityRenderer implements VertexRenderer
private Paint mInactiveCompPaint = new Color(200, 200, 255);
private Paint mErrorPaint = new Color(255, 50, 0);
private Paint mTextPaint = Color.black;
+ @Override
public void draw(Graphics2D g2d, Vertex vertex)
{
Activity activity = (Activity) vertex;
@@ -28,7 +29,7 @@ public class ActivityRenderer implements VertexRenderer
boolean hasError = !activity.verify();
boolean isComposite = activity.getIsComposite();
GraphPoint centrePoint = activity.getCentrePoint();
- String description = activity.getDescription();
+ //String description = activity.getDescription();
String[] linesOfText = new String[3];
linesOfText[0] = "(" + activity.getType() + ")";
linesOfText[1] = activity.getName();
@@ -52,7 +53,7 @@ public class ActivityRenderer implements VertexRenderer
else
linesOfText[2] = Language.translate(States.getStateName(cs));
}
-
+
FontMetrics metrics = g2d.getFontMetrics();
int lineWidth = 0;
int lineHeight = metrics.getHeight();
@@ -86,7 +87,7 @@ public class ActivityRenderer implements VertexRenderer
g2d.drawString(linesOfText[i], x, y);
}
}
- private Polygon graphPointsToPolygon(GraphPoint[] points)
+ private static Polygon graphPointsToPolygon(GraphPoint[] points)
{
Polygon polygon = new Polygon();
int i = 0;
@@ -96,7 +97,7 @@ public class ActivityRenderer implements VertexRenderer
}
return polygon;
}
- private String getWaitTime(GTimeStamp date)
+ private static String getWaitTime(GTimeStamp date)
{
GTimeStamp now = new GTimeStamp();
DateUtility.setToNow(now);
diff --git a/source/com/c2kernel/lifecycle/instance/gui/view/FindActDefPanel.java b/source/com/c2kernel/lifecycle/instance/gui/view/FindActDefPanel.java
index 5cb00bf..4c1a148 100755..100644
--- a/source/com/c2kernel/lifecycle/instance/gui/view/FindActDefPanel.java
+++ b/source/com/c2kernel/lifecycle/instance/gui/view/FindActDefPanel.java
@@ -33,7 +33,8 @@ public class FindActDefPanel extends SelectedVertexPanel {
add(findButton);
findButton.addActionListener(new ActionListener()
{
- public void actionPerformed(ActionEvent e)
+ @Override
+ public void actionPerformed(ActionEvent e)
{
try {
DomainPath actPath = (DomainPath)new DomainPath("/desc/ActivityDesc/").find(currentAct.getActivityDef());
@@ -47,21 +48,23 @@ public class FindActDefPanel extends SelectedVertexPanel {
*
*/
- public void select(Vertex vert) {
+ @Override
+ public void select(Vertex vert) {
if (vert instanceof ActivitySlotDef) {
findButton.setEnabled(true);
currentAct = (ActivitySlotDef)vert;
}
- else
+ else
clear();
-
+
}
/**
*
*/
- public void clear() {
+ @Override
+ public void clear() {
findButton.setEnabled(false);
currentAct = null;
}
diff --git a/source/com/c2kernel/lifecycle/instance/gui/view/SplitJoinRenderer.java b/source/com/c2kernel/lifecycle/instance/gui/view/SplitJoinRenderer.java
index 4c3f8bf..036f79a 100755..100644
--- a/source/com/c2kernel/lifecycle/instance/gui/view/SplitJoinRenderer.java
+++ b/source/com/c2kernel/lifecycle/instance/gui/view/SplitJoinRenderer.java
@@ -39,7 +39,8 @@ public class SplitJoinRenderer implements VertexRenderer
private int mXXXTextXOffset = 0;
- public void draw( Graphics2D g2d, Vertex vertex)
+ @Override
+ public void draw( Graphics2D g2d, Vertex vertex)
{
GraphPoint centrePoint = vertex.getCentrePoint();
String text = null;
@@ -79,9 +80,9 @@ public class SplitJoinRenderer implements VertexRenderer
textXOffset = mJoinTextXOffset;
}
else if ( vertex instanceof Join)
- {
+ {
String type= (String)((Join)vertex).getProperties().get("Type");
- if (type!=null && type.equals("Route"))
+ if (type!=null && type.equals("Route"))
{
text = mRouteText;
textXOffset = mRouteTextXOffset;
@@ -116,7 +117,7 @@ public class SplitJoinRenderer implements VertexRenderer
vertexHeight
);
g2d.drawString( text, centrePoint.x - textXOffset, centrePoint.y + mTextYOffset );
-
+
if (!hasErrors) {
g2d.setPaint( mErrorPaint );
String errors = Language.translate(((WfVertex)vertex).getErrors());
diff --git a/source/com/c2kernel/lifecycle/instance/gui/view/TransitionPanel.java b/source/com/c2kernel/lifecycle/instance/gui/view/TransitionPanel.java
index d33b717..32b234e 100644
--- a/source/com/c2kernel/lifecycle/instance/gui/view/TransitionPanel.java
+++ b/source/com/c2kernel/lifecycle/instance/gui/view/TransitionPanel.java
@@ -39,12 +39,12 @@ public class TransitionPanel extends SelectedVertexPanel implements ActionListen
protected GridBagLayout gridbag;
protected GridBagConstraints c;
protected Box transBox;
- protected JComboBox executors;
+ protected JComboBox<?> executors;
protected JComboBox<String> states = new JComboBox<String>(States.states);
protected JCheckBox active = new JCheckBox();
protected JLabel status = new JLabel();
protected ItemProxy mItem;
-
+
public TransitionPanel() {
super();
gridbag = new GridBagLayout();
@@ -53,37 +53,37 @@ public class TransitionPanel extends SelectedVertexPanel implements ActionListen
c.gridx=0; c.gridy=0;
c.weightx=1; c.weighty=0;
c.fill=GridBagConstraints.HORIZONTAL;
-
+
JLabel title = new JLabel("Available Transitions");
title.setFont(EntityTabPane.titleFont);
gridbag.setConstraints(title, c);
add(title);
-
- c.gridy++;
+
+ c.gridy++;
gridbag.setConstraints(status, c);
add(status);
c.gridy++;
-
+
transBox = Box.createHorizontalBox();
gridbag.setConstraints(transBox, c);
add(transBox);
-
+
c.weightx=0; c.gridx++;
executors = MainFrame.getExecutionPlugins();
if (executors.getItemCount() > 1) {
gridbag.setConstraints(executors, c);
add(executors);
}
-
-
+
+
if (MainFrame.isAdmin) {
c.gridx=0; c.gridy++;
title = new JLabel("State Hacking");
title.setFont(EntityTabPane.titleFont);
gridbag.setConstraints(title, c);
add(title);
- Box hackBox = Box.createHorizontalBox();
+ Box hackBox = Box.createHorizontalBox();
hackBox.add(states);
hackBox.add(Box.createHorizontalGlue());
hackBox.add(new JLabel("Active:"));
@@ -94,14 +94,15 @@ public class TransitionPanel extends SelectedVertexPanel implements ActionListen
states.addActionListener(this);
active.addActionListener(this);
}
-
+
clear();
-
+
}
/**
*
*/
- public void select(Vertex vert) {
+ @Override
+ public void select(Vertex vert) {
clear();
if (!(vert instanceof Activity)) return;
mCurrentAct = (Activity)vert;
@@ -129,8 +130,9 @@ public class TransitionPanel extends SelectedVertexPanel implements ActionListen
}
revalidate();
}
-
- public void actionPerformed(ActionEvent e) {
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
if (e.getSource() == active && mCurrentAct != null) {
mCurrentAct.active = active.isSelected();
return;
@@ -142,14 +144,14 @@ public class TransitionPanel extends SelectedVertexPanel implements ActionListen
if (!e.getActionCommand().startsWith("Trans:")) return;
int transition = Integer.parseInt(e.getActionCommand().substring(6));
Logger.msg("Requesting transition "+transition);
- Job thisJob = new Job(mItem.getSystemKey(),
- mCurrentAct.getPath(),
+ Job thisJob = new Job(mItem.getSystemKey(),
+ mCurrentAct.getPath(),
transition,
new StateMachine(mCurrentAct).simulate(transition),
mCurrentAct.getCurrentState(),
mCurrentAct.getName(),
mCurrentAct.getProperties(),
- mCurrentAct.getType(),
+ mCurrentAct.getType(),
MainFrame.userAgent.getName());
try {
Executor selectedExecutor = (Executor)executors.getSelectedItem();
@@ -160,10 +162,11 @@ public class TransitionPanel extends SelectedVertexPanel implements ActionListen
Logger.error(ex);
JOptionPane.showMessageDialog(null, ex.getMessage(), className, JOptionPane.ERROR_MESSAGE);
}
-
+
}
- public void clear() {
+ @Override
+ public void clear() {
mCurrentAct = null;
transBox.removeAll();
status.setText("No activity selected");
@@ -173,8 +176,8 @@ public class TransitionPanel extends SelectedVertexPanel implements ActionListen
active.setEnabled(false);
revalidate();
}
-
-
+
+
/**
* @param item The mItem to set.
*/
diff --git a/source/com/c2kernel/lifecycle/instance/gui/view/WfDirectedEdgeRenderer.java b/source/com/c2kernel/lifecycle/instance/gui/view/WfDirectedEdgeRenderer.java
index 09dba77..f39d9a6 100755..100644
--- a/source/com/c2kernel/lifecycle/instance/gui/view/WfDirectedEdgeRenderer.java
+++ b/source/com/c2kernel/lifecycle/instance/gui/view/WfDirectedEdgeRenderer.java
@@ -4,6 +4,7 @@ import java.awt.Graphics2D;
import java.awt.Shape;
import java.awt.geom.AffineTransform;
import java.awt.geom.GeneralPath;
+
import com.c2kernel.graph.model.DirectedEdge;
import com.c2kernel.graph.model.GraphPoint;
import com.c2kernel.graph.view.DirectedEdgeRenderer;
@@ -17,6 +18,7 @@ public class WfDirectedEdgeRenderer implements DirectedEdgeRenderer
mArrowTemplate.lineTo(0, 0);
mArrowTemplate.lineTo(5, 5);
}
+ @Override
public void draw(Graphics2D g2d, DirectedEdge directedEdge)
{
GraphPoint originPoint = directedEdge.getOriginPoint();
@@ -87,7 +89,7 @@ public class WfDirectedEdgeRenderer implements DirectedEdgeRenderer
if (text != null)
g2d.drawString(text, midPoint.x + 10, midPoint.y);
}
- private double calcArrowAngle(int originX, int originY, int terminusX, int terminusY)
+ private static double calcArrowAngle(int originX, int originY, int terminusX, int terminusY)
{
double width = terminusX - originX;
double height = terminusY - originY;
diff --git a/source/com/c2kernel/lifecycle/instance/gui/view/WfVertexRenderer.java b/source/com/c2kernel/lifecycle/instance/gui/view/WfVertexRenderer.java
index 1e731e0..92a1021 100755..100644
--- a/source/com/c2kernel/lifecycle/instance/gui/view/WfVertexRenderer.java
+++ b/source/com/c2kernel/lifecycle/instance/gui/view/WfVertexRenderer.java
@@ -13,7 +13,8 @@ public class WfVertexRenderer implements VertexRenderer
protected ActivityRenderer mActivityRenderer = new ActivityRenderer();
protected SplitJoinRenderer mSplitJoinRenderer = new SplitJoinRenderer();
- public void draw( Graphics2D g2d, Vertex vertex)
+ @Override
+ public void draw( Graphics2D g2d, Vertex vertex)
{
if ( vertex instanceof Activity ) { mActivityRenderer.draw( g2d, vertex); }
else if ( ( vertex instanceof Split ) || ( vertex instanceof Join ) ) { mSplitJoinRenderer.draw( g2d, vertex ); }
diff --git a/source/com/c2kernel/lifecycle/instance/predefined/AddC2KObject.java b/source/com/c2kernel/lifecycle/instance/predefined/AddC2KObject.java
index 27759be..b61187c 100755..100644
--- a/source/com/c2kernel/lifecycle/instance/predefined/AddC2KObject.java
+++ b/source/com/c2kernel/lifecycle/instance/predefined/AddC2KObject.java
@@ -37,7 +37,8 @@ public class AddC2KObject extends PredefinedStep
}
//requestdata is xmlstring
- public void request( AgentPath agent, int transitionID, String requestData)
+ @Override
+ public void request( AgentPath agent, int transitionID, String requestData)
throws AccessRightsException,
InvalidTransitionException,
InvalidDataException
@@ -54,7 +55,7 @@ public class AddC2KObject extends PredefinedStep
{
Logger.msg(5, "AddC2KObject::request() - data:" + getDataList(requestData)[0]);
-
+
C2KLocalObject obj = (C2KLocalObject)CastorXMLUtility.unmarshall(getDataList(requestData)[0]);
Gateway.getStorage().put(entityPath.getSysKey(), obj, null );
sendEventStoreOutcome(transitionID, requestData, agent);
diff --git a/source/com/c2kernel/lifecycle/instance/predefined/AddDomainPath.java b/source/com/c2kernel/lifecycle/instance/predefined/AddDomainPath.java
index 6756895..2cf619e 100755..100644
--- a/source/com/c2kernel/lifecycle/instance/predefined/AddDomainPath.java
+++ b/source/com/c2kernel/lifecycle/instance/predefined/AddDomainPath.java
@@ -29,7 +29,8 @@ public class AddDomainPath extends PredefinedStep
}
//requestdata is xmlstring
- public void request( AgentPath agent, int transitionID, String requestData)
+ @Override
+ public void request( AgentPath agent, int transitionID, String requestData)
throws AccessRightsException,
InvalidTransitionException,
InvalidDataException
diff --git a/source/com/c2kernel/lifecycle/instance/predefined/AddStepsFromDescription.java b/source/com/c2kernel/lifecycle/instance/predefined/AddStepsFromDescription.java
index c4fab0c..f70c053 100755..100644
--- a/source/com/c2kernel/lifecycle/instance/predefined/AddStepsFromDescription.java
+++ b/source/com/c2kernel/lifecycle/instance/predefined/AddStepsFromDescription.java
@@ -21,6 +21,7 @@ public class AddStepsFromDescription extends PredefinedStep
super();
}
+ @Override
public void request( AgentPath agent, int transitionID, String requestData)
throws AccessRightsException, InvalidTransitionException, InvalidDataException
{
diff --git a/source/com/c2kernel/lifecycle/instance/predefined/AssignItemToSlot.java b/source/com/c2kernel/lifecycle/instance/predefined/AssignItemToSlot.java
index 88f89c3..40fe740 100755..100644
--- a/source/com/c2kernel/lifecycle/instance/predefined/AssignItemToSlot.java
+++ b/source/com/c2kernel/lifecycle/instance/predefined/AssignItemToSlot.java
@@ -11,7 +11,6 @@
package com.c2kernel.lifecycle.instance.predefined;
-import java.util.Iterator;
import com.c2kernel.collection.Collection;
import com.c2kernel.collection.CollectionMember;
@@ -41,14 +40,15 @@ public class AssignItemToSlot extends PredefinedStep
super();
}
-
+
/**
* Params:
* 0 - collection name
* 1 - slot number
* 2 - target entity key
*/
- public void request(AgentPath agent, int transitionID, String requestData)
+ @Override
+ public void request(AgentPath agent, int transitionID, String requestData)
throws AccessRightsException,
InvalidTransitionException,
InvalidDataException
@@ -57,35 +57,35 @@ public class AssignItemToSlot extends PredefinedStep
String collName;
int slotNo;
int entityKey;
- Collection coll;
+ Collection<?> coll;
Logger.msg(1, "AssignItemToSlot::request() - Starting.");
checkAccessRights(agent);
-
+
// extract parameters
try {
entityPath = getItemEntityPath();
String[] params = getDataList(requestData);
collName = params[0];
slotNo = Integer.parseInt(params[1]);
- entityKey = Integer.parseInt(params[2]);
+ entityKey = Integer.parseInt(params[2]);
} catch (Exception e) {
throw new InvalidDataException("Invalid parameters", "");
}
-
+
// load collection
try {
- coll = (Collection)Gateway.getStorage().get(entityPath.getSysKey(), ClusterStorage.COLLECTION+"/"+collName, null);
+ coll = (Collection<?>)Gateway.getStorage().get(entityPath.getSysKey(), ClusterStorage.COLLECTION+"/"+collName, null);
} catch (Exception e) {
Logger.error(e);
throw new InvalidDataException("Error loading collection "+collName, "");
}
-
+
// find member and assign entity
boolean stored = false;
- for (Iterator iter = coll.getMembers().list.iterator(); iter.hasNext();) {
- CollectionMember member = (CollectionMember)iter.next();
+ for (Object name : coll.getMembers().list) {
+ CollectionMember member = (CollectionMember)name;
if (member.getID() == slotNo) {
if (member.getEntityKey() > -1)
throw new InvalidDataException("Member slot not empty", "");
@@ -101,8 +101,8 @@ public class AssignItemToSlot extends PredefinedStep
if (!stored) {
throw new InvalidDataException("Member slot "+slotNo+" not found.", "");
}
-
-
+
+
try {
Gateway.getStorage().put(entityPath.getSysKey(), coll, null);
} catch (ClusterStorageException e) {
diff --git a/source/com/c2kernel/lifecycle/instance/predefined/CreateItemFromDescription.java b/source/com/c2kernel/lifecycle/instance/predefined/CreateItemFromDescription.java
index 7bedc81..ad92052 100644
--- a/source/com/c2kernel/lifecycle/instance/predefined/CreateItemFromDescription.java
+++ b/source/com/c2kernel/lifecycle/instance/predefined/CreateItemFromDescription.java
@@ -55,6 +55,7 @@ public class CreateItemFromDescription extends PredefinedStep
}
//requestdata is xmlstring
+ @Override
public void request(AgentPath agent, int transitionID, String requestData)
throws AccessRightsException, InvalidTransitionException, InvalidDataException,ObjectAlreadyExistsException
{
@@ -65,66 +66,66 @@ public class CreateItemFromDescription extends PredefinedStep
String wfDefName = null;
if (input.length > 2) // override wf
wfDefName = input[2];
-
+
PropertyArrayList props = new PropertyArrayList();
Logger.msg(1, "AddNewItem::request() - Starting.");
TransactionManager storage = Gateway.getStorage();
LDAPLookup lookup = Gateway.getLDAPLookup();
EntityPath myPath = getItemEntityPath();
checkAccessRights(agent);
-
+
try {
- // check if the path is already taken
+ // check if the path is already taken
DomainPath context = new DomainPath(new DomainPath(domPath), newName);
Logger.debug(8,"context "+context.getSysKey()+" "+context.getPath()+" "+context.getString());
- if (context.getSysKey()!=-1)
- throw new ObjectAlreadyExistsException("The item name " +newName+ " exists already.");
-
+ if (context.getSysKey()!=-1)
+ throw new ObjectAlreadyExistsException("The item name " +newName+ " exists already.");
+
// get init objects
String[] collNames = storage.getClusterContents(myPath.getSysKey(), ClusterStorage.COLLECTION);
ArrayList<String> collections = new ArrayList<String>();
-
-
+
+
// loop through collections to instantiate
- for (int i = 0; i < collNames.length; i++) {
- Collection thisCol = (Collection)storage.get(myPath.getSysKey(), ClusterStorage.COLLECTION+"/"+collNames[i], null);
+ for (String collName : collNames) {
+ Collection<?> thisCol = (Collection<?>)storage.get(myPath.getSysKey(), ClusterStorage.COLLECTION+"/"+collName, null);
if (thisCol instanceof CollectionDescription) {
- CollectionDescription thisDesc = (CollectionDescription)thisCol;
- collections.add(CastorXMLUtility.marshall(thisDesc.newInstance()));
+ CollectionDescription<?> thisDesc = (CollectionDescription<?>)thisCol;
+ collections.add(CastorXMLUtility.marshall(thisDesc.newInstance()));
}
else if (thisCol.getName().equals("Workflow") && wfDefName == null) {
- ArrayList members = thisCol.getMembers().list;
+ ArrayList<?> members = thisCol.getMembers().list;
// get the first member from the wf collection
CollectionMember wfMember = (CollectionMember)members.get(0);
wfDefName = wfMember.resolveEntity().getName();
}
}
-
+
// load workflow def
if (wfDefName == null)
throw new InvalidDataException("No workflow given or defined", "");
-
+
try {
wfDef = (CompositeActivityDef)LocalObjectLoader.getActDef(wfDefName, "last");
} catch (ObjectNotFoundException ex) {
- throw new InvalidDataException("Workflow def '"+wfDefName+"' item not found", "");
+ throw new InvalidDataException("Workflow def '"+wfDefName+"' item not found", "");
} catch (ClassCastException ex) {
throw new InvalidDataException("Activity def '"+wfDefName+"' was not Composite", "");
}
-
-
+
+
// copy properties -- intend to create from propdesc
PropertyDescriptionList pdList = PropertyUtility.getPropertyDescriptionOutcome(myPath.getSysKey());
for (int i = 0; i < pdList.list.size(); i++) {
- PropertyDescription pd = (PropertyDescription) pdList.list.get(i);
+ PropertyDescription pd = pdList.list.get(i);
String propName = pd.getName();
- String propVal = pd.getDefaultValue();
+ String propVal = pd.getDefaultValue();
if (propName.equals("Name"))
propVal = newName;
- props.list.add( new Property(propName, propVal));
+ props.list.add( new Property(propName, propVal));
}
props.list.add( new Property("Creator", agent.getAgentName()));
-
+
/* ITEM CREATION */
// generate new entity key
@@ -132,8 +133,8 @@ public class CreateItemFromDescription extends PredefinedStep
EntityPath entityPath = lookup.getNextKeyManager().generateNextEntityKey();
// resolve the item factory
- Logger.msg(6, "CreateItemFromDescription - Resolving item factory");
-
+ Logger.msg(6, "CreateItemFromDescription - Resolving item factory");
+
// create the Item object
Logger.msg(3, "CreateItemFromDescription - Creating Item");
CorbaServer factory = Gateway.getCorbaServer();
@@ -141,26 +142,26 @@ public class CreateItemFromDescription extends PredefinedStep
TraceableEntity newItem = (TraceableEntity)factory.createEntity(entityPath);
Gateway.getLDAPLookup().add(entityPath);
-
+
// initialise it with its properties and workflow
-
+
Logger.msg(3, "CreateItemFromDescription - Initializing Item");
-
+
newItem.initialise(
agent.getSysKey(),
CastorXMLUtility.marshall(props),
CastorXMLUtility.marshall(wfDef.instantiate()));
-
+
// add collections
if (collections.size() > 0) {
Logger.msg(6, "CreateItemFromDescription - Adding Collections");
String[] colls = new String[1];
- for (Iterator iter = collections.iterator(); iter.hasNext();) {
- colls[0] = (String)iter.next();
- newItem.requestAction(agent.getSysKey(), "workflow/predefined/AddC2KObject", Transitions.COMPLETE, PredefinedStep.bundleData(colls));
+ for (Iterator<String> iter = collections.iterator(); iter.hasNext();) {
+ colls[0] = iter.next();
+ newItem.requestAction(agent.getSysKey(), "workflow/predefined/AddC2KObject", Transitions.COMPLETE, PredefinedStep.bundleData(colls));
}
- }
-
+ }
+
// add its domain path
Logger.msg(3, "CreateItemFromDescription - Creating "+context);
context.setEntity(entityPath);
diff --git a/source/com/c2kernel/lifecycle/instance/predefined/Erase.java b/source/com/c2kernel/lifecycle/instance/predefined/Erase.java
index 5c04f93..07d76b1 100755..100644
--- a/source/com/c2kernel/lifecycle/instance/predefined/Erase.java
+++ b/source/com/c2kernel/lifecycle/instance/predefined/Erase.java
@@ -40,7 +40,8 @@ public class Erase extends PredefinedStep
}
//requestdata is xmlstring
- public void request(AgentPath agent, int transitionID, String requestData)
+ @Override
+ public void request(AgentPath agent, int transitionID, String requestData)
throws AccessRightsException,
InvalidTransitionException,
InvalidDataException
@@ -51,22 +52,22 @@ public class Erase extends PredefinedStep
try
{
EntityPath entityPath = getItemEntityPath();
-
+
// find entity name
Property name = (Property)Gateway.getStorage().get(entityPath.getSysKey(), ClusterStorage.PROPERTY+"/Name", null);
-
+
// get all domain paths
- Enumeration domPaths = Gateway.getLDAPLookup().search(new DomainPath(), name.getValue());
+ Enumeration<?> domPaths = Gateway.getLDAPLookup().search(new DomainPath(), name.getValue());
while (domPaths.hasMoreElements()) {
DomainPath path = (DomainPath)domPaths.nextElement();
// delete them
if (path.getSysKey() == entityPath.getSysKey())
Gateway.getLDAPLookup().delete(path);
}
-
+
//clear out all storages
Gateway.getStorage().removeCluster(entityPath.getSysKey(), "", null);
-
+
//remove domain path
Gateway.getLDAPLookup().delete(entityPath);
}
diff --git a/source/com/c2kernel/lifecycle/instance/predefined/Import.java b/source/com/c2kernel/lifecycle/instance/predefined/Import.java
index 36b7fc9..2f99937 100755..100644
--- a/source/com/c2kernel/lifecycle/instance/predefined/Import.java
+++ b/source/com/c2kernel/lifecycle/instance/predefined/Import.java
@@ -7,7 +7,9 @@
package com.c2kernel.lifecycle.instance.predefined;
-import com.c2kernel.common.*;
+import com.c2kernel.common.AccessRightsException;
+import com.c2kernel.common.InvalidDataException;
+import com.c2kernel.common.InvalidTransitionException;
import com.c2kernel.lookup.AgentPath;
import com.c2kernel.utils.Logger;
@@ -15,7 +17,7 @@ import com.c2kernel.utils.Logger;
*
* $Revision: 1.21 $
* $Date: 2005/06/02 12:17:22 $
- *
+ *
* Params: Schemaname_version:Viewpoint (optional), Outcome
*
* Copyright (C) 2003 CERN - European Organization for Nuclear Research
@@ -29,7 +31,8 @@ public class Import extends PredefinedStep
}
//requestdata is xmlstring
- public void request( AgentPath agent, int transitionID, String requestData)
+ @Override
+ public void request( AgentPath agent, int transitionID, String requestData)
throws AccessRightsException,
InvalidTransitionException,
InvalidDataException
@@ -41,11 +44,11 @@ public class Import extends PredefinedStep
checkAccessRights(agent);
String[] params = getDataList(requestData);
-
-
+
+
int split1 = params[0].indexOf('_');
int split2 = params[0].indexOf(':');
-
+
String schemaName = params[0].substring(0, split1);
String viewpoint = "last";
int schemaVersion;
@@ -55,14 +58,14 @@ public class Import extends PredefinedStep
}
else
schemaVersion = Integer.parseInt(params[0].substring(split1+1));
-
+
// set type & ver
getProperties().put("SchemaType", schemaName);
getProperties().put("SchemaVersion", String.valueOf(schemaVersion));
getProperties().put("Viewpoint", viewpoint);
-
+
requestData = params[1];
-
+
sendEventStoreOutcome(transitionID, requestData, agent);
}
}
diff --git a/source/com/c2kernel/lifecycle/instance/predefined/PredefinedStep.java b/source/com/c2kernel/lifecycle/instance/predefined/PredefinedStep.java
index 8d95438..8aec993 100755..100644
--- a/source/com/c2kernel/lifecycle/instance/predefined/PredefinedStep.java
+++ b/source/com/c2kernel/lifecycle/instance/predefined/PredefinedStep.java
@@ -1,8 +1,10 @@
package com.c2kernel.lifecycle.instance.predefined;
import java.io.StringReader;
import java.io.StringWriter;
+
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
+
import org.apache.xml.serialize.Method;
import org.apache.xml.serialize.OutputFormat;
import org.apache.xml.serialize.XMLSerializer;
@@ -13,6 +15,7 @@ import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.w3c.dom.Text;
import org.xml.sax.InputSource;
+
import com.c2kernel.lifecycle.instance.Activity;
import com.c2kernel.utils.Logger;
/***********************************************************************************************************************************************************************************************************************************************************************************************************
@@ -25,6 +28,7 @@ public class PredefinedStep extends Activity
* predefined Steps are always Active, and have only one transition subclasses could override this method (if necessary)
******************************************************************************************************************************************************************************************************************************************************************************************************/
private boolean isPredefined = false;
+ @Override
public boolean getActive()
{
if (isPredefined)
@@ -32,6 +36,7 @@ public class PredefinedStep extends Activity
else
return super.getActive();
}
+ @Override
public String getTransitions()
{
if (isPredefined)
@@ -39,6 +44,7 @@ public class PredefinedStep extends Activity
else
return super.getTransitions();
}
+ @Override
public String getErrors()
{
if (isPredefined)
@@ -46,6 +52,7 @@ public class PredefinedStep extends Activity
else
return super.getErrors();
}
+ @Override
public boolean verify()
{
if (isPredefined)
@@ -55,7 +62,7 @@ public class PredefinedStep extends Activity
}
/**
* Returns the isPredefined.
- *
+ *
* @return boolean
*/
public boolean getIsPredefined()
@@ -64,7 +71,7 @@ public class PredefinedStep extends Activity
}
/**
* Sets the isPredefined.
- *
+ *
* @param isPredefined
* The isPredefined to set
*/
@@ -72,6 +79,7 @@ public class PredefinedStep extends Activity
{
this.isPredefined = isPredefined;
}
+ @Override
public String getType()
{
return getName();
@@ -86,10 +94,9 @@ public class PredefinedStep extends Activity
Document dom = builder.newDocument();
Element root = dom.createElement("PredefinedStepOutcome");
dom.appendChild(root);
- for (int i = 0; i < data.length; i++)
- {
+ for (String element : data) {
Element param = dom.createElement("param");
- Text t = dom.createTextNode(data[i]);
+ Text t = dom.createTextNode(element);
param.appendChild(t);
root.appendChild(param);
}
@@ -104,15 +111,15 @@ public class PredefinedStep extends Activity
StringWriter stringOut = new StringWriter();
XMLSerializer serial = new XMLSerializer(stringOut, format);
serial.asDOMSerializer();
- serial.serialize(dom);
+ serial.serialize(dom);
return stringOut.toString();
}
catch (Exception e)
{
Logger.error(e);
StringBuffer xmlData = new StringBuffer().append("<PredefinedStepOutcome>");
- for (int i = 0; i < data.length; i++)
- xmlData.append("<param><![CDATA[").append(data[i]).append("]]></param>");
+ for (String element : data)
+ xmlData.append("<param><![CDATA[").append(element).append("]]></param>");
xmlData.append("</PredefinedStepOutcome>");
return xmlData.toString();
}
@@ -130,7 +137,7 @@ public class PredefinedStep extends Activity
NodeList nodeList = scriptDoc.getElementsByTagName("param");
String[] result = new String[nodeList.getLength()];
for (int i = 0; i < nodeList.getLength(); i++)
- {
+ {
Node n = nodeList.item(i).getFirstChild();
if (n instanceof CDATASection)
result[i] = ((CDATASection) n).getData();
diff --git a/source/com/c2kernel/lifecycle/instance/predefined/PredefinedStepContainer.java b/source/com/c2kernel/lifecycle/instance/predefined/PredefinedStepContainer.java
index 10a9d12..d065afb 100755..100644
--- a/source/com/c2kernel/lifecycle/instance/predefined/PredefinedStepContainer.java
+++ b/source/com/c2kernel/lifecycle/instance/predefined/PredefinedStepContainer.java
@@ -4,12 +4,12 @@ import com.c2kernel.lifecycle.instance.CompositeActivity;
public class PredefinedStepContainer extends CompositeActivity
{
protected int num = 0;
-
+
public PredefinedStepContainer()
{
super();
setName("predefined");
- getProperties().put("Description", "Contains all predefined Steps");
+ getProperties().put("Description", "Contains all predefined Steps");
createChildren();
}
public void createChildren()
@@ -26,7 +26,7 @@ public class PredefinedStepContainer extends CompositeActivity
predInit("Erase", "Deletes all objects and domain paths for this item.", new Erase());
predInit("Import", "Imports an outcome into the Item, with a given schema and viewpoint", new Import());
}
-
+
public void predInit(String alias, String Description, PredefinedStep act)
{
act.setName(alias);
@@ -38,18 +38,22 @@ public class PredefinedStepContainer extends CompositeActivity
act.setIsPredefined(true);
addChild(act, new GraphPoint(100, 75 * ++num));
}
+ @Override
public boolean verify()
{
return true;
}
+ @Override
public String getErrors()
{
return "predefined";
}
+ @Override
public boolean getActive()
{
return true;
}
+ @Override
public String getTransitions()
{
return "<PossibleTransitions></PossibleTransitions>";
diff --git a/source/com/c2kernel/lifecycle/instance/predefined/RemoveC2KObject.java b/source/com/c2kernel/lifecycle/instance/predefined/RemoveC2KObject.java
index 8004488..c9513a8 100755..100644
--- a/source/com/c2kernel/lifecycle/instance/predefined/RemoveC2KObject.java
+++ b/source/com/c2kernel/lifecycle/instance/predefined/RemoveC2KObject.java
@@ -35,7 +35,8 @@ public class RemoveC2KObject extends PredefinedStep
}
//requestdata is xmlstring
- public void request(AgentPath agent, int transitionID, String requestData)
+ @Override
+ public void request(AgentPath agent, int transitionID, String requestData)
throws AccessRightsException,
InvalidTransitionException,
InvalidDataException
@@ -51,7 +52,7 @@ public class RemoveC2KObject extends PredefinedStep
Logger.msg(5, "RemoveC2KObject::request() - path:"+path);
- Gateway.getStorage().remove( entityPath.getSysKey(), path, null );
+ Gateway.getStorage().remove( entityPath.getSysKey(), path, null );
sendEventStoreOutcome(transitionID, requestData, agent);
}
catch( Exception ex )
diff --git a/source/com/c2kernel/lifecycle/instance/predefined/RemoveDomainPath.java b/source/com/c2kernel/lifecycle/instance/predefined/RemoveDomainPath.java
index af118e5..19ff7c6 100755..100644
--- a/source/com/c2kernel/lifecycle/instance/predefined/RemoveDomainPath.java
+++ b/source/com/c2kernel/lifecycle/instance/predefined/RemoveDomainPath.java
@@ -27,7 +27,8 @@ public class RemoveDomainPath extends PredefinedStep
}
//requestdata is xmlstring
- public void request( AgentPath agent, int transitionID, String requestData)
+ @Override
+ public void request( AgentPath agent, int transitionID, String requestData)
throws AccessRightsException,
InvalidTransitionException,
InvalidDataException
diff --git a/source/com/c2kernel/lifecycle/instance/predefined/ReplaceDomainWorkflow.java b/source/com/c2kernel/lifecycle/instance/predefined/ReplaceDomainWorkflow.java
index e8c6a6f..ba3e6c6 100755..100644
--- a/source/com/c2kernel/lifecycle/instance/predefined/ReplaceDomainWorkflow.java
+++ b/source/com/c2kernel/lifecycle/instance/predefined/ReplaceDomainWorkflow.java
@@ -20,6 +20,7 @@ public class ReplaceDomainWorkflow extends PredefinedStep
super();
}
+ @Override
public void request( AgentPath agent, int transitionID, String requestData)
throws AccessRightsException, InvalidTransitionException, InvalidDataException
{
diff --git a/source/com/c2kernel/lifecycle/instance/predefined/ServerPredefinedStepContainer.java b/source/com/c2kernel/lifecycle/instance/predefined/ServerPredefinedStepContainer.java
index 363d1fc..21eacda 100755..100644
--- a/source/com/c2kernel/lifecycle/instance/predefined/ServerPredefinedStepContainer.java
+++ b/source/com/c2kernel/lifecycle/instance/predefined/ServerPredefinedStepContainer.java
@@ -17,13 +17,14 @@ import com.c2kernel.lifecycle.instance.predefined.entitycreation.CreateNewItem;
public class ServerPredefinedStepContainer extends PredefinedStepContainer {
- public void createChildren()
+ @Override
+ public void createChildren()
{
super.createChildren();
serverPredInit("CreateNewItem", "Creates a new Item in this Server without description.", new CreateNewItem(), "NewItem");
serverPredInit("CreateNewAgent", "Creates a new Item in this Server without description.", new CreateNewAgent(), "NewAgent");
}
-
+
public void serverPredInit(String alias, String Description, PredefinedStep act, String schema)
{
act.setName(alias);
diff --git a/source/com/c2kernel/lifecycle/instance/predefined/WriteProperty.java b/source/com/c2kernel/lifecycle/instance/predefined/WriteProperty.java
index da526a2..77a0b43 100755..100644
--- a/source/com/c2kernel/lifecycle/instance/predefined/WriteProperty.java
+++ b/source/com/c2kernel/lifecycle/instance/predefined/WriteProperty.java
@@ -36,7 +36,8 @@ public class WriteProperty extends PredefinedStep
}
//requestdata is xmlstring
- public void request( AgentPath agent, int transitionID, String requestData)
+ @Override
+ public void request( AgentPath agent, int transitionID, String requestData)
throws AccessRightsException,
InvalidTransitionException,
InvalidDataException
@@ -56,7 +57,7 @@ public class WriteProperty extends PredefinedStep
{
Logger.msg(5, "WriteProperty::request() - name:" + params[0] +" val:"+params[1]);
-
+
Property newProp = new Property(params[0], params[1]);
Gateway.getStorage().put(entityPath.getSysKey(), newProp, null );
sendEventStoreOutcome(transitionID, requestData, agent);
diff --git a/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/Aggregation.java b/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/Aggregation.java
index 3677220..073d662 100644
--- a/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/Aggregation.java
+++ b/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/Aggregation.java
@@ -5,20 +5,20 @@ import java.util.ArrayList;
public class Aggregation implements java.io.Serializable {
public boolean isDescription;
- public ArrayList aggregationMemberList;
+ public ArrayList<?> aggregationMemberList;
public String name;
public Aggregation() {
super();
- aggregationMemberList = new ArrayList();
- }
-
+ aggregationMemberList = new ArrayList<Object>();
+ }
+
public Aggregation(String name, boolean isDescription) {
this();
this.name = name;
this.isDescription = isDescription;
}
-
+
public com.c2kernel.collection.Aggregation create() {
return new com.c2kernel.collection.AggregationInstance();
}
diff --git a/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/AggregationMember.java b/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/AggregationMember.java
index 87baa1d..29d3cf9 100755..100644
--- a/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/AggregationMember.java
+++ b/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/AggregationMember.java
@@ -11,7 +11,7 @@ public class AggregationMember implements java.io.Serializable {
public AggregationMember() {
super();
}
-
+
public AggregationMember(int slotNo, String itemDescPath, String itemPath, Geometry geometry) {
this.slotNo = slotNo;
this.itemDescriptionPath = itemDescPath;
diff --git a/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/CreateNewAgent.java b/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/CreateNewAgent.java
index b0eaaec..96371dd 100755..100644
--- a/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/CreateNewAgent.java
+++ b/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/CreateNewAgent.java
@@ -26,7 +26,8 @@ public class CreateNewAgent extends PredefinedStep
}
//requestdata is xmlstring
- public void request( AgentPath agent, int transitionID, String requestData)
+ @Override
+ public void request( AgentPath agent, int transitionID, String requestData)
throws AccessRightsException,
InvalidTransitionException,
InvalidDataException
diff --git a/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/CreateNewItem.java b/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/CreateNewItem.java
index 49f8ada..a66b062 100755..100644
--- a/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/CreateNewItem.java
+++ b/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/CreateNewItem.java
@@ -26,7 +26,8 @@ public class CreateNewItem extends PredefinedStep
}
//requestdata is xmlstring
- public void request( AgentPath agent, int transitionID, String requestData)
+ @Override
+ public void request( AgentPath agent, int transitionID, String requestData)
throws AccessRightsException,
InvalidTransitionException,
InvalidDataException
diff --git a/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/Dependency.java b/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/Dependency.java
index 0896534..311c108 100755..100644
--- a/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/Dependency.java
+++ b/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/Dependency.java
@@ -1,7 +1,6 @@
package com.c2kernel.lifecycle.instance.predefined.entitycreation;
import java.util.ArrayList;
-import java.util.Iterator;
import com.c2kernel.collection.MembershipException;
import com.c2kernel.lookup.DomainPath;
@@ -12,13 +11,13 @@ public class Dependency implements java.io.Serializable {
public String name;
public boolean isDescription;
public String itemDescriptionPath;
- public ArrayList dependencyMemberList;
+ public ArrayList<?> dependencyMemberList;
public Dependency() {
super();
- dependencyMemberList = new ArrayList();
- }
-
+ dependencyMemberList = new ArrayList<Object>();
+ }
+
public Dependency(String itemDesc) {
this();
this.itemDescriptionPath = itemDesc;
@@ -33,8 +32,8 @@ public class Dependency implements java.io.Serializable {
PropertyUtility.getPropertyDescriptionOutcome(new DomainPath(itemDescriptionPath).getSysKey());
//TODO: set props and class identifiers
}
- for (Iterator mems = dependencyMemberList.iterator(); mems.hasNext();) {
- DependencyMember thisMem = (DependencyMember) mems.next();
+ for (Object name2 : dependencyMemberList) {
+ DependencyMember thisMem = (DependencyMember) name2;
int syskey = new DomainPath(thisMem.itemPath).getSysKey();
if (syskey == -1)
throw new MembershipException("Cannot find "+thisMem.itemPath+" specified for collection.");
diff --git a/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/DependencyMember.java b/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/DependencyMember.java
index 00ac445..b70619f 100755..100644
--- a/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/DependencyMember.java
+++ b/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/DependencyMember.java
@@ -9,10 +9,10 @@ public class DependencyMember implements java.io.Serializable {
public DependencyMember() {
super();
}
-
+
public DependencyMember(String itemPath) {
this.itemPath = itemPath;
-
+
}
}
diff --git a/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/Geometry.java b/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/Geometry.java
index 25a1455..f18b6d4 100755..100644
--- a/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/Geometry.java
+++ b/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/Geometry.java
@@ -25,5 +25,5 @@ public class Geometry implements java.io.Serializable {
this.width = width;
this.height = height;
}
-
+
}
diff --git a/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/NewAgent.java b/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/NewAgent.java
index fa575a3..30b80c4 100755..100644
--- a/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/NewAgent.java
+++ b/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/NewAgent.java
@@ -2,7 +2,6 @@ package com.c2kernel.lifecycle.instance.predefined.entitycreation;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
-import java.util.Iterator;
import com.c2kernel.common.CannotManageException;
import com.c2kernel.common.ObjectAlreadyExistsException;
@@ -21,19 +20,19 @@ public class NewAgent implements java.io.Serializable {
public String name;
public String password;
-
- public ArrayList roles;
+
+ public ArrayList<?> roles;
public NewAgent() {
super();
- roles = new ArrayList();
- }
-
+ roles = new ArrayList<Object>();
+ }
+
public NewAgent(String name, String password) {
this.name = name;
this.password = password;
}
-
+
protected void create(int agentId) throws ObjectNotFoundException, ObjectCannotBeUpdated, NoSuchAlgorithmException, CannotManageException, ObjectAlreadyExistsException {
AgentPath newAgent = Gateway.getLDAPLookup().getNextKeyManager().generateNextAgentKey();
newAgent.setAgentName(name);
@@ -50,8 +49,8 @@ public class NewAgent implements java.io.Serializable {
Logger.error(ex);
throw new CannotManageException("Error initialising new agent");
}
- for (Iterator iter = roles.iterator(); iter.hasNext();) {
- String role = (String) iter.next();
+ for (Object name2 : roles) {
+ String role = (String) name2;
RolePath thisRole;
try {
thisRole = Gateway.getLDAPLookup().getRoleManager().getRolePath(role);
@@ -60,6 +59,6 @@ public class NewAgent implements java.io.Serializable {
}
thisRole.addAgent(newAgent);
}
-
+
}
}
diff --git a/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/NewItem.java b/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/NewItem.java
index 32ca623..339e294 100644
--- a/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/NewItem.java
+++ b/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/NewItem.java
@@ -2,7 +2,6 @@ package com.c2kernel.lifecycle.instance.predefined.entitycreation;
import java.util.ArrayList;
-import java.util.Iterator;
import com.c2kernel.collection.MembershipException;
import com.c2kernel.common.CannotManageException;
@@ -22,7 +21,7 @@ import com.c2kernel.utils.Logger;
/**
* Complete Structure for new item
- *
+ *
* @version $Revision: 1.8 $ $Date: 2006/03/03 13:52:21 $
*/
public class NewItem {
@@ -48,31 +47,30 @@ public class NewItem {
/**
* Field _aggregationList
*/
- public ArrayList aggregationList;
+ public ArrayList<?> aggregationList;
/**
* Field _dependencyList
*/
- public ArrayList dependencyList;
+ public ArrayList<?> dependencyList;
public NewItem() {
super();
propertyList = new ArrayList<Property>();
- aggregationList = new ArrayList();
- dependencyList = new ArrayList();
+ aggregationList = new ArrayList<Object>();
+ dependencyList = new ArrayList<Object>();
}
-
+
public NewItem(String name, String initialPath, String wf) {
this();
this.name = name;
this.initialPath = initialPath;
this.workflow = wf;
}
-
+
public void setProperty(String name, String value) {
- for (Iterator iter = propertyList.iterator(); iter.hasNext();) {
- Property prop = (Property) iter.next();
+ for (Property prop : propertyList) {
if (prop.name.equals(name)) {
prop.value = value;
return;
@@ -80,30 +78,29 @@ public class NewItem {
}
propertyList.add(new Property(name, value));
}
-
+
protected void create(int agentId) throws ObjectCannotBeUpdated, ObjectNotFoundException, CannotManageException, ObjectAlreadyExistsException {
DomainPath domPath = new DomainPath(new DomainPath(initialPath), name);
if (domPath.exists())
throw new ObjectAlreadyExistsException(domPath+" already exists!", "");
-
+
// create item
EntityPath entPath = Gateway.getLDAPLookup().getNextKeyManager().generateNextEntityKey();
TraceableEntity newItem = (TraceableEntity)Gateway.getCorbaServer().createEntity(entPath);
Gateway.getLDAPLookup().add(entPath);
-
+
// assemble properties
PropertyArrayList propList = new PropertyArrayList();
propList.list.add(new com.c2kernel.property.Property("Name", name));
- for (Iterator iter = propertyList.iterator(); iter.hasNext();) {
- Property element = (Property) iter.next();
+ for (Property element : propertyList) {
propList.list.add(new com.c2kernel.property.Property(element.name, element.value));
}
// init the new item
try {
-
+
// find workflow def
CompositeActivityDef compact = (CompositeActivityDef)LocalObjectLoader.getActDef(workflow, "last");
-
+
newItem.initialise(
agentId,
CastorXMLUtility.marshall(propList),
@@ -113,11 +110,11 @@ public class NewItem {
Logger.error(ex);
throw new CannotManageException("Problem initialising new item. See server log.", "");
}
-
+
// create collections
-
- for (Iterator iter = dependencyList.iterator(); iter.hasNext();) {
- Dependency element = (Dependency) iter.next();
+
+ for (Object name2 : dependencyList) {
+ Dependency element = (Dependency) name2;
try {
Gateway.getStorage().put(entPath.getSysKey(), element.create(), null);
} catch (ClusterStorageException ex) {
@@ -128,9 +125,9 @@ public class NewItem {
throw new CannotManageException("A specified member is not of the correct type in "+element.name, "");
}
}
-
- for (Iterator iter = aggregationList.iterator(); iter.hasNext();) {
- Aggregation element = (Aggregation) iter.next();
+
+ for (Object name2 : aggregationList) {
+ Aggregation element = (Aggregation) name2;
try {
Gateway.getStorage().put(entPath.getSysKey(), element.create(), null);
} catch (ClusterStorageException ex) {
@@ -140,6 +137,6 @@ public class NewItem {
}
// register domain path
domPath.setEntity(entPath);
- Gateway.getLDAPLookup().add(domPath);
+ Gateway.getLDAPLookup().add(domPath);
}
}
diff --git a/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/Property.java b/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/Property.java
index d99a3e3..e2d214c 100755..100644
--- a/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/Property.java
+++ b/source/com/c2kernel/lifecycle/instance/predefined/entitycreation/Property.java
@@ -1,7 +1,7 @@
package com.c2kernel.lifecycle.instance.predefined.entitycreation;
/**
* New Properties for the item
- *
+ *
* @version $Revision: 1.1 $ $Date: 2005/04/28 13:48:26 $
*/
public class Property implements java.io.Serializable {
diff --git a/source/com/c2kernel/lifecycle/instance/stateMachine/StateMachine.java b/source/com/c2kernel/lifecycle/instance/stateMachine/StateMachine.java
index da7419c..8159106 100755..100644
--- a/source/com/c2kernel/lifecycle/instance/stateMachine/StateMachine.java
+++ b/source/com/c2kernel/lifecycle/instance/stateMachine/StateMachine.java
@@ -15,12 +15,12 @@ public class StateMachine implements Serializable
{
public int state = 0;
private Activity activity;
-
+
public static final String SKIPPABLE = "Skippable";
public static final String REPEATABLE = "Repeatable";
public static final String IGNORABLE = "Ignorable";
public static final String AUTOSTART = "Autostart";
-
+
/**
* Method StateMachine.
@@ -28,11 +28,11 @@ public class StateMachine implements Serializable
*/
public StateMachine(Activity act)
{
- activity = act;
+ activity = act;
}
-
+
/** row : States from (WAITING,RESERVED,STARTED,SUSPENDED,FINISHED,RWAITING,RRESERVED,RSTARTED,RSUSPENDED)
- * collumn : transition (RESERVE,START,SKIP,DONE,COMPLETE,SUSPEND,REASIGN,RESUME,REPEAT,IGNORE,PROCEED)
+ * collumn : transition (RESERVE,START,SKIP,DONE,COMPLETE,SUSPEND,REASIGN,RESUME,REPEAT,IGNORE,PROCEED)
* cell : State that is reached (-1 if transition not allowed)
*/
private int[][] getCurrentMachine()
@@ -49,14 +49,14 @@ public class StateMachine implements Serializable
/*7 RSTARTED*/ { -1, -1, -1, -1, 4, 8, -1, -1, -1,getIgnorable()?5:-1, -1},/*7 RSTARTED*/
/*8 RSUSPENDED*/ { -1, -1, -1, -1, -1, -1, 8, 7, -1, -1, -1} /*8 RSUSPENDED*/
};
- return returnArray;
+ return returnArray;
}
/**
* @see java.lang.Object#Object()
*/
public StateMachine()
- {
+ {
}
/**
@@ -77,10 +77,10 @@ public class StateMachine implements Serializable
int[] trans = new int[9];
int cmpt = 0;
for (int i=0; i< getCurrentMachine()[state].length;i++)
- if (getCurrentMachine()[state][i]!=-1) trans[cmpt++]=i;
-
+ if (getCurrentMachine()[state][i]!=-1) trans[cmpt++]=i;
+
int [] result = new int[cmpt];
- for (int i=0;i<cmpt;i++) result[i] = trans[i];
+ for (int i=0;i<cmpt;i++) result[i] = trans[i];
return result;
}
@@ -93,7 +93,7 @@ public class StateMachine implements Serializable
{
int newState = getCurrentMachine()[state][transition];
if (newState > -1) {
- state=newState;
+ state=newState;
return true;
}
Logger.msg("StateMachine.traverse() - Illegal transition "+Transitions.getTransitionName(transition)+" from "+States.getStateName(state));
@@ -138,5 +138,5 @@ public class StateMachine implements Serializable
{
return activity.getActive();
}
-
+
}
diff --git a/source/com/c2kernel/lifecycle/instance/stateMachine/States.java b/source/com/c2kernel/lifecycle/instance/stateMachine/States.java
index 638a7b0..b142e35 100755..100644
--- a/source/com/c2kernel/lifecycle/instance/stateMachine/States.java
+++ b/source/com/c2kernel/lifecycle/instance/stateMachine/States.java
@@ -20,7 +20,7 @@ public class States
public final static int RRESERVED = 6;
public final static int RSTARTED = 7;
public final static int RSUSPENDED = 8;
-
+
//everything less that this constant is NOT a repeating state
public final static int REPEATSTATESTART = 5;
diff --git a/source/com/c2kernel/lifecycle/instance/stateMachine/Transitions.java b/source/com/c2kernel/lifecycle/instance/stateMachine/Transitions.java
index 6597686..4239baa 100755..100644
--- a/source/com/c2kernel/lifecycle/instance/stateMachine/Transitions.java
+++ b/source/com/c2kernel/lifecycle/instance/stateMachine/Transitions.java
@@ -26,11 +26,11 @@ public class Transitions
public final static int ACTIVATION = 11;
private static String[] transitions = { "reserve", "start", "skip", "done", "complete", "suspend", "reassign", "resume", "repeat","ignore","proceed","activation" };
-
+
public static String getTransitionName(int trans)
{
try
- {
+ {
return Language.translate(transitions[trans]);
}
catch (ArrayIndexOutOfBoundsException ex)
diff --git a/source/com/c2kernel/lifecycle/routingHelpers/ViewpointDataHelper.java b/source/com/c2kernel/lifecycle/routingHelpers/ViewpointDataHelper.java
index 754bd8f..0258347 100755..100644
--- a/source/com/c2kernel/lifecycle/routingHelpers/ViewpointDataHelper.java
+++ b/source/com/c2kernel/lifecycle/routingHelpers/ViewpointDataHelper.java
@@ -34,7 +34,7 @@ public class ViewpointDataHelper
String viewpoint;
String xpath;
Object[] retArr;
-
+
// find syskey, viewname, xpath
int firstSlash = value.indexOf("/");
if (firstSlash > 0) {
@@ -49,16 +49,16 @@ public class ViewpointDataHelper
}
}
else return errArr;
-
+
// find entity
EntityPath sourcePath;
- try
+ try
{
sourcePath = new EntityPath(Integer.parseInt(entityPath));
} catch (Exception e) {
sourcePath = new EntityPath(entityPath);
}
-
+
try {
// load viewpoint
ItemProxy dataSource = (ItemProxy)Gateway.getProxyManager().getProxy(sourcePath);
@@ -71,7 +71,7 @@ public class ViewpointDataHelper
else
retArr = XmlElementParser.parse(outcome.getData(), xpath);
return retArr;
-
+
} catch (ObjectNotFoundException e) {
return errArr;
}