All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.cristalise.dsl.scaffold.item_groovy.tmpl Maven / Gradle / Ivy

Go to download

CRISTAL-iSE Domain Specific Language module for bootstrapping and funtional testing

There is a newer version: 6.0.0
Show newest version
import static org.cristalise.kernel.collection.BuiltInCollections.AGGREGATE_SCRIPT
import static org.cristalise.kernel.collection.BuiltInCollections.MASTER_SCHEMA
import static org.cristalise.kernel.collection.BuiltInCollections.SCHEMA_INITIALISE
import static org.cristalise.kernel.collection.BuiltInCollections.SCHEMA_INITIALISE

/**
 * @{item} Item
 */
def @{item} = Schema('@{item}', 0) {
    struct(name:' @{item}', documentation: '@{item} aggregated data') {
        field(name: 'Name',        type: 'string')
        field(name: 'State',       type: 'string', values: states)
        field(name: 'Description', type: 'string')
    }
}

def @{item}Details = Schema('@{item}_Details', 0) {
    struct(name: '@{item}_Details') {
@if{generatedName}
        field(name: 'Name', type: 'string') { dynamicForms (disabled: true, label: 'ID') }
@else{}
        field(name: 'Name', type: 'string')
@end{}
        field(name: 'Description', type: 'string')
    }
}

def @{item}UpdateAct = Activity('@{item}_Update', 0) {
    Property('OutcomeInit': 'Empty')
    Schema(@{item}Details)
    //Script('Entity_ChangeName', 0)
}

def @{item}AggregateScript = Script('@{item}_Aggregate', 0) {
    input('item', 'org.cristalise.kernel.entity.proxy.ItemProxy')
    output('@{item}XML', 'java.lang.String')
    script('groovy', moduleDir+'/script/@{item}_Aggregate.groovy')
}

def @{item}QueryListScript = Script('@{item}_QueryList', 0) {
    input('item', 'org.cristalise.kernel.entity.proxy.ItemProxy')
    output('@{item}Map', 'java.util.Map')
    script('groovy', moduleDir+'/script/@{item}_QueryList.groovy')
}

Activity('@{item}_Aggregate', 0) {
    Property('OutcomeInit': 'Empty')
    Property('Agent Role': 'UserCode')

    Schema(@{item})
    Script(@{item}AggregateScript)
}

def @{item}Wf = Workflow('@{item}_Workflow', 0) {
    ElemActDef(@{item}UpdateAct)
    CompActDef('State_Manage', 0)
}

def @{item}PropDesc = PropertyDescriptionList('@{item}', 0) {
    PropertyDesc(name: 'Name',  isMutable: true,  isClassIdentifier: false)
    PropertyDesc(name: 'Type',  isMutable: false, isClassIdentifier: true,  defaultValue: '@{item}')
    PropertyDesc(name: 'State', isMutable: true,  isClassIdentifier: false, defaultValue: 'ACTIVE')
}

Item(name: '@{item}Factory', folder: '/@{moduleNs}', workflow: 'Factory_Workflow', workflowVer: 0) {
    InmutableProperty('Type': 'Factory')
    InmutableProperty('Root': '@{moduleNs}/@{item}s')
@if{generatedName}
    InmutableProperty('IDPrefix': '@{idPrefix}')
    Property('LeftPadSize': '@{leftPadSize}')
@end{}

@if{isAgent}
    InmutableProperty('CreateAgent': 'true')
    Property('DefaultRoles': 'Admin')
@end{}

@if{useConstructor}
    Dependency(SCHEMA_INITIALISE) {
        Member(itemPath: '/desc/Schema/@{moduleNs}/@{item}_Details') {
            Property('Version': 0)
        }
    }
@else{}
    InmutableProperty('UpdateSchema': '@{item}_Details:0')
@end{}

    Outcome(schema: 'PropertyDescription', version: '0', viewname: 'last', path: 'boot/property/@{item}.xml')

    Dependency('workflow') {
        Member(itemPath: '/desc/ActivityDesc/@{moduleNs}/@{item}_Workflow') {
            Property('Version': 0)
        }
    }

    Dependency(MASTER_SCHEMA) {
        Member(itemPath: '/desc/Schema/@{moduleNs}/@{item}') {
            Property('Version': 0)
        }
    }

    Dependency(AGGREGATE_SCRIPT) {
        Member(itemPath: '/desc/Script/@{moduleNs}/@{item}_Aggregate') {
            Property('Version': 0)
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy