Class CreateSurroundingBlock
- java.lang.Object
-
- de.aristaflow.adept2.core.changeoperations.CreateSurroundingBlock
-
public class CreateSurroundingBlock extends Object
This change operation offers the possibility to surround nodes with a block of the following types:- AND-Split -> AND-Join
- XOR-Split -> XOR-Join
- LOOP-Start -> LOOP-End
-
-
Constructor Summary
Constructors Constructor Description CreateSurroundingBlock()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
isPossible(ChangeableInstance instance, Node first, Node last, ProcessConstants.BlockType type)
Check if it is possible (concerning structural and state-based correctness) to create a block which surrounds the two given nodes in the given instance.static boolean
isPossible(ChangeableInstance instance, Node first, Node last, ProcessConstants.BlockType type, CheckReport checkReport)
Check if it is possible (concerning structural and state-based correctness) to create a block which surrounds the two given nodes in the given template.static boolean
isPossible(Template template, Node first, Node last, ProcessConstants.BlockType type)
Check if it is possible (concerning structural correctness) to create a block which surrounds the two given nodes in the given template.static boolean
isPossible(Template template, Node first, Node last, ProcessConstants.BlockType type, CheckReport checkReport)
Check if it is possible (concerning structural correctness) to create a block which surrounds the two given nodes in the given template.static Node[]
performOperation(SessionToken session, ChangeableInstance instance, Node first, Node last, ProcessConstants.BlockType type)
Inserts a new block of the given type around the two given nodes in the given instance.static Node[]
performOperation(SessionToken session, ChangeableInstance instance, Node first, Node last, ProcessConstants.BlockType type, UpdateManager updateManager)
Inserts a new block of the given type around the two given nodes in the given instance (with updateManager).static Node[]
performOperation(SessionToken session, ChangeableTemplate template, Node first, Node last, ProcessConstants.BlockType type)
Inserts a new block of the given type around the two given nodes in the given template.static Node[]
performOperation(SessionToken session, ChangeableTemplate template, Node first, Node last, ProcessConstants.BlockType type, UpdateManager updateManager)
Inserts a new block of the given type around the two given nodes in the given template (with updateManager).protected static Node[]
performOperation(SessionToken session, ChangePrimitives processGraph, Node first, Node last, 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
the Logger for the change operation
-
-
Method Detail
-
isPossible
public static boolean isPossible(Template template, Node first, Node last, ProcessConstants.BlockType type)
Check if it is possible (concerning structural correctness) to create a block which surrounds the two given nodes in the given template.- Parameters:
template
- The template where the method is performed on.first
- the first node of the blocklast
- the last node of the blocktype
- the BlockType- Returns:
- True, if the insertion is possible.
-
isPossible
public static boolean isPossible(Template template, Node first, Node last, ProcessConstants.BlockType type, CheckReport checkReport)
Check if it is possible (concerning structural correctness) to create a block which surrounds the two given nodes in the given template. If the check fails the reason is stored in the given chechReport (provided that checkReport is not null)- Parameters:
template
- The template where the method is performed on.first
- the first node of the blocklast
- the last node of the blocktype
- the BlockTypecheckReport
- 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 the insertion is possible.
-
isPossible
public static boolean isPossible(ChangeableInstance instance, Node first, Node last, ProcessConstants.BlockType type)
Check if it is possible (concerning structural and state-based correctness) to create a block which surrounds the two given nodes in the given instance.- Parameters:
instance
- The changeable instance where the method is performed on.first
- the first node of the blocklast
- the last node of the blocktype
- the BlockType- Returns:
- True, if the insertion is possible.
-
isPossible
public static boolean isPossible(ChangeableInstance instance, Node first, Node last, ProcessConstants.BlockType type, CheckReport checkReport)
Check if it is possible (concerning structural and state-based correctness) to create a block which surrounds the two given nodes in the given template. If the check fails the reason is stored in the given chechReport (provided that checkReport is not null)- Parameters:
instance
- The changeable instance where the method is performed on.first
- the first node of the blocklast
- the last node of the blocktype
- the BlockTypecheckReport
- 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 the insertion is possible.
-
performOperation
public static Node[] performOperation(SessionToken session, ChangeableTemplate template, Node first, Node last, ProcessConstants.BlockType type)
Inserts a new block of the given type around the two given nodes in the given template.- Parameters:
session
- The session which is used to check for access rights on this method.template
- The template where the block is inserted.first
- the first node of the blocklast
- the last node of the blocktype
- the BlockType (OR_BLOCK, AND_BLOCK, LOOP_BLOCK)- Returns:
- The newly inserted node.
-
performOperation
public static Node[] performOperation(SessionToken session, ChangeableTemplate template, Node first, Node last, ProcessConstants.BlockType type, UpdateManager updateManager)
Inserts a new block of the given type around the two given nodes 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 block is inserted.first
- the first node of the blocklast
- the last node of the blocktype
- the BlockType (OR_BLOCK, AND_BLOCK, LOOP_BLOCK)updateManager
- the manager who controls the update of the visual graph components.- Returns:
- The newly inserted nodes.
-
performOperation
public static Node[] performOperation(SessionToken session, ChangeableInstance instance, Node first, Node last, ProcessConstants.BlockType type)
Inserts a new block of the given type around the two given nodes 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 block is inserted.first
- the first node of the blocklast
- the last node of the blocktype
- the BlockType (OR_BLOCK, AND_BLOCK, LOOP_BLOCK)- Returns:
- The newly inserted node.
-
performOperation
public static Node[] performOperation(SessionToken session, ChangeableInstance instance, Node first, Node last, ProcessConstants.BlockType type, UpdateManager updateManager)
Inserts a new block of the given type around the two given nodes 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 block is inserted.first
- the first node of the blocklast
- the last node of the blocktype
- the BlockType (OR_BLOCK, AND_BLOCK, LOOP_BLOCK)updateManager
- the manager who controls the update of the visual graph components.- Returns:
- The newly inserted nodes.
-
performOperation
protected static Node[] performOperation(SessionToken session, ChangePrimitives processGraph, Node first, Node last, 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 ChangeableInstancefirst
- the first node of the blocklast
- the last node of the blocktype
- the BlockType (OR_BLOCK, AND_BLOCK, LOOP_BLOCK)updateManager
- the manager who controls the update of the visual graph components.- Returns:
- The newly inserted data element.
-
-