| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
package org.kuali.rice.krms.impl.repository |
| 17 | |
|
| 18 | |
import org.kuali.rice.core.api.mo.common.active.MutableInactivatable |
| 19 | |
import org.kuali.rice.krad.bo.PersistableBusinessObjectBase |
| 20 | |
import org.kuali.rice.krms.api.repository.function.FunctionDefinition |
| 21 | |
import org.kuali.rice.krms.api.repository.function.FunctionDefinitionContract |
| 22 | |
|
| 23 | |
public class FunctionBo extends PersistableBusinessObjectBase implements MutableInactivatable, FunctionDefinitionContract { |
| 24 | |
|
| 25 | |
def String id |
| 26 | |
def String namespace |
| 27 | |
def String name |
| 28 | |
def String description |
| 29 | |
def String returnType |
| 30 | |
def String typeId |
| 31 | |
def boolean active |
| 32 | |
|
| 33 | |
def List<FunctionParameterBo> parameters |
| 34 | |
def List<CategoryBo> categories |
| 35 | |
|
| 36 | |
|
| 37 | |
|
| 38 | |
|
| 39 | |
|
| 40 | |
|
| 41 | |
static FunctionDefinition to(FunctionBo bo) { |
| 42 | 0 | if (bo == null) { return null } |
| 43 | 0 | return org.kuali.rice.krms.api.repository.function.FunctionDefinition.Builder.create(bo).build() |
| 44 | |
} |
| 45 | |
|
| 46 | |
|
| 47 | |
|
| 48 | |
|
| 49 | |
|
| 50 | |
|
| 51 | |
static FunctionBo from(FunctionDefinition im) { |
| 52 | 0 | if (im == null) { return null } |
| 53 | |
|
| 54 | 0 | FunctionBo bo = new FunctionBo() |
| 55 | 0 | bo.id = im.id |
| 56 | 0 | bo.namespace = im.namespace |
| 57 | 0 | bo.name = im.name |
| 58 | 0 | bo.description = im.description |
| 59 | 0 | bo.returnType = im.returnType |
| 60 | 0 | bo.typeId = im.typeId |
| 61 | 0 | bo.active = im.active |
| 62 | 0 | bo.versionNumber = im.versionNumber |
| 63 | 0 | bo.parameters = new ArrayList<FunctionParameterBo>() |
| 64 | 0 | for (parm in im.parameters){ |
| 65 | 0 | bo.parameters.add( FunctionParameterBo.from(parm) ) |
| 66 | |
} |
| 67 | 0 | bo.categories = new ArrayList<CategoryBo>() |
| 68 | 0 | for (category in im.categories) { |
| 69 | 0 | bo.categories.add(CategoryBo.from(category)) |
| 70 | |
} |
| 71 | 0 | bo.versionNumber = im.versionNumber |
| 72 | 0 | return bo |
| 73 | |
} |
| 74 | |
|
| 75 | |
|
| 76 | |
} |