public ConnectableDTO createConnectableDto(final FunnelDTO funnel) { final ConnectableDTO connectable = new ConnectableDTO(); connectable.setGroupId(funnel.getParentGroupId()); connectable.setId(funnel.getId()); connectable.setType(ConnectableType.FUNNEL.name()); connectable.setVersionedComponentId(funnel.getVersionedComponentId()); return connectable; }
if (requestFunnelEntity.getComponent().getId() != null) { throw new IllegalArgumentException("Funnel ID cannot be specified."); final Revision revision = getRevision(funnelEntity, funnelEntity.getComponent().getId()); final FunnelEntity entity = serviceFacade.createFunnel(revision, groupId, funnelEntity.getComponent()); funnelResource.populateRemainingFunnelEntityContent(entity);
public FunnelDTO copy(final FunnelDTO original) { final FunnelDTO copy = new FunnelDTO(); copy.setId(original.getId()); copy.setParentGroupId(original.getParentGroupId()); copy.setPosition(original.getPosition()); copy.setVersionedComponentId(original.getVersionedComponentId()); return copy; }
public FunnelEntity createFunnelEntity(final FunnelDTO dto, final RevisionDTO revision, final PermissionsDTO permissions) { final FunnelEntity entity = new FunnelEntity(); entity.setRevision(revision); if (dto != null) { entity.setPermissions(permissions); entity.setId(dto.getId()); entity.setPosition(dto.getPosition()); if (permissions != null && permissions.getCanRead()) { entity.setComponent(dto); } } return entity; }
@Override public FunnelEntity updateFunnel(final Revision revision, final FunnelDTO funnelDTO) { final Funnel funnelNode = funnelDAO.getFunnel(funnelDTO.getId()); final RevisionUpdate<FunnelDTO> snapshot = updateComponent(revision, funnelNode, () -> funnelDAO.updateFunnel(funnelDTO), funnel -> dtoFactory.createFunnelDto(funnel)); final PermissionsDTO permissions = dtoFactory.createPermissionsDto(funnelNode); return entityFactory.createFunnelEntity(snapshot.getComponent(), dtoFactory.createRevisionDTO(snapshot.getLastModification()), permissions); }
@Override public FunnelEntity createFunnel(final Revision revision, final String groupId, final FunnelDTO funnelDTO) { final RevisionUpdate<FunnelDTO> snapshot = createComponent( revision, funnelDTO, () -> funnelDAO.createFunnel(groupId, funnelDTO), funnel -> dtoFactory.createFunnelDto(funnel)); final Funnel funnel = funnelDAO.getFunnel(funnelDTO.getId()); final PermissionsDTO permissions = dtoFactory.createPermissionsDto(funnel); return entityFactory.createFunnelEntity(snapshot.getComponent(), dtoFactory.createRevisionDTO(snapshot.getLastModification()), permissions); }
@Override public Funnel updateFunnel(FunnelDTO funnelDTO) { // get the funnel being updated Funnel funnel = locateFunnel(funnelDTO.getId()); // update the label state if (isNotNull(funnelDTO.getPosition())) { if (funnelDTO.getPosition() != null) { funnel.setPosition(new Position(funnelDTO.getPosition().getX(), funnelDTO.getPosition().getY())); } } funnel.getProcessGroup().onComponentModified(); return funnel; }
@Override public Funnel createFunnel(String groupId, FunnelDTO funnelDTO) { if (funnelDTO.getParentGroupId() != null && !flowController.getFlowManager().areGroupsSame(groupId, funnelDTO.getParentGroupId())) { throw new IllegalArgumentException("Cannot specify a different Parent Group ID than the Group to which the Funnel is being added."); } // get the desired group ProcessGroup group = locateProcessGroup(flowController, groupId); // create the funnel Funnel funnel = flowController.getFlowManager().createFunnel(funnelDTO.getId()); if (funnelDTO.getPosition() != null) { funnel.setPosition(new Position(funnelDTO.getPosition().getX(), funnelDTO.getPosition().getY())); } // add the funnel group.addFunnel(funnel); group.startFunnel(funnel); return funnel; }
final Funnel funnel = group.getFunnel(snippetFunnel.getId());
actions.add(generateAuditRecord(funnel.getId(), StringUtils.EMPTY, Component.Funnel, Operation.Add, timestamp));
for (final FunnelDTO funnelDTO : snippetContents.getFunnels()) { final FunnelDTO cp = dtoFactory.copy(funnelDTO); cp.setId(generateId(funnelDTO.getId(), idGenerationSeed, isCopy)); cp.setParentGroupId(groupId); funnels.add(cp); connectableMap.put(funnelDTO.getParentGroupId() + "-" + funnelDTO.getId(), dtoFactory.createConnectableDto(cp)); ResourceFactory.getComponentResource(ResourceType.Funnel, funnelDTO.getId(), funnelDTO.getId()), ResourceFactory.getComponentResource(ResourceType.Funnel, cp.getId(), cp.getId()), idGenerationSeed);
for (final Element funnelElement : funnelNodeList) { final FunnelDTO funnelDTO = FlowFromDOMFactory.getFunnel(funnelElement); final Funnel funnel = flowManager.createFunnel(funnelDTO.getId()); funnel.setVersionedComponentId(funnelDTO.getVersionedComponentId()); funnel.setPosition(toPosition(funnelDTO.getPosition()));
final Funnel funnel = flowManager.createFunnel(funnelDTO.getId()); funnel.setPosition(toPosition(funnelDTO.getPosition())); if (!topLevel) {
@Override public FunnelSchema apply(FunnelDTO funnelDTO) { Map<String, Object> map = new HashMap<>(); map.put(ID_KEY, funnelDTO.getId()); return new FunnelSchema(map); } }
@Override public FunnelSchema apply(FunnelDTO funnelDTO) { Map<String, Object> map = new HashMap<>(); map.put(ID_KEY, funnelDTO.getId()); return new FunnelSchema(map); } }