Search in sources :

Example 1 with LaneVO

use of com.centurylink.mdw.model.value.process.LaneVO in project mdw-designer by CenturyLinkCloud.

the class DesignerDataModel method copyPackage.

public PackageVO copyPackage(PackageVO curPkg, String newname, int newversion) {
    PackageVO newPkg = new PackageVO();
    newPkg.setPackageName(newname != null ? newname : curPkg.getPackageName());
    newPkg.setPackageDescription(curPkg.getPackageDescription());
    newPkg.setExported(false);
    // newPkg.setPools(pools)
    // newPkg.setVariables(variables)
    newPkg.setSchemaVersion(DataAccess.currentSchemaVersion);
    newPkg.setPackageId(getNewId());
    newPkg.setVersion(newversion);
    newPkg.setMetaContent(curPkg.getMetaContent());
    List<ProcessVO> processes = new ArrayList<ProcessVO>();
    newPkg.setProcesses(processes);
    if (curPkg.getProcesses() != null) {
        for (ProcessVO p : curPkg.getProcesses()) {
            processes.add(p);
        }
    }
    if (curPkg.getImplementors() != null) {
        List<ActivityImplementorVO> impls = new ArrayList<ActivityImplementorVO>();
        newPkg.setImplementors(impls);
        for (ActivityImplementorVO a : curPkg.getImplementors()) {
            impls.add(a);
        }
    }
    if (curPkg.getExternalEvents() != null) {
        List<ExternalEventVO> handlers = new ArrayList<ExternalEventVO>();
        newPkg.setExternalEvents(handlers);
        for (ExternalEventVO a : curPkg.getExternalEvents()) {
            handlers.add(a);
        }
    }
    if (curPkg.getParticipants() != null) {
        List<LaneVO> participants = new ArrayList<LaneVO>();
        newPkg.setParticipants(participants);
        for (LaneVO a : curPkg.getParticipants()) {
            participants.add(a);
        }
    }
    if (curPkg.getRuleSets() != null) {
        List<RuleSetVO> rulesets = new ArrayList<RuleSetVO>();
        newPkg.setRuleSets(rulesets);
        for (RuleSetVO a : curPkg.getRuleSets()) {
            rulesets.add(a);
        }
    }
    if (curPkg.getAttributes() != null) {
        List<AttributeVO> attrs = new ArrayList<AttributeVO>();
        newPkg.setAttributes(attrs);
        for (AttributeVO a : curPkg.getAttributes()) {
            attrs.add(a);
        }
    }
    addPackage(newPkg);
    return newPkg;
}
Also used : PackageVO(com.centurylink.mdw.model.value.process.PackageVO) AttributeVO(com.centurylink.mdw.model.value.attribute.AttributeVO) CustomAttributeVO(com.centurylink.mdw.model.value.attribute.CustomAttributeVO) ExternalEventVO(com.centurylink.mdw.model.value.event.ExternalEventVO) ArrayList(java.util.ArrayList) RuleSetVO(com.centurylink.mdw.model.value.attribute.RuleSetVO) ActivityImplementorVO(com.centurylink.mdw.model.value.activity.ActivityImplementorVO) ProcessVO(com.centurylink.mdw.model.value.process.ProcessVO) LaneVO(com.centurylink.mdw.model.value.process.LaneVO)

Aggregations

ActivityImplementorVO (com.centurylink.mdw.model.value.activity.ActivityImplementorVO)1 AttributeVO (com.centurylink.mdw.model.value.attribute.AttributeVO)1 CustomAttributeVO (com.centurylink.mdw.model.value.attribute.CustomAttributeVO)1 RuleSetVO (com.centurylink.mdw.model.value.attribute.RuleSetVO)1 ExternalEventVO (com.centurylink.mdw.model.value.event.ExternalEventVO)1 LaneVO (com.centurylink.mdw.model.value.process.LaneVO)1 PackageVO (com.centurylink.mdw.model.value.process.PackageVO)1 ProcessVO (com.centurylink.mdw.model.value.process.ProcessVO)1 ArrayList (java.util.ArrayList)1