Class SwapDataElementParameterConnections
- java.lang.Object
-
- de.aristaflow.adept2.core.changeoperations.SwapDataElementParameterConnections
-
public class SwapDataElementParameterConnections extends Object
The intended task of this change operation is to swap the already existent logical mapping between two data elements and their parameters of an EBP. Call isPossible first to check if the change is valid, than call perform operation to execute the change Example of intended usage: Activity a1 assigned to node n1 has to input parameters (ip1, ip2) with the same type. ip1 is connected to connector c1, ip2 is connected to c2. Furthermore data edges between n1 and data element d1 and n1 and data element d2 exists. Now data element d2 should be mapped to ip1. To achieve this the connectorID where d2 is connected with (c2) must be changed from c2 to c1. To avoid an incorrect mapping in the following data element d1 must be mapped to c2 ("swapped"). Thereby the "inner" mapping between ip1 and c1 and ip2 and c2 can remain unchanged. Note: if a data element should be mapped to a parameter which is actual unconnected or disabled use change operationReconnectDataEdge
instead
-
-
Constructor Summary
Constructors Constructor Description SwapDataElementParameterConnections()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
isPossible(ChangeableInstance instance, int nodeID, int dataElementID1, DataEdge dataEdge1, int dataElementID2, DataEdge dataEdge2)
Check if it is possible to swap the parameter data element connections of the given data edges in the given instance.static boolean
isPossible(ChangeableInstance instance, int nodeID, int dataElementID1, DataEdge dataEdge1, int dataElementID2, DataEdge dataEdge2, CheckReport checkReport)
Check if it is possible to swap the parameter data element connections of the given data edges in the given instance.static boolean
isPossible(Template template, int nodeID, int dataElementID1, DataEdge dataEdge1, int dataElementID2, DataEdge dataEdge2)
Check if it is possible (concerning structural correctness) to swap the parameter data element connections of the given data edges in the given template.static boolean
isPossible(Template template, int nodeID, int dataElementID1, DataEdge dataEdge1, int dataElementID2, DataEdge dataEdge2, CheckReport checkReport)
Check if it is possible (concerning structural correctness) to swap the parameter data element connections of the given data edges in the given template.static void
performOperation(SessionToken session, ChangeableInstance instance, int nodeID, int dataElementID1, DataEdge dataEdge1, int dataElementID2, DataEdge dataEdge2)
Swaps the parameter data element connections of the given data edges in the given instance.static void
performOperation(SessionToken session, ChangeableInstance instance, int nodeID, int dataElementID1, DataEdge dataEdge1, int dataElementID2, DataEdge dataEdge2, UpdateManager updateManager)
Swaps the parameter data element connections of the given data edges in the given instance.static void
performOperation(SessionToken session, ChangeableTemplate template, int nodeID, int dataElementID1, DataEdge dataEdge1, int dataElementID2, DataEdge dataEdge2)
Swaps the parameter data element connections of the given data edges in the given template.static void
performOperation(SessionToken session, ChangeableTemplate template, int nodeID, int dataElementID1, DataEdge dataEdge1, int dataElementID2, DataEdge dataEdge2, UpdateManager updateManager)
Swaps the parameter data element connections of the given data edges in the given template.protected static void
performOperation(SessionToken session, ChangePrimitives processGraph, int nodeID, int dataElementID1, DataEdge dataEdge1, int dataElementID2, DataEdge dataEdge2, UpdateManager updateManager)
Worker method to do the structural changes for both changeable templates and changeable instances.
-
-
-
Method Detail
-
isPossible
public static boolean isPossible(Template template, int nodeID, int dataElementID1, DataEdge dataEdge1, int dataElementID2, DataEdge dataEdge2)
Check if it is possible (concerning structural correctness) to swap the parameter data element connections of the given data edges in the given template.- Parameters:
template
- the template where the change operation is performed on.nodeID
- the node where data edge 1 and 2 is connected withdataElementID1
- the data element where the data edge 1 is connected withdataEdge1
- the data edge 1 objectdataElementID2
- the data element where the data edge 2 is connected withdataEdge2
- the data edge 2 object- Returns:
- true if possible
-
isPossible
public static boolean isPossible(Template template, int nodeID, int dataElementID1, DataEdge dataEdge1, int dataElementID2, DataEdge dataEdge2, CheckReport checkReport)
Check if it is possible (concerning structural correctness) to swap the parameter data element connections of the given data edges in the given template. If it is not possible the reasons are stored in the check report.- Parameters:
template
- the template where the change operation is performed on.nodeID
- the node where data edge 1 and 2 is connected withdataElementID1
- the data element where the data edge 1 is connected withdataEdge1
- the data edge 1 objectdataElementID2
- the data element where the data edge 2 is connected withdataEdge2
- the data edge 2 objectcheckReport
- a checkReport object which can be filled with the reason why the isPossible failed (i.e. in the case the method returns false), may be null- Returns:
- true if possible
-
isPossible
public static boolean isPossible(ChangeableInstance instance, int nodeID, int dataElementID1, DataEdge dataEdge1, int dataElementID2, DataEdge dataEdge2)
Check if it is possible to swap the parameter data element connections of the given data edges in the given instance.- Parameters:
instance
- the changeable instance where the change operation is performed on.nodeID
- the node where data edge 1 and 2 is connected withdataElementID1
- the data element where the data edge 1 is connected withdataEdge1
- the data edge 1 objectdataElementID2
- the data element where the data edge 2 is connected withdataEdge2
- the data edge 2 object- Returns:
- true if possible
-
isPossible
public static boolean isPossible(ChangeableInstance instance, int nodeID, int dataElementID1, DataEdge dataEdge1, int dataElementID2, DataEdge dataEdge2, CheckReport checkReport)
Check if it is possible to swap the parameter data element connections of the given data edges in the given instance. If it is not possible the reasons are stored in the check report.- Parameters:
instance
- the changeable instance where the change operation is performed on.nodeID
- the node where data edge 1 and 2 is connected withdataElementID1
- the data element where the data edge 1 is connected withdataEdge1
- the data edge 1 objectdataElementID2
- the data element where the data edge 2 is connected withdataEdge2
- the data edge 2 objectcheckReport
- a checkReport object which can be filled with the reason why the isPossible failed (i.e. in the case the method returns false), may be null- Returns:
- true if possible
-
performOperation
public static void performOperation(SessionToken session, ChangeableTemplate template, int nodeID, int dataElementID1, DataEdge dataEdge1, int dataElementID2, DataEdge dataEdge2)
Swaps the parameter data element connections of the given data edges in the given template.- Parameters:
session
- The session which is used to check for access rights on this method.template
- the template where the change operation is performed on.nodeID
- the node where data edge 1 and 2 is connected withdataElementID1
- the data element where the data edge 1 is connected withdataEdge1
- the data edge 1 objectdataElementID2
- the data element where the data edge 2 is connected withdataEdge2
- the data edge 2 object
-
performOperation
public static void performOperation(SessionToken session, ChangeableTemplate template, int nodeID, int dataElementID1, DataEdge dataEdge1, int dataElementID2, DataEdge dataEdge2, UpdateManager updateManager)
Swaps the parameter data element connections of the given data edges in the given template. (with updateManager)- Parameters:
session
- The session which is used to check for access rights on this method.template
- the template where the change operation is performed on.nodeID
- the node where data edge 1 and 2 is connected withdataElementID1
- the data element where the data edge 1 is connected withdataEdge1
- the data edge 1 objectdataElementID2
- the data element where the data edge 2 is connected withdataEdge2
- the data edge 2 objectupdateManager
- the manager who controls the update of the visual graph components (maybe null).
-
performOperation
public static void performOperation(SessionToken session, ChangeableInstance instance, int nodeID, int dataElementID1, DataEdge dataEdge1, int dataElementID2, DataEdge dataEdge2)
Swaps the parameter data element connections of the given data edges in the given instance.- Parameters:
session
- The session which is used to check for access rights on this method.instance
- the changeable instance where the change operation is performed on.nodeID
- the node where data edge 1 and 2 is connected withdataElementID1
- the data element where the data edge 1 is connected withdataEdge1
- the data edge 1 objectdataElementID2
- the data element where the data edge 2 is connected withdataEdge2
- the data edge 2 object
-
performOperation
public static void performOperation(SessionToken session, ChangeableInstance instance, int nodeID, int dataElementID1, DataEdge dataEdge1, int dataElementID2, DataEdge dataEdge2, UpdateManager updateManager)
Swaps the parameter data element connections of the given data edges in the given instance. (with updateManager)- Parameters:
session
- The session which is used to check for access rights on this method.instance
- the changeable instance where the change operation is performed on.nodeID
- the node where data edge 1 and 2 is connected withdataElementID1
- the data element where the data edge 1 is connected withdataEdge1
- the data edge 1 objectdataElementID2
- the data element where the data edge 2 is connected withdataEdge2
- the data edge 2 objectupdateManager
- the manager who controls the update of the visual graph components (maybe null).
-
performOperation
protected static void performOperation(SessionToken session, ChangePrimitives processGraph, int nodeID, int dataElementID1, DataEdge dataEdge1, int dataElementID2, DataEdge dataEdge2, UpdateManager updateManager)
Worker method to do the structural changes for both changeable templates and changeable instances.- Parameters:
session
- The session which is used to check for access rights on this method.processGraph
- an instance of type ChangeableTemplate or ChangeableInstancenodeID
- the node where data edge 1 and 2 is connected withdataElementID1
- the data element where the data edge 1 is connected withdataEdge1
- the data edge 1 objectdataElementID2
- the data element where the data edge 2 is connected withdataEdge2
- the data edge 2 objectupdateManager
- the manager who controls the update of the visual graph components (maybe null).
-
-