Class InsertEmptyBlock
- java.lang.Object
-
- de.aristaflow.adept2.core.changeoperations.InsertEmptyBlock
-
public class InsertEmptyBlock extends Object
Inserts an empty block consisting of a split, and a join node, and a single empty branch between them. The following blocks are possible at the moment:- AND-Split -> AND-Join
- XOR-Split -> XOR-Join
- LOOP-Start -> LOOP-End
-
-
Constructor Summary
Constructors Constructor Description InsertEmptyBlock()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
isPossible(ChangeableInstance instance, Node pred, Node succ)
Checks if it is possible (concerning structural and state-based correctness) to insert an empty block in the given instance.static boolean
isPossible(ChangeableInstance instance, Node pred, Node succ, CheckReport checkReport)
Checks if it is possible (concerning structural and state-based correctness) to insert an empty block in the given instance.static boolean
isPossible(Template template, Node pred, Node succ)
Checks if it is possible (concerning structural correctness) to insert an empty block in the given template.static boolean
isPossible(Template template, Node pred, Node succ, CheckReport checkReport)
Checks if it is possible (concerning structural correctness) to insert an empty block in the given template.static Node[]
performOperation(SessionToken session, ChangeableInstance instance, Node pred, Node succ, ProcessConstants.BlockType type)
Inserts an empty block of the given type in the instance.static Node[]
performOperation(SessionToken session, ChangeableInstance instance, Node pred, Node succ, ProcessConstants.BlockType type, UpdateManager updateManager)
Inserts an empty block of the given type in the instance (with updateManager).static Node[]
performOperation(SessionToken session, ChangeableTemplate template, Node pred, Node succ, ProcessConstants.BlockType type)
Inserts an empty block of the given type in the template.static Node[]
performOperation(SessionToken session, ChangeableTemplate template, Node pred, Node succ, ProcessConstants.BlockType type, UpdateManager updateManager)
Inserts an empty block of the given type in the template (with updateManager).protected static Node[]
performOperation(SessionToken session, ChangePrimitives processGraph, Node pred, Node succ, ProcessConstants.BlockType type, UpdateManager updateManager)
Worker method to do the structural changes for both changeable templates and changeable instances.
-
-
-
Field Detail
-
logger
protected static final Logger logger
a Logger
-
-
Method Detail
-
isPossible
public static boolean isPossible(Template template, Node pred, Node succ)
Checks if it is possible (concerning structural correctness) to insert an empty block in the given template.- Parameters:
template
- the template the change is performed onpred
- the node after which the empty block should be insertedsucc
- the node before which the empty block should be inserted- Returns:
- True, if it is possible
-
isPossible
public static boolean isPossible(Template template, Node pred, Node succ, CheckReport checkReport)
Checks if it is possible (concerning structural correctness) to insert an empty block in the given template. If it is not possible the reasons are stored in the checkReport.- Parameters:
template
- he template the change is performed onpred
- the node after which the empty block should be insertedsucc
- the node before which the empty block should be insertedcheckReport
- 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 it is possible
-
isPossible
public static boolean isPossible(ChangeableInstance instance, Node pred, Node succ)
Checks if it is possible (concerning structural and state-based correctness) to insert an empty block in the given instance.- Parameters:
instance
- the changeable instance the change is performed onpred
- the node after which the empty block should be insertedsucc
- the node before which the empty block should be inserted- Returns:
- True, if it is possible
-
isPossible
public static boolean isPossible(ChangeableInstance instance, Node pred, Node succ, CheckReport checkReport)
Checks if it is possible (concerning structural and state-based correctness) to insert an empty block in the given instance. If it is not possible the reasons are stored in the checkReport.- Parameters:
instance
- the changeable instance the change is performed onpred
- the node after which the empty block should be insertedsucc
- the node before which the empty block should be insertedcheckReport
- 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 it is possible
-
performOperation
public static Node[] performOperation(SessionToken session, ChangeableTemplate template, Node pred, Node succ, ProcessConstants.BlockType type)
Inserts an empty block of the given type in the template. Supported block types:- AND_BLOCK
- OR_BLOCK
- LOOP-BLOCK
- Parameters:
session
- The session which is used to check for access rights on this method.template
- the template where the change is performed onpred
- the node after which the empty block should be insertedsucc
- the node before which the empty block should be insertedtype
- the type of the block to insert- Returns:
- the inserted block
-
performOperation
public static Node[] performOperation(SessionToken session, ChangeableTemplate template, Node pred, Node succ, ProcessConstants.BlockType type, UpdateManager updateManager)
Inserts an empty block of the given type in the template (with updateManager). Supported block types:- AND_BLOCK
- OR_BLOCK
- LOOP-BLOCK
- Parameters:
session
- The session which is used to check for access rights on this method.template
- the template where the change is performed onpred
- the node after which the empty block should be insertedsucc
- the node before which the empty block should be insertedtype
- the type of the block to insertupdateManager
- the manager who controls the update of the visual graph components.- Returns:
- the inserted block
-
performOperation
public static Node[] performOperation(SessionToken session, ChangeableInstance instance, Node pred, Node succ, ProcessConstants.BlockType type)
Inserts an empty block of the given type in the instance. Supported block types:- AND_BLOCK
- OR_BLOCK
- LOOP-BLOCK
- Parameters:
session
- The session which is used to check for access rights on this method.instance
- the changeable instance where the change is performed onpred
- the node after which the empty block should be insertedsucc
- the node before which the empty block should be insertedtype
- the type of the block to insert- Returns:
- the inserted block
-
performOperation
public static Node[] performOperation(SessionToken session, ChangeableInstance instance, Node pred, Node succ, ProcessConstants.BlockType type, UpdateManager updateManager)
Inserts an empty block of the given type in the instance (with updateManager). Supported block types:- AND_BLOCK
- OR_BLOCK
- LOOP-BLOCK
- Parameters:
session
- The session which is used to check for access rights on this method.instance
- the changeable instance where the change is performed onpred
- the node after which the empty block should be insertedsucc
- the node before which the empty block should be insertedtype
- the type of the block to insertupdateManager
- the manager who controls the update of the visual graph components.- Returns:
- the inserted block
-
performOperation
protected static Node[] performOperation(SessionToken session, ChangePrimitives processGraph, Node pred, Node succ, ProcessConstants.BlockType type, 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 ChangeableInstancepred
- the node after which the empty block should be insertedsucc
- the node before which the empty block should be insertedtype
- the type of the block to insertupdateManager
- the manager who controls the update of the visual graph components.- Returns:
- The newly inserted data element.
-
-