return (context.getTargetContainer() instanceof Diagram ||
parentObject instanceof SubProcess || parentObject instanceof Lane);
}
public Object[] create(ICreateContext context) {
StartEvent startEvent = new AlfrescoStartEvent();
startEvent.setId(getNextId(startEvent));
startEvent.setName("Alfresco start");
List<String> formTypes = PreferencesUtil.getStringArray(Preferences.ALFRESCO_FORMTYPES_STARTEVENT);
if (formTypes.size() > 0) {
startEvent.setFormKey(formTypes.get(0));
}
Object parentObject = getBusinessObjectForPictogramElement(context.getTargetContainer());
if (parentObject instanceof SubProcess) {
((SubProcess) parentObject).addFlowElement(startEvent);
} else if (parentObject instanceof Lane) {
final Lane lane = (Lane) parentObject;
lane.getFlowReferences().add(startEvent.getId());
lane.getParentProcess().addFlowElement(startEvent);
} else {
Bpmn2MemoryModel model = ModelHandler.getModel(EcoreUtil.getURI(getDiagram()));
if (model.getBpmnModel().getMainProcess() == null) {