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