use of org.eclipse.bpmn2.SequenceFlow in project kie-wb-common by kiegroup.
the class SequenceFlowPropertyWriter method setWaypoints.
private void setWaypoints(ViewConnector<? extends BPMNViewDefinition> connector) {
BPMNEdge bpmnEdge = di.createBPMNEdge();
bpmnEdge.setBpmnElement(sequenceFlow);
Point2D sourcePt = connector.getSourceConnection().get().getLocation();
Point2D targetPt = connector.getTargetConnection().get().getLocation();
org.eclipse.dd.dc.Point sourcePoint = dc.createPoint();
sourcePoint.setX(source.getShape().getBounds().getX() + (float) sourcePt.getX());
sourcePoint.setY(source.getShape().getBounds().getY() + (float) sourcePt.getY());
org.eclipse.dd.dc.Point targetPoint = dc.createPoint();
targetPoint.setX(target.getShape().getBounds().getX() + (float) targetPt.getX());
targetPoint.setY(target.getShape().getBounds().getY() + (float) targetPt.getY());
bpmnEdge.getWaypoint().add(sourcePoint);
bpmnEdge.getWaypoint().add(targetPoint);
this.bpmnEdge = bpmnEdge;
}
use of org.eclipse.bpmn2.SequenceFlow in project kie-wb-common by kiegroup.
the class GatewayPropertyWriterTest method testSetSourceForInclusiveGateway.
@Test
public void testSetSourceForInclusiveGateway() {
InclusiveGateway inclusiveGateway = mockGateway(InclusiveGateway.class, ID);
prepareTestSetSourceOrTarget(inclusiveGateway);
propertyWriter.setSource(anotherPropertyWriter);
verify(inclusiveGateway).setDefault(sequenceFlow);
}
use of org.eclipse.bpmn2.SequenceFlow in project kie-wb-common by kiegroup.
the class SequenceFlowPropertyWriterTest method setControlPoints.
@Test
public void setControlPoints() {
TestSequenceFlowWriter w = new TestSequenceFlowWriter();
SequenceFlowPropertyWriter p = w.sequenceFlowOf(SEQ_ID);
float sx = 10, sy = 10, sWidth = 50, sHeight = 70;
PropertyWriter source = w.nodeOf(SOURCE_ID, sx, sy, sWidth, sHeight);
float tx = 100, ty = 100, tWidth = 20, tHeight = 30;
PropertyWriter target = w.nodeOf(TARGET_ID, tx, ty, tWidth, tHeight);
p.setSource(source);
p.setTarget(target);
// magnets have null location
ViewConnectorImpl<SequenceFlow> connector = makeConnector();
connector.setSourceConnection(MagnetConnection.Builder.at(1, 2));
connector.setTargetConnection(MagnetConnection.Builder.at(2, 3));
connector.setControlPoints(new ControlPoint[] { ControlPoint.build(Point2D.create(sx + 100, sy + 100)), ControlPoint.build(Point2D.create(sx + 150, sy + 150)) });
p.setConnection(connector);
BPMNEdge edge = p.getEdge();
List<Point> expected = asList(pointOf(sx + 1, sy + 2), pointOf(sx + 100, sy + 100), pointOf(sx + 150, sy + 150), pointOf(tx + 2, ty + 3));
List<Point> waypoints = edge.getWaypoint();
assertPointsEqual(expected, waypoints, "when magnet location is defined, waypoints should be translated into an absolute position");
}
use of org.eclipse.bpmn2.SequenceFlow in project kie-wb-common by kiegroup.
the class TestDefinitionsWriter method sequenceFlowOf.
public SequenceFlow sequenceFlowOf(String id, FlowNode source, FlowNode target, List<Point> waypoints) {
SequenceFlow sequenceFlow = bpmn2.createSequenceFlow();
sequenceFlow.setId(id);
sequenceFlow.setSourceRef(source);
sequenceFlow.setTargetRef(target);
BPMNEdge edge = di.createBPMNEdge();
edge.setBpmnElement(sequenceFlow);
bpmnPlane.getPlaneElement().add(edge);
edge.getWaypoint().addAll(waypoints);
return sequenceFlow;
}
use of org.eclipse.bpmn2.SequenceFlow in project kie-wb-common by kiegroup.
the class MatchTest method ignoreTestIgnore.
@Test
public void ignoreTestIgnore() {
ManualTask manualTask = Bpmn2Factory.eINSTANCE.createManualTask();
Result<BpmnNode> result1 = match().mode(MarshallingRequest.Mode.IGNORE).apply(manualTask);
assertEquals(result1.value(), defaultValue);
assertTrue(result1.isIgnored());
assertFalse(result1.isFailure());
SequenceFlow sequenceFlow = Bpmn2Factory.eINSTANCE.createSequenceFlow();
Result<BpmnNode> result2 = match().mode(MarshallingRequest.Mode.IGNORE).apply(sequenceFlow);
assertEquals(result2.value(), outValue);
assertTrue(result2.isIgnored());
assertFalse(result2.isFailure());
}
Aggregations