Skip to content

Commit

Permalink
updating essence factory
Browse files Browse the repository at this point in the history
updating essence factory
  • Loading branch information
danimaniarqsoft committed May 15, 2017
1 parent 1274579 commit 5b2746e
Show file tree
Hide file tree
Showing 4 changed files with 208 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
/*
*
* The MIT License (MIT)
* Copyright (c) 2016 Daniel Cortes Pichardo
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

package mx.infotec.dads.essence.exception;

/**
* Runtime Exception for the Essence Meta-Model
*
* @author Daniel Cortes Pichardo
*
*/
public class EssenceCoreException extends RuntimeException {

private static final long serialVersionUID = 1L;

/**
* Constructs a new LanguageElementException runtime exception with
* {@code null} as its detail message. The cause is not initialized, and may
* subsequently be initialized by a call to {@link #initCause}.
*/
public EssenceCoreException() {
super();
}

/**
* Constructs a new LanguageElementException runtime exception with the
* specified detail message. The cause is not initialized, and may
* subsequently be initialized by a call to {@link #initCause}.
*
* @param message
* the detail message. The detail message is saved for later
* retrieval by the {@link #getMessage()} method.
*/
public EssenceCoreException(String message) {
super(message);
}

/**
* Constructs a new LanguageElementException runtime exception with the
* specified detail message and cause.
*
* @param message
* the detail message (which is saved for later retrieval by the
* {@link #getMessage()} method).
* @param cause
* the cause (which is saved for later retrieval by the
* {@link #getCause()} method). (A <tt>null</tt> value is
* permitted, and indicates that the cause is nonexistent or
* unknown.)
*
*/
public EssenceCoreException(String message, Throwable cause) {
super(message, cause);
}

/**
* Constructs a new LanguageElementException runtime exception with the
* specified cause and a detail message of
* <tt>(cause==null ? null : cause.toString())</tt> (which typically
* contains the class and detail message of <tt>cause</tt>). This
* constructor is useful for runtime exceptions that are little more than
* wrappers for other throwables.
*
* @param cause
* the cause (which is saved for later retrieval by the
* {@link #getCause()} method). (A <tt>null</tt> value is
* permitted, and indicates that the cause is nonexistent or
* unknown.)
*
*/
public EssenceCoreException(Throwable cause) {
super(cause);
}

}
35 changes: 35 additions & 0 deletions src/main/java/mx/infotec/dads/essence/repository/KernelEnum.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
*
* The MIT License (MIT)
* Copyright (c) 2016 Daniel Cortes Pichardo
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package mx.infotec.dads.essence.repository;

/**
* Kernel Enum, for the Essence Core
*
* @author Daniel Cortes Pichardo
* @since essence 1.1
* @version 1.1
*/
public enum KernelEnum {
KERNEL, METHOD, PRACTICE, ALPHA, COMPETENCY, COMPETENCYLEVEL, ACTION, ACTIVITY, ACTIVITYASSOCIATION, ACTIVITYSPACE, COMPLETIONCRITERION, ENTRYCRITERION, ALPHAASSOCIATION, ALPHACONTAINMENT, LEVELOFDETAIL, STATE, WORKPRODUCT, WORKPRODUCTMANIFEST, CHECKPOINT, ENDEAVORPROPERTY, EXTENSIONELEMENT, LIBRARY, MERGERESOLUTION, PATTERN, PATTERNASSOCIATION, PRACTICEASSET, RESOURCE, TAG, TYPEDPATTERN, TYPEDRESOURCE, TYPEDTAG, USERDEFINEDTYPE, FEATURESELECTION, VIEWSELECTION
}
76 changes: 76 additions & 0 deletions src/main/java/mx/infotec/dads/essence/util/EssenceFactory.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/*
*
* The MIT License (MIT)
* Copyright (c) 2016 Daniel Cortes Pichardo
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package mx.infotec.dads.essence.util;

import java.util.ArrayList;

import mx.infotec.dads.essence.model.foundation.SEPractice;

/**
*
* @author Daniel Cortes Pichardo
* @since essence 1.1
* @version 1.1
*/
public class EssenceFactory {

private EssenceFactory() {

}

/**
* Create a DefaultPractice
*
* @return SEPractice
*/
public static SEPractice createDefaultPractice() {
SEPractice practice = new SEPractice();
// Practice
practice.setConsistencyRules("");
practice.setEntry(new ArrayList<>());
practice.setMeasures(new ArrayList<>());
practice.setObjective("");
practice.setResult(new ArrayList<>());
// ElementGroup
practice.setBriefDescription("");
practice.setDescription("");
practice.setIcon(null);
practice.setMergeResolution(null);
practice.setName("");
practice.setOwnedElements(new ArrayList<>());
practice.setReferredElements(new ArrayList<>());
// Inheritance
practice.setExtension(new ArrayList<>());
practice.setFeatureSelection(new ArrayList<>());
practice.setOwner(null);
practice.setPatternAssociation(new ArrayList<>());
practice.setProperties(new ArrayList<>());
practice.setReferrer(new ArrayList<>());
practice.setResource(new ArrayList<>());
practice.setSuppressable(false);
practice.setTag(new ArrayList<>());
practice.setViewSelection(new ArrayList<>());
return practice;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void insertPractice() throws Exception {
SEPractice practice = new SEPractice();
// Practice
practice.setConsistencyRules("Consistency Rules");
practice.setEntry(Arrays.asList("Requeriments:Alpha", "Software:Architecture"));
practice.setEntry(Arrays.asList("Requeriments:State", "Software:Architecture"));
practice.setMeasures(Arrays.asList("Timing", "five minutes pear meeting"));
practice.setObjective("The Objetive of the practice");
practice.setResult(Arrays.asList("Requeriments:Alpha", "Software:Architecture"));
Expand Down

0 comments on commit 5b2746e

Please sign in to comment.