Skip to content
This repository has been archived by the owner on Aug 15, 2023. It is now read-only.

Purge Workflows Job

CRdouglas edited this page Jul 20, 2019 · 3 revisions

Description

This action deals with deleting active and historical workflows. O.O.B this action is configured for Activiti databases and the Quartz Scheduler. When configuring this action, use the following files to edit how the action queries for workflows and deletes them.


Job Definition (core-job-bean-config.xml)

    <bean id="PurgeWorkflowsJob" class="com.tsgrp.opencontent.core.job.OpenContentQuartzJobImpl">
        <property name="actionParameters" ref="PurgeWorkflowsParams" /> 
        <property name="actionExecuter" ref="action-purgeWorkflows" />
    </bean>

Modification

The only modifications that should occur in this file are if the user decides to configure this action with a different scheduler or parameter reference is renamed to be project specific.


Parameter Organization (core-job-parameter-config.xml)

<bean id="PurgeWorkflowsParams" class="java.util.HashMap">
    <constructor-arg index="0" type="java.util.Map">
    <map>
        <entry key="configuredWorkflows">
            <map> 
                <entry key="hpiNotificationWorkflow">
		   <map>
		      <entry key="historicalStatus">
			  <map>
			     <entry key="queryParams">
				<map>
				   </map>
			     </entry>
			     <entry key="dateParams">
				 <map>
				    <entry key="filterAfterDays" value="${oc.jobs.purgeworkflows.notificationWorkflow.historical.filterAfterDays}"/> 
				 </map>
			      </entry>
			      <entry key="forcePurge" value="${oc.jobs.purgeworkflows.historical.forcePurge}"/>
			   </map>
                        </entry>
		      </map>
	            </entry>
		  </map>
              </entry>

Parameter Definition

PurgeWorkflowsParams – defines the action

ConfiguredWorkflows – defines the workflows that have been configured to run on the scheduler

hpiNotificationWorkflow – the workflow type with a map of property values that define the action executer

historicalStatus – Defines what status of the workflow, whether it’s ‘historicalStatus’ or ‘activeStatus’

queryParams – Where to define the parameters to query for specific workflows

dateParams – Filter after the specific days, the parameter is defined in a properties file. (core-job-defaults.properties)

Explanation:

The scheduler will create a schedule for running the jobs and the parameters set in the config will define the workflows to be purged. The configured queryparams, example below:

<entry key="queryParams">
   <map>
    </map>
</entry>

Example within the map:

<event key=”bpm_propertyDefinition” value=”propertyValue”> </event>

These properties will define further search parameters past the date values predefined:

<entry key="dateParams">
   <map>
      <entry key="filterAfterDays" value="${oc.jobs.purgeworkflows.notificationWorkflow.historical.filterAfterDays}"/> 
   </map>
</entry>

Outside of these parameters there are a few more that need to be defined. In core-job-defaults.properties there are more properties that need to be defined.

oc.jobs.purgeworkflows.toAddress=

oc.jobs.purgeworkflows.fromAddress=smtprelay@tsgrp.com

These properties that will define the to address and the from addresses for the emails send out by the job workflow.


Clone this wiki locally