protected void triggerCompleted(String type, boolean remove) {
if (remove) {
processInstance.getNodeContainer().removeNodeInstance(this);
}
Node node = getNode();
List<SequenceFlow> flows = null;
if (node != null) {
flows = node.getOutgoingFlows(type);
}
if (flows == null || flows.isEmpty()) {
processInstance.getNodeContainer().nodeInstanceCompleted(this, type);
} else {
for (SequenceFlow flow : flows) {