final int width = context.getWidth() <= 0 ? 40 : context.getWidth();
final int height = context.getHeight() <= 0 ? 40 : context.getHeight();
final IGaService gaService = Graphiti.getGaService();
Polygon polygon;
{
int xy[] = new int[] { 0, 20, 20, 0, 40, 20, 20, 40, 0, 20 };
final Polygon invisiblePolygon = gaService.createPolygon(containerShape, xy);
invisiblePolygon.setFilled(false);
invisiblePolygon.setLineVisible(false);
gaService.setLocationAndSize(invisiblePolygon, context.getX(), context.getY(), width, height);
// create and set visible polygon inside invisible polygon
polygon = gaService.createPolygon(invisiblePolygon, xy);
polygon.setParentGraphicsAlgorithm(invisiblePolygon);