(Quick Reference)

2 Configuration and installation - Reference Documentation

Authors: Stephan Albers, July Antonicheva

Version: 1.7-SNAPSHOT

2 Configuration and installation

Add the plugin as a dependency to your application by directly editing your BuildConfig.groovy to look like this:

…
    plugins {
        …
        compile ':grailsflow:1.6'
    }

Grailsflow plugin needs to be configured

There is a list of Spring beans that can/should be configured in your application, if it uses the Grailsflow plugin.

The following configuration (common beans) are already configured in GrailsflowGrailsPlugin.groovy and have default values. You can change the default configuration by specifying new beans values in any Spring configuration file.

  1. Common beans:

Also, it is possible to define some extra beans, like 'additionalWorklistColumns' and 'processLogDir'. They don't have a default configuration, but can be easily defined in the Spring configuration of the application, like:

<!-- Necessary for uploading files. -->
    bean (org.springframework.web.multipart.commons.CommonsMultipartResolver) {
        maxUploadSize(1000000)
    }

<!-- Default workarea configuration. The class should implement com.jcatalog.grailsflow.workarea.WorkareaPathProvider --> workareaPathProvider(com.jcatalog.grailsflow.workarea.GrailsflowPathProvider) { resourcesPath = "workarea" resourcesUrl = "/workarea" }

< !-- Path (folder) for process scripts. The path is relative to workarea resources path --> processesPath(java.lang.String, "processes")

<!-- Path (folder) for actions scripts. The path is relative to workarea resources path --> actionsPath(java.lang.String, "actions")

< !-- Root path (folder) for stored documents. The path is relative to workarea resources path --> documentsPath(java.lang.String, "documents")

< !-- Root path (folder) for callback scripts. The path is relative to workarea resources path --> callbacksPath(java.lang.String, "callbacks")

< !-- Default scripts configuration. The class should implement com.jcatalog.grailsflow.workarea.ScriptsProvider --> scriptsProvider(com.jcatalog.grailsflow.workarea.GrailsflowWorkareaScriptsProvider) { workareaPathProvider = ref('workareaPathProvider') } < !-- Default configuration for threads quantity (threads that can be running concurrently) --> maxThreadsQuantity(java.lang.Integer, "10")

< !-- Default configuration for quantity of restricted processes that used in SQL 'in' clause --> maxRestrictedProcesses(java.lang.Integer, "2000")

< !-- Default value for external application ID. It's an Application ID or name of external application: especially important if there are several applications which share the DB but have Grailsflow plugin installed in both of them. In this case Grailsflow Engine needs to know with which application it currently works. Can have an empty value! --> appExternalID(java.lang.String, "grailsflow")

< !-- Default format patterns --> datePatterns(java.util.HashMap, ['en':'MM/dd/yyyy', 'de':'dd.MM.yyyy']) dateTimePatterns(java.util.HashMap, ['en':'MM/dd/yy HH:mm', 'de':'dd.MM.yy HH:mm']) numberPatterns(java.util.HashMap, ['en':'0.00', 'de':'0.00']) decimalSeparators(java.util.HashMap, ['en':'.', 'de':','])

< !-- bean allows worklist filtering. NOTE: if set to TRUE - it can cause problems with performance in case of large amount of items. --> isWorklistFilterAvailable(java.lang.Boolean, Boolean.TRUE)

Also, it is possible to define some extra beans, like 'additionalWorklistColumns' and 'processLogDir'. They haven't default configuration, but can be easily defined in Spring configuration of application, like:

< !-- here you can specify additional columns in worklist, also these properties will
       be available in worklist filtering -->  
     <bean id="additionalWorklistColumns" class="java.util.ArrayList">
        <constructor-arg>
          <list>
            <value>productId</value>
            <value>name</value>
            <value>requesterName</value>
          </list>
        </constructor-arg>
    </bean>

< !-- define path for processes logs --> <bean id="processLogDir" class="java.lang.String"> <constructor-arg value="logs/process/"/> </bean>'

< !-- process post killer handler, should implement class com.jcatalog.grailsflow.process.PostKillProcessHandler --> <bean id="postKillProcessHandler" class="com.myapp.process.MyKillProcessHandler"/>

2. Security configuration:

< !-- Default configuration for securityHelper, should implement com.jcatalog.grailsflow.security.SecurityHelper -->  
    securityHelper(com.jcatalog.grailsflow.security.GrailsflowSecurityHelper)

< !-- Default configuration for securityHelper, should implement com.jcatalog.grailsflow.security.UsersProvider --> usersProvider(com.jcatalog.grailsflow.security.GrailsflowUsersProvider)

< !-- Default configuration for securityHelper, should implement com.jcatalog.grailsflow.security.RolesProvider --> rolesProvider(com.jcatalog.grailsflow.security.GrailsflowRolesProvider)

< !-- Default configuration for securityHelper, should implement com.jcatalog.grailsflow.security.GroupsProvider --> groupsProvider(com.jcatalog.grailsflow.security.GrailsflowGroupsProvider)

3. Grailsflow engine configuration

< !-- Configures actionFactory, should implement com.jcatalog.grailsflow.actions.ActionFactory class --> 
    actionFactory(com.jcatalog.grailsflow.actions.GrailsflowActionFactory) {
        actionsPath = ref('actionsPath')
        scriptsProvider = ref('scriptsProvider')
    }
     < !-- Default settings for worklistProvider -->
    worklistProvider(com.jcatalog.grailsflow.worklist.WorklistProvider) {
        appExternalID = ref('appExternalID')
    }
     < !-- Default settings for processProvider -->
    processProvider(com.jcatalog.grailsflow.process.ProcessProvider) {
        appExternalID = ref('appExternalID')
    }

< !-- Default settings for processScriptProvider, should implement class com.jcatalog.grailsflow.process.script.ProcessScriptProvider --> processScriptProvider(com.jcatalog.grailsflow.process.script.GrailsflowProcessScriptProvider) { scriptsProvider = ref('scriptsProvider') processesPath = ref('processesPath') }

< !-- Default settings for cacheManager, should implement class com.jcatalog.grailsflow.cache.CacheManager --> cacheManager(com.jcatalog.grailsflow.cache.SimpleCacheManager)

< !-- Default settings for processFactory, should implement class com.jcatalog.grailsflow.engine.ProcessFactory --> processFactory(com.jcatalog.grailsflow.engine.GrailsflowCachingProcessFactory) { processScriptProvider = ref('processScriptProvider') cacheManager = ref('cacheManager') }

< !-- Default settings for nodeExecutor bean --> nodeExecutor(com.jcatalog.grailsflow.engine.execution.NodeExecutor) { actionFactory = ref('actionFactory') }

4. Validation beans:

< !-- Default settings for process definition validation bean, should implement class    com.jcatalog.grailsflow.validation.Validator -->
    processDefValidator(com.jcatalog.grailsflow.validation.DefaultProcessDefValidator)

< !-- Default settings for process class validation bean, should implement class com.jcatalog.grailsflow.validation.Validator --> processClassValidator(com.jcatalog.grailsflow.validation.DefaultProcessClassValidator)

5. Client executor bean:

<!-- Configuration for client Executor, the implementation class should extend
      ClientExecutor class. Especially important if you want to use external calls and
      asynchronous actions in your application. -->
    clientExecutor(com.jcatalog.grailsflow.client.GrailsflowHTTPClientExecutor)

6. Extention beans:

<!-- Configuration for eventEmailProcessor, should implement
      com.jcatalog.grailsflow.extension.email.EventEmailProcessor interface. -->
    eventEmailProcessor(com.jcatalog.grailsflow.extension.email.GrailsflowEventEmailProcessor) {
        processManagerService = ref('processManagerService')
    }
Extended UI configuration with templates and configurable search parameters:
<!-- default settings for processListColumns UI -->
    processTypeSearchProperty(DefaultSearchParameter) {
        name = "type"
        searchTemplate = "/processList/search/type"
    }
    processStatusSearchProperty(DefaultSearchParameter) {
        name = "status"
        searchTemplate = "/processList/search/status"
    }
    startedFromSearchProperty(DateSearchParameter) {
        name = "startedFrom"
        searchTemplate = "/processList/search/date"
    }
    userSearchProperty(DefaultSearchParameter) {
        name = "startUser"
    }
    finishedFromSearchProperty(DateSearchParameter) {
        name = "finishedFrom"
        searchTemplate = "/processList/search/date"
    }
    processListSearchParameters(ListFactoryBean) {
        items = [ ref('processTypeSearchProperty'),
                  ref('processStatusSearchProperty'),
                  ref('startedFromSearchProperty'), ref('userSearchProperty'),
                  ref('finishedFromSearchProperty')
        ]
    }

processTypeDisplayProperty(DefaultDisplayParameter) { name = "type" displayTemplate = "/processList/display/type" } processStatusDisplayProperty(DefaultDisplayParameter) { name = "status.statusID" displayProperty = "status" displayTemplate = "/processList/display/status" } createdOnDisplayProperty(DefaultDisplayParameter) { name = "createdOn" displayProperty = "createdOn" displayTemplate = "/processList/display/dateTime" } createdByDisplayProperty(DefaultDisplayParameter) { name = "createdBy" displayProperty = "createdBy" } activeNodesDisplayProperty(DefaultDisplayParameter) { name = "activeNodes" sortable = false displayTemplate = "/processList/display/activeNodes" } finishedOnDisplayProperty(DefaultDisplayParameter) { name = "finishedOn" displayProperty = "finishedOn" displayTemplate = "/processList/display/dateTime" } processListDisplayParameters(ListFactoryBean) { items = [ ref('processTypeDisplayProperty'), ref('processStatusDisplayProperty'), ref('createdOnDisplayProperty'), ref('createdByDisplayProperty'), ref("activeNodesDisplayProperty"), ref('finishedOnDisplayProperty') ] }

nodeWorklistColumn(DefaultDisplayParameter) { name = "nodeID" displayTemplate = "/worklist/display/node" } externalURLWorklistColumn(DefaultDisplayParameter) { name = "externalUrl" sortable = false displayTemplate = "/worklist/display/externalUrl" } ...

(The full list of available beans can be found in the GrailsflowGrailsPlugin.groovy file)