Commit 1dffa8ed by nilu

S51619299 # Client - Incoming Issues #Messaging & Workflow Changes

parent 86c0ff1e
......@@ -16,6 +16,7 @@
<column name="prefer_remote" type="Boolean" nullable="true"/>
<column name="happy_to_relocate" type="Boolean" nullable="true"/>
<column name="is_email_ingest" type="Boolean" nullable="true"/>
<column name="applicant_source" type="String" nullable="true" length="200"/>
<column name="candidate_id" type="Long" length="11" nullable="false"/>
<column name="job_id" type="Long" length="11" nullable="false"/>
<column name="work_flow_stage_id" type="Long" length="11" nullable="true"/>
......
......@@ -18,7 +18,7 @@
<column name="business_hours_only" type="Boolean" nullable="true"/>
<column name="message_content" type="CLOB" nullable="false"/>
<column name="template_type" type="String" nullable="false" length="200"/>
<column name="is_global_template" type="Boolean" nullable="true"/>
<column name="related_to_job" type="Boolean" nullable="true"/>
<column name="is_system_generated" type="Boolean" nullable="true"/>
<column name="hiring_team_id" type="Long" length="11" nullable="true"/>
</NODE>
......
......@@ -12,6 +12,7 @@
<column name="variance" type="CLOB" nullable="true"/>
<column name="business_hours_only" type="Boolean" nullable="true"/>
<column name="is_withdrawal_message" type="Boolean" nullable="true"/>
<column name="applicant_sources" type="CLOB" nullable="true"/>
<column name="message_template_id" type="Long" length="11" nullable="true"/>
<column name="work_flow_stage_id" type="Long" length="11" nullable="true"/>
</NODE>
......
......@@ -12,6 +12,7 @@
<column name="use_messaging" type="Boolean" nullable="true"/>
<column name="stage_type" type="String" nullable="false" length="200"/>
<column name="sort_order" type="Long" nullable="false"/>
<column name="auto_progress" type="Boolean" nullable="true"/>
<column name="withdrawal_message_id" type="Long" length="11" nullable="true"/>
<column name="work_flow_template_id" type="Long" length="11" nullable="false"/>
</NODE>
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- @AutoRun -->
<OBJECTS name="" xmlns:oneit="http://www.1iT.com.au"><NODE name="Script" factory="Vector">
<NODE name="DDL" factory="Participant" class="oneit.sql.transfer.DefineTableOperation">
<tableName factory="String">tl_work_flow_step</tableName>
<column name="object_id" type="Long" nullable="false" length="11"/>
<column name="object_last_updated_date" type="Date" nullable="false" length="22"/>
<column name="object_created_date" type="Date" nullable="false" length="22"/>
<column name="sort_order" type="Long" nullable="false"/>
<column name="step_type" type="String" nullable="false" length="200"/>
<column name="work_flow_stage_id" type="Long" length="11" nullable="false"/>
</NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_work_flow_step" indexName="idx_tl_work_flow_step_work_flow_stage_id" isUnique="false"><column name="work_flow_stage_id"/></NODE>
</NODE></OBJECTS>
\ No newline at end of file
......@@ -20,7 +20,7 @@
<column name="thank_you_header_text" type="CLOB" nullable="true"/>
<column name="thank_you_secondary_text" type="CLOB" nullable="true"/>
<column name="job_outline_button_text" type="CLOB" nullable="true"/>
<column name="is_global_template" type="Boolean" nullable="true"/>
<column name="related_to_job" type="Boolean" nullable="true"/>
<column name="is_system_generated" type="Boolean" nullable="true"/>
<column name="withdrawal_message_id" type="Long" length="11" nullable="true"/>
<column name="hiring_team_id" type="Long" length="11" nullable="true"/>
......
......@@ -16,6 +16,7 @@ CREATE TABLE tl_job_application (
prefer_remote char(1) NULL,
happy_to_relocate char(1) NULL,
is_email_ingest char(1) NULL,
applicant_source varchar(200) NULL,
candidate_id numeric(12) NOT NULL,
job_id numeric(12) NOT NULL,
work_flow_stage_id numeric(12) NULL
......
......@@ -18,7 +18,7 @@ CREATE TABLE tl_message_template (
business_hours_only char(1) NULL,
message_content text NOT NULL,
template_type varchar(200) NOT NULL,
is_global_template char(1) NULL,
related_to_job char(1) NULL,
is_system_generated char(1) NULL,
hiring_team_id numeric(12) NULL
);
......
......@@ -12,6 +12,7 @@ CREATE TABLE tl_work_flow_message (
variance text NULL,
business_hours_only char(1) NULL,
is_withdrawal_message char(1) NULL,
applicant_sources varchar(200) NULL,
message_template_id numeric(12) NULL,
work_flow_stage_id numeric(12) NULL
);
......
......@@ -12,6 +12,7 @@ CREATE TABLE tl_work_flow_stage (
use_messaging char(1) NULL,
stage_type varchar(200) NOT NULL,
sort_order numeric(12) NOT NULL,
auto_progress char(1) NULL,
withdrawal_message_id numeric(12) NULL,
work_flow_template_id numeric(12) NOT NULL
);
......
-- DROP TABLE tl_work_flow_step;
CREATE TABLE tl_work_flow_step (
object_id int NOT NULL ,
object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
object_created_date datetime DEFAULT getdate() NOT NULL
,
sort_order numeric(12) NOT NULL,
step_type varchar(200) NOT NULL,
work_flow_stage_id numeric(12) NOT NULL
);
ALTER TABLE tl_work_flow_step ADD
CONSTRAINT PK_tl_work_flow_step PRIMARY KEY
(
object_id
) ;
CREATE INDEX idx_tl_work_flow_step_work_flow_stage_id
ON tl_work_flow_step (work_flow_stage_id);
......@@ -20,7 +20,7 @@ CREATE TABLE tl_work_flow_template (
thank_you_header_text text NULL,
thank_you_secondary_text text NULL,
job_outline_button_text text NULL,
is_global_template char(1) NULL,
related_to_job char(1) NULL,
is_system_generated char(1) NULL,
withdrawal_message_id numeric(12) NULL,
hiring_team_id numeric(12) NULL
......
......@@ -17,6 +17,7 @@ CREATE TABLE tl_job_application (
prefer_remote char(1) NULL,
happy_to_relocate char(1) NULL,
is_email_ingest char(1) NULL,
applicant_source varchar2(200) NULL,
candidate_id number(12) NOT NULL,
job_id number(12) NOT NULL,
work_flow_stage_id number(12) NULL
......
......@@ -19,7 +19,7 @@ CREATE TABLE tl_message_template (
business_hours_only char(1) NULL,
message_content clob NOT NULL,
template_type varchar2(200) NOT NULL,
is_global_template char(1) NULL,
related_to_job char(1) NULL,
is_system_generated char(1) NULL,
hiring_team_id number(12) NULL
);
......
......@@ -13,6 +13,7 @@ CREATE TABLE tl_work_flow_message (
variance clob NULL,
business_hours_only char(1) NULL,
is_withdrawal_message char(1) NULL,
applicant_sources varchar2(200) NULL,
message_template_id number(12) NULL,
work_flow_stage_id number(12) NULL
);
......
......@@ -13,6 +13,7 @@ CREATE TABLE tl_work_flow_stage (
use_messaging char(1) NULL,
stage_type varchar2(200) NOT NULL,
sort_order number(12) NOT NULL,
auto_progress char(1) NULL,
withdrawal_message_id number(12) NULL,
work_flow_template_id number(12) NOT NULL
);
......
-- DROP TABLE tl_work_flow_step;
CREATE TABLE tl_work_flow_step (
object_id number(12) NOT NULL ,
object_last_updated_date date DEFAULT SYSDATE NOT NULL ,
object_created_date date DEFAULT SYSDATE NOT NULL
,
sort_order number(12) NOT NULL,
step_type varchar2(200) NOT NULL,
work_flow_stage_id number(12) NOT NULL
);
ALTER TABLE tl_work_flow_step ADD
CONSTRAINT PK_tl_work_flow_step PRIMARY KEY
(
object_id
) ;
CREATE INDEX idx_tl_work_flow_step_work_flow_stage_id
ON tl_work_flow_step (work_flow_stage_id);
......@@ -21,7 +21,7 @@ CREATE TABLE tl_work_flow_template (
thank_you_header_text clob NULL,
thank_you_secondary_text clob NULL,
job_outline_button_text clob NULL,
is_global_template char(1) NULL,
related_to_job char(1) NULL,
is_system_generated char(1) NULL,
withdrawal_message_id number(12) NULL,
hiring_team_id number(12) NULL
......
......@@ -17,6 +17,7 @@ CREATE TABLE tl_job_application (
prefer_remote char(1) NULL,
happy_to_relocate char(1) NULL,
is_email_ingest char(1) NULL,
applicant_source varchar(200) NULL,
candidate_id numeric(12) NOT NULL,
job_id numeric(12) NOT NULL,
work_flow_stage_id numeric(12) NULL
......
......@@ -19,7 +19,7 @@ CREATE TABLE tl_message_template (
business_hours_only char(1) NULL,
message_content text NOT NULL,
template_type varchar(200) NOT NULL,
is_global_template char(1) NULL,
related_to_job char(1) NULL,
is_system_generated char(1) NULL,
hiring_team_id numeric(12) NULL
);
......
......@@ -13,6 +13,7 @@ CREATE TABLE tl_work_flow_message (
variance text NULL,
business_hours_only char(1) NULL,
is_withdrawal_message char(1) NULL,
applicant_sources varchar(200) NULL,
message_template_id numeric(12) NULL,
work_flow_stage_id numeric(12) NULL
);
......
......@@ -13,6 +13,7 @@ CREATE TABLE tl_work_flow_stage (
use_messaging char(1) NULL,
stage_type varchar(200) NOT NULL,
sort_order numeric(12) NOT NULL,
auto_progress char(1) NULL,
withdrawal_message_id numeric(12) NULL,
work_flow_template_id numeric(12) NOT NULL
);
......
-- @AutoRun
-- drop table tl_work_flow_step;
CREATE TABLE tl_work_flow_step (
object_id numeric(12) NOT NULL ,
object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
object_created_date timestamp DEFAULT NOW() NOT NULL
,
sort_order numeric(12) NOT NULL,
step_type varchar(200) NOT NULL,
work_flow_stage_id numeric(12) NOT NULL
);
ALTER TABLE tl_work_flow_step ADD
CONSTRAINT pk_tl_work_flow_step PRIMARY KEY
(
object_id
) ;
CREATE INDEX idx_tl_work_flow_step_work_flow_stage_id
ON tl_work_flow_step (work_flow_stage_id);
......@@ -21,7 +21,7 @@ CREATE TABLE tl_work_flow_template (
thank_you_header_text text NULL,
thank_you_secondary_text text NULL,
job_outline_button_text text NULL,
is_global_template char(1) NULL,
related_to_job char(1) NULL,
is_system_generated char(1) NULL,
withdrawal_message_id numeric(12) NULL,
hiring_team_id numeric(12) NULL
......
......@@ -28,15 +28,15 @@ public class BulkUpdateFP extends SaveFP
LogMgr.log(JobApplication.LOG, LogLevel.PROCESSING1,"In BulkUpdateFP selected application count : ", applications != null ? applications.size() : 0 , " of job ", job);
if(job.getAppWorkFlowStage()!= null && job.getAppWorkFlowStage().getStageType()== StageType.SUCCESSFUL
&& job.getNoOfCandidatesApplied() > job.getMaxShortlistApplicants() && applications != null)
{
Filter<JobApplication> filter = JobApplication.SearchByStageType().byStageTypesIn(CollectionUtils.createSet(StageType.INTERVIEW));
Collection alreadyShortlisted = CollectionFilter.filter(applications, filter);
int totalShortlisted = applications.size() - alreadyShortlisted.size() + job.getNoOfCandidatesFor(job.getWorkFlowByStageType(StageType.SUCCESSFUL));
BusinessObjectParser.assertFieldCondition(totalShortlisted <= job.getMaxShortlistApplicants() , job , Job.MULTIPLEREFERENCE_JobApplications, "exceedMaxShortlisted");
}
// if(job.getAppWorkFlowStage()!= null && job.getAppWorkFlowStage().getStageType()== StageType.SUCCESSFUL
// && job.getNoOfCandidatesApplied() > job.getMaxShortlistApplicants() && applications != null)
// {
// Filter<JobApplication> filter = JobApplication.SearchByStageType().byStageTypesIn(CollectionUtils.createSet(StageType.INTERVIEW));
// Collection alreadyShortlisted = CollectionFilter.filter(applications, filter);
// int totalShortlisted = applications.size() - alreadyShortlisted.size() + job.getNoOfCandidatesFor(job.getWorkFlowByStageType(StageType.SUCCESSFUL));
//
// BusinessObjectParser.assertFieldCondition(totalShortlisted <= job.getMaxShortlistApplicants() , job , Job.MULTIPLEREFERENCE_JobApplications, "exceedMaxShortlisted");
// }
if(job.getAppWorkFlowStage() != null)
{
......
......@@ -28,7 +28,7 @@ public class AssessmentCriteriaTemplate extends BaseAssessmentCriteriaTemplate
public List<WorkFlowStage> getSortedMiddleWorkFlowStages()
{
Filter<WorkFlowStage> filter = WorkFlowStage.SearchByAll().andStageType(new NotInFilter<>(StageType.POST_INGEST, StageType.INCOMPLETE, StageType.UNSUITABLE, StageType.WITHDREW));
Filter<WorkFlowStage> filter = WorkFlowStage.SearchByAll().andStageType(new NotInFilter<>(StageType.INITIAL, StageType.UNSUITABLE, StageType.WITHDREW));
return ObjstoreUtils.sort(pipesAssessmentCriteriaTemplate().toWorkFlowTemplate().toWorkFlowStages(filter).uniqueVals(),
new ObjectTransform[]{WorkFlowStage.pipesWorkFlowStage().toSortOrder()},
......
......@@ -44,6 +44,7 @@ public abstract class BaseJobApplication extends BaseBusinessClass
public static final String FIELD_PreferRemote = "PreferRemote";
public static final String FIELD_HappyToRelocate = "HappyToRelocate";
public static final String FIELD_IsEmailIngest = "IsEmailIngest";
public static final String FIELD_ApplicantSource = "ApplicantSource";
public static final String FIELD_AppProcessOption = "AppProcessOption";
public static final String FIELD_OverallRank = "OverallRank";
public static final String FIELD_RoleFit = "RoleFit";
......@@ -83,6 +84,7 @@ public abstract class BaseJobApplication extends BaseBusinessClass
private static final DefaultAttributeHelper<JobApplication> HELPER_PreferRemote = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<JobApplication> HELPER_HappyToRelocate = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<JobApplication> HELPER_IsEmailIngest = DefaultAttributeHelper.INSTANCE;
private static final EnumeratedAttributeHelper<JobApplication, ApplicantSource> HELPER_ApplicantSource = new EnumeratedAttributeHelper<JobApplication, ApplicantSource> (ApplicantSource.FACTORY_ApplicantSource);
private static final EnumeratedAttributeHelper<JobApplication, AppProcessOption> HELPER_AppProcessOption = new EnumeratedAttributeHelper<JobApplication, AppProcessOption> (AppProcessOption.FACTORY_AppProcessOption);
private static final DefaultAttributeHelper<JobApplication> HELPER_OverallRank = DefaultAttributeHelper.INSTANCE;
private static final BLOBAttributeHelper HELPER_RoleFit = BLOBAttributeHelper.INSTANCE;
......@@ -101,6 +103,7 @@ public abstract class BaseJobApplication extends BaseBusinessClass
private Boolean _PreferRemote;
private Boolean _HappyToRelocate;
private Boolean _IsEmailIngest;
private ApplicantSource _ApplicantSource;
private AppProcessOption _AppProcessOption;
private Integer _OverallRank;
private Map _RoleFit;
......@@ -143,6 +146,7 @@ public abstract class BaseJobApplication extends BaseBusinessClass
private static final AttributeValidator[] FIELD_PreferRemote_Validators;
private static final AttributeValidator[] FIELD_HappyToRelocate_Validators;
private static final AttributeValidator[] FIELD_IsEmailIngest_Validators;
private static final AttributeValidator[] FIELD_ApplicantSource_Validators;
// Arrays of AttributeDecorators for each attribute
......@@ -161,6 +165,7 @@ public abstract class BaseJobApplication extends BaseBusinessClass
private static final AttributeDecorator<JobApplication, Boolean>[] FIELD_PreferRemote_Decorators;
private static final AttributeDecorator<JobApplication, Boolean>[] FIELD_HappyToRelocate_Decorators;
private static final AttributeDecorator<JobApplication, Boolean>[] FIELD_IsEmailIngest_Decorators;
private static final AttributeDecorator<JobApplication, ApplicantSource>[] FIELD_ApplicantSource_Decorators;
// Arrays of SingleAssocDecorators for each attribute
......@@ -218,6 +223,7 @@ public abstract class BaseJobApplication extends BaseBusinessClass
FIELD_PreferRemote_Validators = (AttributeValidator[])setupAttribMetaData_PreferRemote(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_HappyToRelocate_Validators = (AttributeValidator[])setupAttribMetaData_HappyToRelocate(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_IsEmailIngest_Validators = (AttributeValidator[])setupAttribMetaData_IsEmailIngest(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_ApplicantSource_Validators = (AttributeValidator[])setupAttribMetaData_ApplicantSource(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_AppProcessOption_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_JobApplication, FIELD_AppProcessOption).toArray (new AttributeDecorator[0]);
FIELD_OverallRank_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_JobApplication, FIELD_OverallRank).toArray (new AttributeDecorator[0]);
FIELD_RoleFit_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_JobApplication, FIELD_RoleFit).toArray (new AttributeDecorator[0]);
......@@ -233,6 +239,7 @@ public abstract class BaseJobApplication extends BaseBusinessClass
FIELD_PreferRemote_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_JobApplication, FIELD_PreferRemote).toArray (new AttributeDecorator[0]);
FIELD_HappyToRelocate_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_JobApplication, FIELD_HappyToRelocate).toArray (new AttributeDecorator[0]);
FIELD_IsEmailIngest_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_JobApplication, FIELD_IsEmailIngest).toArray (new AttributeDecorator[0]);
FIELD_ApplicantSource_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_JobApplication, FIELD_ApplicantSource).toArray (new AttributeDecorator[0]);
SINGLEREFERENCE_Candidate_Decorators = (SingleAssocDecorator[])AttributeDecoratorUtils.getSingleAssocDecorators(REFERENCE_JobApplication, SINGLEREFERENCE_Candidate).toArray (new SingleAssocDecorator[0]);
SINGLEREFERENCE_Job_Decorators = (SingleAssocDecorator[])AttributeDecoratorUtils.getSingleAssocDecorators(REFERENCE_JobApplication, SINGLEREFERENCE_Job).toArray (new SingleAssocDecorator[0]);
SINGLEREFERENCE_WorkFlowStage_Decorators = (SingleAssocDecorator[])AttributeDecoratorUtils.getSingleAssocDecorators(REFERENCE_JobApplication, SINGLEREFERENCE_WorkFlowStage).toArray (new SingleAssocDecorator[0]);
......@@ -635,6 +642,26 @@ public abstract class BaseJobApplication extends BaseBusinessClass
return validators;
}
private static List setupAttribMetaData_ApplicantSource(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("attribHelper", "EnumeratedAttributeHelper");
metaInfo.put ("dbcol", "applicant_source");
metaInfo.put ("defaultValue", "ApplicantSource.APPLY_URL");
metaInfo.put ("mandatory", "false");
metaInfo.put ("name", "ApplicantSource");
metaInfo.put ("type", "ApplicantSource");
metaInfo.put (METADATA_DB_TABLENAME, "tl_job_application");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for JobApplication.ApplicantSource:", metaInfo);
ATTRIBUTES_METADATA_JobApplication.put (FIELD_ApplicantSource, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(JobApplication.class, "ApplicantSource", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for JobApplication.ApplicantSource:", validators);
return validators;
}
// END OF STATIC METADATA DEFINITION
......@@ -666,6 +693,7 @@ public abstract class BaseJobApplication extends BaseBusinessClass
_PreferRemote = (Boolean)(Boolean.FALSE);
_HappyToRelocate = (Boolean)(HELPER_HappyToRelocate.initialise (_HappyToRelocate));
_IsEmailIngest = (Boolean)(Boolean.FALSE);
_ApplicantSource = (ApplicantSource)(ApplicantSource.APPLY_URL);
_AppProcessOption = (AppProcessOption)(HELPER_AppProcessOption.initialise (_AppProcessOption));
_OverallRank = (Integer)(HELPER_OverallRank.initialise (_OverallRank));
_RoleFit = (Map)(HELPER_RoleFit.initialise (_RoleFit));
......@@ -1502,6 +1530,106 @@ public abstract class BaseJobApplication extends BaseBusinessClass
}
/**
* Attribute ApplicantSource
*/
public ApplicantSource getApplicantSource ()
{
assertValid();
ApplicantSource valToReturn = AttributeDecoratorUtils.getValue (FIELD_ApplicantSource_Decorators, (JobApplication)this, FIELD_ApplicantSource, _ApplicantSource);
for (JobApplicationBehaviourDecorator bhd : JobApplication_BehaviourDecorators)
{
valToReturn = bhd.getApplicantSource ((JobApplication)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preApplicantSourceChange (ApplicantSource newApplicantSource) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postApplicantSourceChange () throws FieldException
{
}
public FieldWriteability getWriteability_ApplicantSource ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute ApplicantSource. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setApplicantSource (ApplicantSource newApplicantSource) throws FieldException
{
newApplicantSource = AttributeDecoratorUtils.setValue (FIELD_ApplicantSource_Decorators, (JobApplication)this, FIELD_ApplicantSource, newApplicantSource);
boolean oldAndNewIdentical = HELPER_ApplicantSource.compare (_ApplicantSource, newApplicantSource);
try
{
for (JobApplicationBehaviourDecorator bhd : JobApplication_BehaviourDecorators)
{
newApplicantSource = bhd.setApplicantSource ((JobApplication)this, newApplicantSource);
oldAndNewIdentical = HELPER_ApplicantSource.compare (_ApplicantSource, newApplicantSource);
}
if (FIELD_ApplicantSource_Validators.length > 0)
{
Object newApplicantSourceObj = HELPER_ApplicantSource.toObject (newApplicantSource);
if (newApplicantSourceObj != null)
{
int loopMax = FIELD_ApplicantSource_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_JobApplication.get (FIELD_ApplicantSource);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_ApplicantSource_Validators[v].checkAttribute (this, FIELD_ApplicantSource, metadata, newApplicantSourceObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (AttributeDecoratorUtils.getWriteability (FIELD_ApplicantSource_Decorators, (JobApplication)this, FIELD_ApplicantSource ,getWriteability_ApplicantSource ()) != FieldWriteability.FALSE, "Field ApplicantSource is not writeable");
preApplicantSourceChange (newApplicantSource);
markFieldChange (FIELD_ApplicantSource);
_ApplicantSource = newApplicantSource;
postFieldChange (FIELD_ApplicantSource);
postApplicantSourceChange ();
}
}
/**
* Attribute AppProcessOption
*/
public AppProcessOption getAppProcessOption ()
......@@ -3408,6 +3536,7 @@ public abstract class BaseJobApplication extends BaseBusinessClass
tl_job_applicationPSet.setAttrib (FIELD_PreferRemote, HELPER_PreferRemote.toObject (_PreferRemote)); //
tl_job_applicationPSet.setAttrib (FIELD_HappyToRelocate, HELPER_HappyToRelocate.toObject (_HappyToRelocate)); //
tl_job_applicationPSet.setAttrib (FIELD_IsEmailIngest, HELPER_IsEmailIngest.toObject (_IsEmailIngest)); //
tl_job_applicationPSet.setAttrib (FIELD_ApplicantSource, HELPER_ApplicantSource.toObject (_ApplicantSource)); //
_Candidate.getPersistentSets (allSets);
_Job.getPersistentSets (allSets);
_WorkFlowStage.getPersistentSets (allSets);
......@@ -3432,6 +3561,7 @@ public abstract class BaseJobApplication extends BaseBusinessClass
_PreferRemote = (Boolean)(HELPER_PreferRemote.fromObject (_PreferRemote, tl_job_applicationPSet.getAttrib (FIELD_PreferRemote))); //
_HappyToRelocate = (Boolean)(HELPER_HappyToRelocate.fromObject (_HappyToRelocate, tl_job_applicationPSet.getAttrib (FIELD_HappyToRelocate))); //
_IsEmailIngest = (Boolean)(HELPER_IsEmailIngest.fromObject (_IsEmailIngest, tl_job_applicationPSet.getAttrib (FIELD_IsEmailIngest))); //
_ApplicantSource = (ApplicantSource)(HELPER_ApplicantSource.fromObject (_ApplicantSource, tl_job_applicationPSet.getAttrib (FIELD_ApplicantSource))); //
_Candidate.setFromPersistentSets (objectID, allSets);
_Job.setFromPersistentSets (objectID, allSets);
_WorkFlowStage.setFromPersistentSets (objectID, allSets);
......@@ -3519,6 +3649,15 @@ public abstract class BaseJobApplication extends BaseBusinessClass
{
e.addException (ex);
}
try
{
setApplicantSource (otherJobApplication.getApplicantSource ());
}
catch (FieldException ex)
{
e.addException (ex);
}
}
}
......@@ -3542,6 +3681,7 @@ public abstract class BaseJobApplication extends BaseBusinessClass
_PreferRemote = sourceJobApplication._PreferRemote;
_HappyToRelocate = sourceJobApplication._HappyToRelocate;
_IsEmailIngest = sourceJobApplication._IsEmailIngest;
_ApplicantSource = sourceJobApplication._ApplicantSource;
_AppProcessOption = sourceJobApplication._AppProcessOption;
_OverallRank = sourceJobApplication._OverallRank;
_RoleFit = sourceJobApplication._RoleFit;
......@@ -3621,6 +3761,7 @@ public abstract class BaseJobApplication extends BaseBusinessClass
_PreferRemote = (Boolean)(HELPER_PreferRemote.readExternal (_PreferRemote, vals.get(FIELD_PreferRemote))); //
_HappyToRelocate = (Boolean)(HELPER_HappyToRelocate.readExternal (_HappyToRelocate, vals.get(FIELD_HappyToRelocate))); //
_IsEmailIngest = (Boolean)(HELPER_IsEmailIngest.readExternal (_IsEmailIngest, vals.get(FIELD_IsEmailIngest))); //
_ApplicantSource = (ApplicantSource)(HELPER_ApplicantSource.readExternal (_ApplicantSource, vals.get(FIELD_ApplicantSource))); //
_AppProcessOption = (AppProcessOption)(HELPER_AppProcessOption.readExternal (_AppProcessOption, vals.get(FIELD_AppProcessOption))); //
_OverallRank = (Integer)(HELPER_OverallRank.readExternal (_OverallRank, vals.get(FIELD_OverallRank))); //
_RoleFit = (Map)(HELPER_RoleFit.readExternal (_RoleFit, vals.get(FIELD_RoleFit))); //
......@@ -3655,6 +3796,7 @@ public abstract class BaseJobApplication extends BaseBusinessClass
vals.put (FIELD_PreferRemote, HELPER_PreferRemote.writeExternal (_PreferRemote));
vals.put (FIELD_HappyToRelocate, HELPER_HappyToRelocate.writeExternal (_HappyToRelocate));
vals.put (FIELD_IsEmailIngest, HELPER_IsEmailIngest.writeExternal (_IsEmailIngest));
vals.put (FIELD_ApplicantSource, HELPER_ApplicantSource.writeExternal (_ApplicantSource));
vals.put (FIELD_AppProcessOption, HELPER_AppProcessOption.writeExternal (_AppProcessOption));
vals.put (FIELD_OverallRank, HELPER_OverallRank.writeExternal (_OverallRank));
vals.put (FIELD_RoleFit, HELPER_RoleFit.writeExternal (_RoleFit));
......@@ -3715,6 +3857,10 @@ public abstract class BaseJobApplication extends BaseBusinessClass
{
listener.notifyFieldChange(this, other, FIELD_IsEmailIngest, HELPER_IsEmailIngest.toObject(this._IsEmailIngest), HELPER_IsEmailIngest.toObject(otherJobApplication._IsEmailIngest));
}
if (!HELPER_ApplicantSource.compare(this._ApplicantSource, otherJobApplication._ApplicantSource))
{
listener.notifyFieldChange(this, other, FIELD_ApplicantSource, HELPER_ApplicantSource.toObject(this._ApplicantSource), HELPER_ApplicantSource.toObject(otherJobApplication._ApplicantSource));
}
// Compare single assocs
_Candidate.compare (otherJobApplication._Candidate, listener);
......@@ -3760,6 +3906,7 @@ public abstract class BaseJobApplication extends BaseBusinessClass
visitor.visitField(this, FIELD_PreferRemote, HELPER_PreferRemote.toObject(getPreferRemote()));
visitor.visitField(this, FIELD_HappyToRelocate, HELPER_HappyToRelocate.toObject(getHappyToRelocate()));
visitor.visitField(this, FIELD_IsEmailIngest, HELPER_IsEmailIngest.toObject(getIsEmailIngest()));
visitor.visitField(this, FIELD_ApplicantSource, HELPER_ApplicantSource.toObject(getApplicantSource()));
visitor.visitAssociation (_Candidate);
visitor.visitAssociation (_Job);
visitor.visitAssociation (_WorkFlowStage);
......@@ -3865,6 +4012,10 @@ public abstract class BaseJobApplication extends BaseBusinessClass
{
return filter.matches (getIsEmailIngest ());
}
else if (attribName.equals (FIELD_ApplicantSource))
{
return filter.matches (getApplicantSource ());
}
else if (attribName.equals (SINGLEREFERENCE_Candidate))
{
return filter.matches (getCandidate ());
......@@ -3955,6 +4106,12 @@ public abstract class BaseJobApplication extends BaseBusinessClass
return this;
}
public SearchAll andApplicantSource (QueryFilter<ApplicantSource> filter)
{
filter.addFilter (context, "tl_job_application.applicant_source", "ApplicantSource");
return this;
}
public SearchAll andCandidate (QueryFilter<Candidate> filter)
{
filter.addFilter (context, "tl_job_application.candidate_id", "Candidate");
......@@ -4082,6 +4239,12 @@ public abstract class BaseJobApplication extends BaseBusinessClass
return this;
}
public SearchCandidateJob andApplicantSource (QueryFilter<ApplicantSource> filter)
{
filter.addFilter (context, "tl_job_application.applicant_source", "ApplicantSource");
return this;
}
public SearchCandidateJob andCandidate (QueryFilter<Candidate> filter)
{
filter.addFilter (context, "tl_job_application.candidate_id", "Candidate");
......@@ -4225,6 +4388,12 @@ public abstract class BaseJobApplication extends BaseBusinessClass
return this;
}
public SearchDetails andApplicantSource (QueryFilter<ApplicantSource> filter)
{
filter.addFilter (context, "tl_job_application.applicant_source", "ApplicantSource");
return this;
}
public SearchDetails andCandidate (QueryFilter<Candidate> filter)
{
filter.addFilter (context, "tl_job_application.candidate_id", "Candidate");
......@@ -4350,6 +4519,12 @@ public abstract class BaseJobApplication extends BaseBusinessClass
return this;
}
public SearchStageType andApplicantSource (QueryFilter<ApplicantSource> filter)
{
filter.addFilter (context, "tl_job_application.applicant_source", "ApplicantSource");
return this;
}
public SearchStageType andCandidate (QueryFilter<Candidate> filter)
{
filter.addFilter (context, "tl_job_application.candidate_id", "Candidate");
......@@ -4432,6 +4607,10 @@ public abstract class BaseJobApplication extends BaseBusinessClass
{
return HELPER_IsEmailIngest.toObject (getIsEmailIngest ());
}
else if (attribName.equals (FIELD_ApplicantSource))
{
return HELPER_ApplicantSource.toObject (getApplicantSource ());
}
else if (attribName.equals (FIELD_AppProcessOption))
{
return HELPER_AppProcessOption.toObject (getAppProcessOption ());
......@@ -4505,6 +4684,10 @@ public abstract class BaseJobApplication extends BaseBusinessClass
{
return HELPER_IsEmailIngest;
}
else if (attribName.equals (FIELD_ApplicantSource))
{
return HELPER_ApplicantSource;
}
else if (attribName.equals (FIELD_AppProcessOption))
{
return HELPER_AppProcessOption;
......@@ -4578,6 +4761,10 @@ public abstract class BaseJobApplication extends BaseBusinessClass
{
setIsEmailIngest ((Boolean)(HELPER_IsEmailIngest.fromObject (_IsEmailIngest, attribValue)));
}
else if (attribName.equals (FIELD_ApplicantSource))
{
setApplicantSource ((ApplicantSource)(HELPER_ApplicantSource.fromObject (_ApplicantSource, attribValue)));
}
else if (attribName.equals (FIELD_AppProcessOption))
{
setAppProcessOption ((AppProcessOption)(HELPER_AppProcessOption.fromObject (_AppProcessOption, attribValue)));
......@@ -4668,6 +4855,10 @@ public abstract class BaseJobApplication extends BaseBusinessClass
{
return getWriteability_IsEmailIngest ();
}
else if (fieldName.equals (FIELD_ApplicantSource))
{
return getWriteability_ApplicantSource ();
}
else if (fieldName.equals (MULTIPLEREFERENCE_AssessmentCriteriaAnswers))
{
return getWriteability_AssessmentCriteriaAnswers ();
......@@ -4777,6 +4968,11 @@ public abstract class BaseJobApplication extends BaseBusinessClass
fields.add (FIELD_IsEmailIngest);
}
if (getWriteability_ApplicantSource () != FieldWriteability.TRUE)
{
fields.add (FIELD_ApplicantSource);
}
if (getWriteability_AppProcessOption () != FieldWriteability.TRUE)
{
fields.add (FIELD_AppProcessOption);
......@@ -4840,6 +5036,7 @@ public abstract class BaseJobApplication extends BaseBusinessClass
result.add(HELPER_PreferRemote.getAttribObject (getClass (), _PreferRemote, false, FIELD_PreferRemote));
result.add(HELPER_HappyToRelocate.getAttribObject (getClass (), _HappyToRelocate, false, FIELD_HappyToRelocate));
result.add(HELPER_IsEmailIngest.getAttribObject (getClass (), _IsEmailIngest, false, FIELD_IsEmailIngest));
result.add(HELPER_ApplicantSource.getAttribObject (getClass (), _ApplicantSource, false, FIELD_ApplicantSource));
result.add(HELPER_AppProcessOption.getAttribObject (getClass (), _AppProcessOption, false, FIELD_AppProcessOption));
result.add(HELPER_OverallRank.getAttribObject (getClass (), _OverallRank, false, FIELD_OverallRank));
result.add(HELPER_RoleFit.getAttribObject (getClass (), _RoleFit, false, FIELD_RoleFit));
......@@ -5085,6 +5282,24 @@ public abstract class BaseJobApplication extends BaseBusinessClass
}
/**
* Get the attribute ApplicantSource
*/
public ApplicantSource getApplicantSource (JobApplication obj, ApplicantSource original)
{
return original;
}
/**
* Change the value set for attribute ApplicantSource.
* May modify the field beforehand
* Occurs before validation.
*/
public ApplicantSource setApplicantSource (JobApplication obj, ApplicantSource newApplicantSource) throws FieldException
{
return newApplicantSource;
}
/**
* Get the attribute AppProcessOption
*/
public AppProcessOption getAppProcessOption (JobApplication obj, AppProcessOption original)
......@@ -5348,6 +5563,10 @@ public abstract class BaseJobApplication extends BaseBusinessClass
{
return toIsEmailIngest ();
}
if (name.equals ("ApplicantSource"))
{
return toApplicantSource ();
}
if (name.equals ("Candidate"))
{
return toCandidate ();
......@@ -5402,6 +5621,11 @@ public abstract class BaseJobApplication extends BaseBusinessClass
public PipeLine<From, Boolean> toIsEmailIngest () { return pipe(new ORMAttributePipe<Me, Boolean>(FIELD_IsEmailIngest)); }
public ApplicantSource.ApplicantSourcePipeLineFactory<From, ApplicantSource> toApplicantSource ()
{
return new ApplicantSource.ApplicantSourcePipeLineFactory<> (this, new ORMAttributePipe<>(FIELD_ApplicantSource));
}
public Candidate.CandidatePipeLineFactory<From, Candidate> toCandidate () { return toCandidate (Filter.ALL); }
public Candidate.CandidatePipeLineFactory<From, Candidate> toCandidate (Filter<Candidate> filter)
......
......@@ -46,7 +46,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
public static final String FIELD_BusinessHoursOnly = "BusinessHoursOnly";
public static final String FIELD_MessageContent = "MessageContent";
public static final String FIELD_TemplateType = "TemplateType";
public static final String FIELD_IsGlobalTemplate = "IsGlobalTemplate";
public static final String FIELD_RelatedToJob = "RelatedToJob";
public static final String FIELD_IsSystemGenerated = "IsSystemGenerated";
public static final String SINGLEREFERENCE_HiringTeam = "HiringTeam";
public static final String BACKREF_HiringTeam = "";
......@@ -66,7 +66,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
private static final DefaultAttributeHelper<MessageTemplate> HELPER_BusinessHoursOnly = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<MessageTemplate> HELPER_MessageContent = DefaultAttributeHelper.INSTANCE;
private static final EnumeratedAttributeHelper<MessageTemplate, TemplateType> HELPER_TemplateType = new EnumeratedAttributeHelper<MessageTemplate, TemplateType> (TemplateType.FACTORY_TemplateType);
private static final DefaultAttributeHelper<MessageTemplate> HELPER_IsGlobalTemplate = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<MessageTemplate> HELPER_RelatedToJob = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<MessageTemplate> HELPER_IsSystemGenerated = DefaultAttributeHelper.INSTANCE;
......@@ -81,7 +81,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
private Boolean _BusinessHoursOnly;
private String _MessageContent;
private TemplateType _TemplateType;
private Boolean _IsGlobalTemplate;
private Boolean _RelatedToJob;
private Boolean _IsSystemGenerated;
......@@ -106,7 +106,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
private static final AttributeValidator[] FIELD_BusinessHoursOnly_Validators;
private static final AttributeValidator[] FIELD_MessageContent_Validators;
private static final AttributeValidator[] FIELD_TemplateType_Validators;
private static final AttributeValidator[] FIELD_IsGlobalTemplate_Validators;
private static final AttributeValidator[] FIELD_RelatedToJob_Validators;
private static final AttributeValidator[] FIELD_IsSystemGenerated_Validators;
......@@ -121,7 +121,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
private static final AttributeDecorator<MessageTemplate, Boolean>[] FIELD_BusinessHoursOnly_Decorators;
private static final AttributeDecorator<MessageTemplate, String>[] FIELD_MessageContent_Decorators;
private static final AttributeDecorator<MessageTemplate, TemplateType>[] FIELD_TemplateType_Decorators;
private static final AttributeDecorator<MessageTemplate, Boolean>[] FIELD_IsGlobalTemplate_Decorators;
private static final AttributeDecorator<MessageTemplate, Boolean>[] FIELD_RelatedToJob_Decorators;
private static final AttributeDecorator<MessageTemplate, Boolean>[] FIELD_IsSystemGenerated_Decorators;
......@@ -155,7 +155,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
FIELD_BusinessHoursOnly_Validators = (AttributeValidator[])setupAttribMetaData_BusinessHoursOnly(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_MessageContent_Validators = (AttributeValidator[])setupAttribMetaData_MessageContent(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_TemplateType_Validators = (AttributeValidator[])setupAttribMetaData_TemplateType(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_IsGlobalTemplate_Validators = (AttributeValidator[])setupAttribMetaData_IsGlobalTemplate(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_RelatedToJob_Validators = (AttributeValidator[])setupAttribMetaData_RelatedToJob(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_IsSystemGenerated_Validators = (AttributeValidator[])setupAttribMetaData_IsSystemGenerated(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_MessageID_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_MessageTemplate, FIELD_MessageID).toArray (new AttributeDecorator[0]);
FIELD_TemplateName_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_MessageTemplate, FIELD_TemplateName).toArray (new AttributeDecorator[0]);
......@@ -167,7 +167,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
FIELD_BusinessHoursOnly_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_MessageTemplate, FIELD_BusinessHoursOnly).toArray (new AttributeDecorator[0]);
FIELD_MessageContent_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_MessageTemplate, FIELD_MessageContent).toArray (new AttributeDecorator[0]);
FIELD_TemplateType_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_MessageTemplate, FIELD_TemplateType).toArray (new AttributeDecorator[0]);
FIELD_IsGlobalTemplate_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_MessageTemplate, FIELD_IsGlobalTemplate).toArray (new AttributeDecorator[0]);
FIELD_RelatedToJob_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_MessageTemplate, FIELD_RelatedToJob).toArray (new AttributeDecorator[0]);
FIELD_IsSystemGenerated_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_MessageTemplate, FIELD_IsSystemGenerated).toArray (new AttributeDecorator[0]);
SINGLEREFERENCE_HiringTeam_Decorators = (SingleAssocDecorator[])AttributeDecoratorUtils.getSingleAssocDecorators(REFERENCE_MessageTemplate, SINGLEREFERENCE_HiringTeam).toArray (new SingleAssocDecorator[0]);
......@@ -390,20 +390,21 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
return validators;
}
private static List setupAttribMetaData_IsGlobalTemplate(Map validatorMapping)
private static List setupAttribMetaData_RelatedToJob(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "is_global_template");
metaInfo.put ("dbcol", "related_to_job");
metaInfo.put ("defaultValue", "Boolean.FALSE");
metaInfo.put ("mandatory", "false");
metaInfo.put ("name", "IsGlobalTemplate");
metaInfo.put ("name", "RelatedToJob");
metaInfo.put ("type", "Boolean");
metaInfo.put (METADATA_DB_TABLENAME, "tl_message_template");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for MessageTemplate.IsGlobalTemplate:", metaInfo);
ATTRIBUTES_METADATA_MessageTemplate.put (FIELD_IsGlobalTemplate, Collections.unmodifiableMap (metaInfo));
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for MessageTemplate.RelatedToJob:", metaInfo);
ATTRIBUTES_METADATA_MessageTemplate.put (FIELD_RelatedToJob, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(MessageTemplate.class, "IsGlobalTemplate", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for MessageTemplate.IsGlobalTemplate:", validators);
List validators = BaseBusinessClass.getAttribValidators(MessageTemplate.class, "RelatedToJob", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for MessageTemplate.RelatedToJob:", validators);
return validators;
}
......@@ -460,7 +461,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
_BusinessHoursOnly = (Boolean)(Boolean.FALSE);
_MessageContent = (String)(HELPER_MessageContent.initialise (_MessageContent));
_TemplateType = (TemplateType)(TemplateType.EMAIL);
_IsGlobalTemplate = (Boolean)(HELPER_IsGlobalTemplate.initialise (_IsGlobalTemplate));
_RelatedToJob = (Boolean)(Boolean.FALSE);
_IsSystemGenerated = (Boolean)(Boolean.FALSE);
}
......@@ -1490,17 +1491,17 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
}
/**
* Attribute IsGlobalTemplate
* Attribute RelatedToJob
*/
public Boolean getIsGlobalTemplate ()
public Boolean getRelatedToJob ()
{
assertValid();
Boolean valToReturn = AttributeDecoratorUtils.getValue (FIELD_IsGlobalTemplate_Decorators, (MessageTemplate)this, FIELD_IsGlobalTemplate, _IsGlobalTemplate);
Boolean valToReturn = AttributeDecoratorUtils.getValue (FIELD_RelatedToJob_Decorators, (MessageTemplate)this, FIELD_RelatedToJob, _RelatedToJob);
for (MessageTemplateBehaviourDecorator bhd : MessageTemplate_BehaviourDecorators)
{
valToReturn = bhd.getIsGlobalTemplate ((MessageTemplate)this, valToReturn);
valToReturn = bhd.getRelatedToJob ((MessageTemplate)this, valToReturn);
}
return valToReturn;
......@@ -1511,7 +1512,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preIsGlobalTemplateChange (Boolean newIsGlobalTemplate) throws FieldException
protected void preRelatedToJobChange (Boolean newRelatedToJob) throws FieldException
{
}
......@@ -1521,48 +1522,48 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postIsGlobalTemplateChange () throws FieldException
protected void postRelatedToJobChange () throws FieldException
{
}
public FieldWriteability getWriteability_IsGlobalTemplate ()
public FieldWriteability getWriteability_RelatedToJob ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute IsGlobalTemplate. Checks to ensure a new value
* Set the attribute RelatedToJob. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setIsGlobalTemplate (Boolean newIsGlobalTemplate) throws FieldException
public void setRelatedToJob (Boolean newRelatedToJob) throws FieldException
{
newIsGlobalTemplate = AttributeDecoratorUtils.setValue (FIELD_IsGlobalTemplate_Decorators, (MessageTemplate)this, FIELD_IsGlobalTemplate, newIsGlobalTemplate);
newRelatedToJob = AttributeDecoratorUtils.setValue (FIELD_RelatedToJob_Decorators, (MessageTemplate)this, FIELD_RelatedToJob, newRelatedToJob);
boolean oldAndNewIdentical = HELPER_IsGlobalTemplate.compare (_IsGlobalTemplate, newIsGlobalTemplate);
boolean oldAndNewIdentical = HELPER_RelatedToJob.compare (_RelatedToJob, newRelatedToJob);
try
{
for (MessageTemplateBehaviourDecorator bhd : MessageTemplate_BehaviourDecorators)
{
newIsGlobalTemplate = bhd.setIsGlobalTemplate ((MessageTemplate)this, newIsGlobalTemplate);
oldAndNewIdentical = HELPER_IsGlobalTemplate.compare (_IsGlobalTemplate, newIsGlobalTemplate);
newRelatedToJob = bhd.setRelatedToJob ((MessageTemplate)this, newRelatedToJob);
oldAndNewIdentical = HELPER_RelatedToJob.compare (_RelatedToJob, newRelatedToJob);
}
if (FIELD_IsGlobalTemplate_Validators.length > 0)
if (FIELD_RelatedToJob_Validators.length > 0)
{
Object newIsGlobalTemplateObj = HELPER_IsGlobalTemplate.toObject (newIsGlobalTemplate);
Object newRelatedToJobObj = HELPER_RelatedToJob.toObject (newRelatedToJob);
if (newIsGlobalTemplateObj != null)
if (newRelatedToJobObj != null)
{
int loopMax = FIELD_IsGlobalTemplate_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_MessageTemplate.get (FIELD_IsGlobalTemplate);
int loopMax = FIELD_RelatedToJob_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_MessageTemplate.get (FIELD_RelatedToJob);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_IsGlobalTemplate_Validators[v].checkAttribute (this, FIELD_IsGlobalTemplate, metadata, newIsGlobalTemplateObj);
FIELD_RelatedToJob_Validators[v].checkAttribute (this, FIELD_RelatedToJob, metadata, newRelatedToJobObj);
}
}
}
......@@ -1580,12 +1581,12 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (AttributeDecoratorUtils.getWriteability (FIELD_IsGlobalTemplate_Decorators, (MessageTemplate)this, FIELD_IsGlobalTemplate ,getWriteability_IsGlobalTemplate ()) != FieldWriteability.FALSE, "Field IsGlobalTemplate is not writeable");
preIsGlobalTemplateChange (newIsGlobalTemplate);
markFieldChange (FIELD_IsGlobalTemplate);
_IsGlobalTemplate = newIsGlobalTemplate;
postFieldChange (FIELD_IsGlobalTemplate);
postIsGlobalTemplateChange ();
Debug.assertion (AttributeDecoratorUtils.getWriteability (FIELD_RelatedToJob_Decorators, (MessageTemplate)this, FIELD_RelatedToJob ,getWriteability_RelatedToJob ()) != FieldWriteability.FALSE, "Field RelatedToJob is not writeable");
preRelatedToJobChange (newRelatedToJob);
markFieldChange (FIELD_RelatedToJob);
_RelatedToJob = newRelatedToJob;
postFieldChange (FIELD_RelatedToJob);
postRelatedToJobChange ();
}
}
......@@ -2080,7 +2081,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
tl_message_templatePSet.setAttrib (FIELD_BusinessHoursOnly, HELPER_BusinessHoursOnly.toObject (_BusinessHoursOnly)); //
tl_message_templatePSet.setAttrib (FIELD_MessageContent, HELPER_MessageContent.toObject (_MessageContent)); //
tl_message_templatePSet.setAttrib (FIELD_TemplateType, HELPER_TemplateType.toObject (_TemplateType)); //
tl_message_templatePSet.setAttrib (FIELD_IsGlobalTemplate, HELPER_IsGlobalTemplate.toObject (_IsGlobalTemplate)); //
tl_message_templatePSet.setAttrib (FIELD_RelatedToJob, HELPER_RelatedToJob.toObject (_RelatedToJob)); //
tl_message_templatePSet.setAttrib (FIELD_IsSystemGenerated, HELPER_IsSystemGenerated.toObject (_IsSystemGenerated)); //
_HiringTeam.getPersistentSets (allSets);
......@@ -2106,7 +2107,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
_BusinessHoursOnly = (Boolean)(HELPER_BusinessHoursOnly.fromObject (_BusinessHoursOnly, tl_message_templatePSet.getAttrib (FIELD_BusinessHoursOnly))); //
_MessageContent = (String)(HELPER_MessageContent.fromObject (_MessageContent, tl_message_templatePSet.getAttrib (FIELD_MessageContent))); //
_TemplateType = (TemplateType)(HELPER_TemplateType.fromObject (_TemplateType, tl_message_templatePSet.getAttrib (FIELD_TemplateType))); //
_IsGlobalTemplate = (Boolean)(HELPER_IsGlobalTemplate.fromObject (_IsGlobalTemplate, tl_message_templatePSet.getAttrib (FIELD_IsGlobalTemplate))); //
_RelatedToJob = (Boolean)(HELPER_RelatedToJob.fromObject (_RelatedToJob, tl_message_templatePSet.getAttrib (FIELD_RelatedToJob))); //
_IsSystemGenerated = (Boolean)(HELPER_IsSystemGenerated.fromObject (_IsSystemGenerated, tl_message_templatePSet.getAttrib (FIELD_IsSystemGenerated))); //
_HiringTeam.setFromPersistentSets (objectID, allSets);
......@@ -2214,7 +2215,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
try
{
setIsGlobalTemplate (otherMessageTemplate.getIsGlobalTemplate ());
setRelatedToJob (otherMessageTemplate.getRelatedToJob ());
}
catch (FieldException ex)
{
......@@ -2254,7 +2255,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
_BusinessHoursOnly = sourceMessageTemplate._BusinessHoursOnly;
_MessageContent = sourceMessageTemplate._MessageContent;
_TemplateType = sourceMessageTemplate._TemplateType;
_IsGlobalTemplate = sourceMessageTemplate._IsGlobalTemplate;
_RelatedToJob = sourceMessageTemplate._RelatedToJob;
_IsSystemGenerated = sourceMessageTemplate._IsSystemGenerated;
}
......@@ -2319,7 +2320,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
_BusinessHoursOnly = (Boolean)(HELPER_BusinessHoursOnly.readExternal (_BusinessHoursOnly, vals.get(FIELD_BusinessHoursOnly))); //
_MessageContent = (String)(HELPER_MessageContent.readExternal (_MessageContent, vals.get(FIELD_MessageContent))); //
_TemplateType = (TemplateType)(HELPER_TemplateType.readExternal (_TemplateType, vals.get(FIELD_TemplateType))); //
_IsGlobalTemplate = (Boolean)(HELPER_IsGlobalTemplate.readExternal (_IsGlobalTemplate, vals.get(FIELD_IsGlobalTemplate))); //
_RelatedToJob = (Boolean)(HELPER_RelatedToJob.readExternal (_RelatedToJob, vals.get(FIELD_RelatedToJob))); //
_IsSystemGenerated = (Boolean)(HELPER_IsSystemGenerated.readExternal (_IsSystemGenerated, vals.get(FIELD_IsSystemGenerated))); //
_HiringTeam.readExternalData(vals.get(SINGLEREFERENCE_HiringTeam));
......@@ -2343,7 +2344,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
vals.put (FIELD_BusinessHoursOnly, HELPER_BusinessHoursOnly.writeExternal (_BusinessHoursOnly));
vals.put (FIELD_MessageContent, HELPER_MessageContent.writeExternal (_MessageContent));
vals.put (FIELD_TemplateType, HELPER_TemplateType.writeExternal (_TemplateType));
vals.put (FIELD_IsGlobalTemplate, HELPER_IsGlobalTemplate.writeExternal (_IsGlobalTemplate));
vals.put (FIELD_RelatedToJob, HELPER_RelatedToJob.writeExternal (_RelatedToJob));
vals.put (FIELD_IsSystemGenerated, HELPER_IsSystemGenerated.writeExternal (_IsSystemGenerated));
vals.put (SINGLEREFERENCE_HiringTeam, _HiringTeam.writeExternalData());
......@@ -2399,9 +2400,9 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
{
listener.notifyFieldChange(this, other, FIELD_TemplateType, HELPER_TemplateType.toObject(this._TemplateType), HELPER_TemplateType.toObject(otherMessageTemplate._TemplateType));
}
if (!HELPER_IsGlobalTemplate.compare(this._IsGlobalTemplate, otherMessageTemplate._IsGlobalTemplate))
if (!HELPER_RelatedToJob.compare(this._RelatedToJob, otherMessageTemplate._RelatedToJob))
{
listener.notifyFieldChange(this, other, FIELD_IsGlobalTemplate, HELPER_IsGlobalTemplate.toObject(this._IsGlobalTemplate), HELPER_IsGlobalTemplate.toObject(otherMessageTemplate._IsGlobalTemplate));
listener.notifyFieldChange(this, other, FIELD_RelatedToJob, HELPER_RelatedToJob.toObject(this._RelatedToJob), HELPER_RelatedToJob.toObject(otherMessageTemplate._RelatedToJob));
}
if (!HELPER_IsSystemGenerated.compare(this._IsSystemGenerated, otherMessageTemplate._IsSystemGenerated))
{
......@@ -2440,7 +2441,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
visitor.visitField(this, FIELD_BusinessHoursOnly, HELPER_BusinessHoursOnly.toObject(getBusinessHoursOnly()));
visitor.visitField(this, FIELD_MessageContent, HELPER_MessageContent.toObject(getMessageContent()));
visitor.visitField(this, FIELD_TemplateType, HELPER_TemplateType.toObject(getTemplateType()));
visitor.visitField(this, FIELD_IsGlobalTemplate, HELPER_IsGlobalTemplate.toObject(getIsGlobalTemplate()));
visitor.visitField(this, FIELD_RelatedToJob, HELPER_RelatedToJob.toObject(getRelatedToJob()));
visitor.visitField(this, FIELD_IsSystemGenerated, HELPER_IsSystemGenerated.toObject(getIsSystemGenerated()));
visitor.visitAssociation (_HiringTeam);
......@@ -2520,9 +2521,9 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
{
return filter.matches (getTemplateType ());
}
else if (attribName.equals (FIELD_IsGlobalTemplate))
else if (attribName.equals (FIELD_RelatedToJob))
{
return filter.matches (getIsGlobalTemplate ());
return filter.matches (getRelatedToJob ());
}
else if (attribName.equals (FIELD_IsSystemGenerated))
{
......@@ -2622,9 +2623,9 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
return this;
}
public SearchAll andIsGlobalTemplate (QueryFilter<Boolean> filter)
public SearchAll andRelatedToJob (QueryFilter<Boolean> filter)
{
filter.addFilter (context, "tl_message_template.is_global_template", "IsGlobalTemplate");
filter.addFilter (context, "tl_message_template.related_to_job", "RelatedToJob");
return this;
}
......@@ -2712,9 +2713,9 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
{
return HELPER_TemplateType.toObject (getTemplateType ());
}
else if (attribName.equals (FIELD_IsGlobalTemplate))
else if (attribName.equals (FIELD_RelatedToJob))
{
return HELPER_IsGlobalTemplate.toObject (getIsGlobalTemplate ());
return HELPER_RelatedToJob.toObject (getRelatedToJob ());
}
else if (attribName.equals (FIELD_IsSystemGenerated))
{
......@@ -2773,9 +2774,9 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
{
return HELPER_TemplateType;
}
else if (attribName.equals (FIELD_IsGlobalTemplate))
else if (attribName.equals (FIELD_RelatedToJob))
{
return HELPER_IsGlobalTemplate;
return HELPER_RelatedToJob;
}
else if (attribName.equals (FIELD_IsSystemGenerated))
{
......@@ -2834,9 +2835,9 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
{
setTemplateType ((TemplateType)(HELPER_TemplateType.fromObject (_TemplateType, attribValue)));
}
else if (attribName.equals (FIELD_IsGlobalTemplate))
else if (attribName.equals (FIELD_RelatedToJob))
{
setIsGlobalTemplate ((Boolean)(HELPER_IsGlobalTemplate.fromObject (_IsGlobalTemplate, attribValue)));
setRelatedToJob ((Boolean)(HELPER_RelatedToJob.fromObject (_RelatedToJob, attribValue)));
}
else if (attribName.equals (FIELD_IsSystemGenerated))
{
......@@ -2912,9 +2913,9 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
{
return getWriteability_TemplateType ();
}
else if (fieldName.equals (FIELD_IsGlobalTemplate))
else if (fieldName.equals (FIELD_RelatedToJob))
{
return getWriteability_IsGlobalTemplate ();
return getWriteability_RelatedToJob ();
}
else if (fieldName.equals (FIELD_IsSystemGenerated))
{
......@@ -2983,9 +2984,9 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
fields.add (FIELD_TemplateType);
}
if (getWriteability_IsGlobalTemplate () != FieldWriteability.TRUE)
if (getWriteability_RelatedToJob () != FieldWriteability.TRUE)
{
fields.add (FIELD_IsGlobalTemplate);
fields.add (FIELD_RelatedToJob);
}
if (getWriteability_IsSystemGenerated () != FieldWriteability.TRUE)
......@@ -3023,7 +3024,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
result.add(HELPER_BusinessHoursOnly.getAttribObject (getClass (), _BusinessHoursOnly, false, FIELD_BusinessHoursOnly));
result.add(HELPER_MessageContent.getAttribObject (getClass (), _MessageContent, true, FIELD_MessageContent));
result.add(HELPER_TemplateType.getAttribObject (getClass (), _TemplateType, true, FIELD_TemplateType));
result.add(HELPER_IsGlobalTemplate.getAttribObject (getClass (), _IsGlobalTemplate, false, FIELD_IsGlobalTemplate));
result.add(HELPER_RelatedToJob.getAttribObject (getClass (), _RelatedToJob, false, FIELD_RelatedToJob));
result.add(HELPER_IsSystemGenerated.getAttribObject (getClass (), _IsSystemGenerated, false, FIELD_IsSystemGenerated));
return result;
......@@ -3263,21 +3264,21 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
}
/**
* Get the attribute IsGlobalTemplate
* Get the attribute RelatedToJob
*/
public Boolean getIsGlobalTemplate (MessageTemplate obj, Boolean original)
public Boolean getRelatedToJob (MessageTemplate obj, Boolean original)
{
return original;
}
/**
* Change the value set for attribute IsGlobalTemplate.
* Change the value set for attribute RelatedToJob.
* May modify the field beforehand
* Occurs before validation.
*/
public Boolean setIsGlobalTemplate (MessageTemplate obj, Boolean newIsGlobalTemplate) throws FieldException
public Boolean setRelatedToJob (MessageTemplate obj, Boolean newRelatedToJob) throws FieldException
{
return newIsGlobalTemplate;
return newRelatedToJob;
}
/**
......@@ -3396,9 +3397,9 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
{
return toTemplateType ();
}
if (name.equals ("IsGlobalTemplate"))
if (name.equals ("RelatedToJob"))
{
return toIsGlobalTemplate ();
return toRelatedToJob ();
}
if (name.equals ("IsSystemGenerated"))
{
......@@ -3440,7 +3441,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
return new TemplateType.TemplateTypePipeLineFactory<> (this, new ORMAttributePipe<>(FIELD_TemplateType));
}
public PipeLine<From, Boolean> toIsGlobalTemplate () { return pipe(new ORMAttributePipe<Me, Boolean>(FIELD_IsGlobalTemplate)); }
public PipeLine<From, Boolean> toRelatedToJob () { return pipe(new ORMAttributePipe<Me, Boolean>(FIELD_RelatedToJob)); }
public PipeLine<From, Boolean> toIsSystemGenerated () { return pipe(new ORMAttributePipe<Me, Boolean>(FIELD_IsSystemGenerated)); }
......
......@@ -40,6 +40,7 @@ public abstract class BaseWorkFlowMessage extends BaseBusinessClass
public static final String FIELD_Variance = "Variance";
public static final String FIELD_BusinessHoursOnly = "BusinessHoursOnly";
public static final String FIELD_IsWithdrawalMessage = "IsWithdrawalMessage";
public static final String FIELD_ApplicantSources = "ApplicantSources";
public static final String SINGLEREFERENCE_MessageTemplate = "MessageTemplate";
public static final String SINGLEREFERENCE_WorkFlowStage = "WorkFlowStage";
public static final String BACKREF_WorkFlowStage = "";
......@@ -53,6 +54,7 @@ public abstract class BaseWorkFlowMessage extends BaseBusinessClass
private static final DefaultAttributeHelper<WorkFlowMessage> HELPER_Variance = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<WorkFlowMessage> HELPER_BusinessHoursOnly = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<WorkFlowMessage> HELPER_IsWithdrawalMessage = DefaultAttributeHelper.INSTANCE;
private static final DelimitedEnumsAttributeHelper HELPER_ApplicantSources = new DelimitedEnumsAttributeHelper (ApplicantSource.FACTORY_ApplicantSource);
// Private attributes corresponding to business object data
......@@ -60,6 +62,7 @@ public abstract class BaseWorkFlowMessage extends BaseBusinessClass
private String _Variance;
private Boolean _BusinessHoursOnly;
private Boolean _IsWithdrawalMessage;
private Set<ApplicantSource> _ApplicantSources;
// Private attributes corresponding to single references
......@@ -78,6 +81,7 @@ public abstract class BaseWorkFlowMessage extends BaseBusinessClass
private static final AttributeValidator[] FIELD_Variance_Validators;
private static final AttributeValidator[] FIELD_BusinessHoursOnly_Validators;
private static final AttributeValidator[] FIELD_IsWithdrawalMessage_Validators;
private static final AttributeValidator[] FIELD_ApplicantSources_Validators;
// Arrays of AttributeDecorators for each attribute
......@@ -85,6 +89,7 @@ public abstract class BaseWorkFlowMessage extends BaseBusinessClass
private static final AttributeDecorator<WorkFlowMessage, String>[] FIELD_Variance_Decorators;
private static final AttributeDecorator<WorkFlowMessage, Boolean>[] FIELD_BusinessHoursOnly_Decorators;
private static final AttributeDecorator<WorkFlowMessage, Boolean>[] FIELD_IsWithdrawalMessage_Decorators;
private static final AttributeDecorator<WorkFlowMessage, Set<ApplicantSource>>[] FIELD_ApplicantSources_Decorators;
// Arrays of SingleAssocDecorators for each attribute
......@@ -113,10 +118,12 @@ public abstract class BaseWorkFlowMessage extends BaseBusinessClass
FIELD_Variance_Validators = (AttributeValidator[])setupAttribMetaData_Variance(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_BusinessHoursOnly_Validators = (AttributeValidator[])setupAttribMetaData_BusinessHoursOnly(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_IsWithdrawalMessage_Validators = (AttributeValidator[])setupAttribMetaData_IsWithdrawalMessage(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_ApplicantSources_Validators = (AttributeValidator[])setupAttribMetaData_ApplicantSources(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_Delay_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_WorkFlowMessage, FIELD_Delay).toArray (new AttributeDecorator[0]);
FIELD_Variance_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_WorkFlowMessage, FIELD_Variance).toArray (new AttributeDecorator[0]);
FIELD_BusinessHoursOnly_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_WorkFlowMessage, FIELD_BusinessHoursOnly).toArray (new AttributeDecorator[0]);
FIELD_IsWithdrawalMessage_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_WorkFlowMessage, FIELD_IsWithdrawalMessage).toArray (new AttributeDecorator[0]);
FIELD_ApplicantSources_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_WorkFlowMessage, FIELD_ApplicantSources).toArray (new AttributeDecorator[0]);
SINGLEREFERENCE_MessageTemplate_Decorators = (SingleAssocDecorator[])AttributeDecoratorUtils.getSingleAssocDecorators(REFERENCE_WorkFlowMessage, SINGLEREFERENCE_MessageTemplate).toArray (new SingleAssocDecorator[0]);
SINGLEREFERENCE_WorkFlowStage_Decorators = (SingleAssocDecorator[])AttributeDecoratorUtils.getSingleAssocDecorators(REFERENCE_WorkFlowMessage, SINGLEREFERENCE_WorkFlowStage).toArray (new SingleAssocDecorator[0]);
......@@ -234,6 +241,26 @@ public abstract class BaseWorkFlowMessage extends BaseBusinessClass
return validators;
}
private static List setupAttribMetaData_ApplicantSources(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("attribHelper", "DelimitedEnumsAttributeHelper");
metaInfo.put ("attribHelperInstance", "new DelimitedEnumsAttributeHelper (ApplicantSource.FACTORY_ApplicantSource)");
metaInfo.put ("dbcol", "applicant_sources");
metaInfo.put ("mandatory", "false");
metaInfo.put ("name", "ApplicantSources");
metaInfo.put ("type", "Set<ApplicantSource>");
metaInfo.put (METADATA_DB_TABLENAME, "tl_work_flow_message");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for WorkFlowMessage.ApplicantSources:", metaInfo);
ATTRIBUTES_METADATA_WorkFlowMessage.put (FIELD_ApplicantSources, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(WorkFlowMessage.class, "ApplicantSources", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for WorkFlowMessage.ApplicantSources:", validators);
return validators;
}
// END OF STATIC METADATA DEFINITION
......@@ -261,6 +288,7 @@ public abstract class BaseWorkFlowMessage extends BaseBusinessClass
_Variance = (String)(HELPER_Variance.initialise (_Variance));
_BusinessHoursOnly = (Boolean)(Boolean.FALSE);
_IsWithdrawalMessage = (Boolean)(HELPER_IsWithdrawalMessage.initialise (_IsWithdrawalMessage));
_ApplicantSources = (Set<ApplicantSource>)(HELPER_ApplicantSources.initialise (_ApplicantSources));
}
......@@ -686,6 +714,106 @@ public abstract class BaseWorkFlowMessage extends BaseBusinessClass
}
}
/**
* Attribute ApplicantSources
*/
public Set<ApplicantSource> getApplicantSources ()
{
assertValid();
Set<ApplicantSource> valToReturn = AttributeDecoratorUtils.getValue (FIELD_ApplicantSources_Decorators, (WorkFlowMessage)this, FIELD_ApplicantSources, _ApplicantSources);
for (WorkFlowMessageBehaviourDecorator bhd : WorkFlowMessage_BehaviourDecorators)
{
valToReturn = bhd.getApplicantSources ((WorkFlowMessage)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preApplicantSourcesChange (Set<ApplicantSource> newApplicantSources) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postApplicantSourcesChange () throws FieldException
{
}
public FieldWriteability getWriteability_ApplicantSources ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute ApplicantSources. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setApplicantSources (Set<ApplicantSource> newApplicantSources) throws FieldException
{
newApplicantSources = AttributeDecoratorUtils.setValue (FIELD_ApplicantSources_Decorators, (WorkFlowMessage)this, FIELD_ApplicantSources, newApplicantSources);
boolean oldAndNewIdentical = HELPER_ApplicantSources.compare (_ApplicantSources, newApplicantSources);
try
{
for (WorkFlowMessageBehaviourDecorator bhd : WorkFlowMessage_BehaviourDecorators)
{
newApplicantSources = bhd.setApplicantSources ((WorkFlowMessage)this, newApplicantSources);
oldAndNewIdentical = HELPER_ApplicantSources.compare (_ApplicantSources, newApplicantSources);
}
if (FIELD_ApplicantSources_Validators.length > 0)
{
Object newApplicantSourcesObj = HELPER_ApplicantSources.toObject (newApplicantSources);
if (newApplicantSourcesObj != null)
{
int loopMax = FIELD_ApplicantSources_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_WorkFlowMessage.get (FIELD_ApplicantSources);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_ApplicantSources_Validators[v].checkAttribute (this, FIELD_ApplicantSources, metadata, newApplicantSourcesObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (AttributeDecoratorUtils.getWriteability (FIELD_ApplicantSources_Decorators, (WorkFlowMessage)this, FIELD_ApplicantSources ,getWriteability_ApplicantSources ()) != FieldWriteability.FALSE, "Field ApplicantSources is not writeable");
preApplicantSourcesChange (newApplicantSources);
markFieldChange (FIELD_ApplicantSources);
_ApplicantSources = newApplicantSources;
postFieldChange (FIELD_ApplicantSources);
postApplicantSourcesChange ();
}
}
/**
......@@ -1187,6 +1315,7 @@ public abstract class BaseWorkFlowMessage extends BaseBusinessClass
tl_work_flow_messagePSet.setAttrib (FIELD_Variance, HELPER_Variance.toObject (_Variance)); //
tl_work_flow_messagePSet.setAttrib (FIELD_BusinessHoursOnly, HELPER_BusinessHoursOnly.toObject (_BusinessHoursOnly)); //
tl_work_flow_messagePSet.setAttrib (FIELD_IsWithdrawalMessage, HELPER_IsWithdrawalMessage.toObject (_IsWithdrawalMessage)); //
tl_work_flow_messagePSet.setAttrib (FIELD_ApplicantSources, HELPER_ApplicantSources.toObject (_ApplicantSources)); //
_MessageTemplate.getPersistentSets (allSets);
_WorkFlowStage.getPersistentSets (allSets);
......@@ -1206,6 +1335,7 @@ public abstract class BaseWorkFlowMessage extends BaseBusinessClass
_Variance = (String)(HELPER_Variance.fromObject (_Variance, tl_work_flow_messagePSet.getAttrib (FIELD_Variance))); //
_BusinessHoursOnly = (Boolean)(HELPER_BusinessHoursOnly.fromObject (_BusinessHoursOnly, tl_work_flow_messagePSet.getAttrib (FIELD_BusinessHoursOnly))); //
_IsWithdrawalMessage = (Boolean)(HELPER_IsWithdrawalMessage.fromObject (_IsWithdrawalMessage, tl_work_flow_messagePSet.getAttrib (FIELD_IsWithdrawalMessage))); //
_ApplicantSources = (Set<ApplicantSource>)(HELPER_ApplicantSources.fromObject (_ApplicantSources, tl_work_flow_messagePSet.getAttrib (FIELD_ApplicantSources))); //
_MessageTemplate.setFromPersistentSets (objectID, allSets);
_WorkFlowStage.setFromPersistentSets (objectID, allSets);
......@@ -1256,6 +1386,15 @@ public abstract class BaseWorkFlowMessage extends BaseBusinessClass
{
e.addException (ex);
}
try
{
setApplicantSources (otherWorkFlowMessage.getApplicantSources ());
}
catch (FieldException ex)
{
e.addException (ex);
}
}
}
......@@ -1275,6 +1414,7 @@ public abstract class BaseWorkFlowMessage extends BaseBusinessClass
_Variance = sourceWorkFlowMessage._Variance;
_BusinessHoursOnly = sourceWorkFlowMessage._BusinessHoursOnly;
_IsWithdrawalMessage = sourceWorkFlowMessage._IsWithdrawalMessage;
_ApplicantSources = sourceWorkFlowMessage._ApplicantSources;
}
}
......@@ -1333,6 +1473,7 @@ public abstract class BaseWorkFlowMessage extends BaseBusinessClass
_Variance = (String)(HELPER_Variance.readExternal (_Variance, vals.get(FIELD_Variance))); //
_BusinessHoursOnly = (Boolean)(HELPER_BusinessHoursOnly.readExternal (_BusinessHoursOnly, vals.get(FIELD_BusinessHoursOnly))); //
_IsWithdrawalMessage = (Boolean)(HELPER_IsWithdrawalMessage.readExternal (_IsWithdrawalMessage, vals.get(FIELD_IsWithdrawalMessage))); //
_ApplicantSources = (Set<ApplicantSource>)(HELPER_ApplicantSources.readExternal (_ApplicantSources, vals.get(FIELD_ApplicantSources))); //
_MessageTemplate.readExternalData(vals.get(SINGLEREFERENCE_MessageTemplate));
_WorkFlowStage.readExternalData(vals.get(SINGLEREFERENCE_WorkFlowStage));
......@@ -1350,6 +1491,7 @@ public abstract class BaseWorkFlowMessage extends BaseBusinessClass
vals.put (FIELD_Variance, HELPER_Variance.writeExternal (_Variance));
vals.put (FIELD_BusinessHoursOnly, HELPER_BusinessHoursOnly.writeExternal (_BusinessHoursOnly));
vals.put (FIELD_IsWithdrawalMessage, HELPER_IsWithdrawalMessage.writeExternal (_IsWithdrawalMessage));
vals.put (FIELD_ApplicantSources, HELPER_ApplicantSources.writeExternal (_ApplicantSources));
vals.put (SINGLEREFERENCE_MessageTemplate, _MessageTemplate.writeExternalData());
vals.put (SINGLEREFERENCE_WorkFlowStage, _WorkFlowStage.writeExternalData());
......@@ -1381,6 +1523,10 @@ public abstract class BaseWorkFlowMessage extends BaseBusinessClass
{
listener.notifyFieldChange(this, other, FIELD_IsWithdrawalMessage, HELPER_IsWithdrawalMessage.toObject(this._IsWithdrawalMessage), HELPER_IsWithdrawalMessage.toObject(otherWorkFlowMessage._IsWithdrawalMessage));
}
if (!HELPER_ApplicantSources.compare(this._ApplicantSources, otherWorkFlowMessage._ApplicantSources))
{
listener.notifyFieldChange(this, other, FIELD_ApplicantSources, HELPER_ApplicantSources.toObject(this._ApplicantSources), HELPER_ApplicantSources.toObject(otherWorkFlowMessage._ApplicantSources));
}
// Compare single assocs
_MessageTemplate.compare (otherWorkFlowMessage._MessageTemplate, listener);
......@@ -1409,6 +1555,7 @@ public abstract class BaseWorkFlowMessage extends BaseBusinessClass
visitor.visitField(this, FIELD_Variance, HELPER_Variance.toObject(getVariance()));
visitor.visitField(this, FIELD_BusinessHoursOnly, HELPER_BusinessHoursOnly.toObject(getBusinessHoursOnly()));
visitor.visitField(this, FIELD_IsWithdrawalMessage, HELPER_IsWithdrawalMessage.toObject(getIsWithdrawalMessage()));
visitor.visitField(this, FIELD_ApplicantSources, HELPER_ApplicantSources.toObject(getApplicantSources()));
visitor.visitAssociation (_MessageTemplate);
visitor.visitAssociation (_WorkFlowStage);
......@@ -1468,6 +1615,10 @@ public abstract class BaseWorkFlowMessage extends BaseBusinessClass
{
return filter.matches (getIsWithdrawalMessage ());
}
else if (attribName.equals (FIELD_ApplicantSources))
{
return filter.matches (getApplicantSources ());
}
else if (attribName.equals (SINGLEREFERENCE_MessageTemplate))
{
return filter.matches (getMessageTemplate ());
......@@ -1530,6 +1681,12 @@ public abstract class BaseWorkFlowMessage extends BaseBusinessClass
return this;
}
public SearchAll andApplicantSources (QueryFilter<Set<ApplicantSource>> filter)
{
filter.addFilter (context, "tl_work_flow_message.applicant_sources", "ApplicantSources");
return this;
}
public SearchAll andMessageTemplate (QueryFilter<MessageTemplate> filter)
{
filter.addFilter (context, "tl_work_flow_message.message_template_id", "MessageTemplate");
......@@ -1590,6 +1747,10 @@ public abstract class BaseWorkFlowMessage extends BaseBusinessClass
{
return HELPER_IsWithdrawalMessage.toObject (getIsWithdrawalMessage ());
}
else if (attribName.equals (FIELD_ApplicantSources))
{
return HELPER_ApplicantSources.toObject (getApplicantSources ());
}
else
{
return super.getAttribute (attribName);
......@@ -1619,6 +1780,10 @@ public abstract class BaseWorkFlowMessage extends BaseBusinessClass
{
return HELPER_IsWithdrawalMessage;
}
else if (attribName.equals (FIELD_ApplicantSources))
{
return HELPER_ApplicantSources;
}
else
{
return super.getAttributeHelper (attribName);
......@@ -1648,6 +1813,10 @@ public abstract class BaseWorkFlowMessage extends BaseBusinessClass
{
setIsWithdrawalMessage ((Boolean)(HELPER_IsWithdrawalMessage.fromObject (_IsWithdrawalMessage, attribValue)));
}
else if (attribName.equals (FIELD_ApplicantSources))
{
setApplicantSources ((Set<ApplicantSource>)(HELPER_ApplicantSources.fromObject (_ApplicantSources, attribValue)));
}
else
{
super.setAttribute (attribName, attribValue);
......@@ -1694,6 +1863,10 @@ public abstract class BaseWorkFlowMessage extends BaseBusinessClass
{
return getWriteability_IsWithdrawalMessage ();
}
else if (fieldName.equals (FIELD_ApplicantSources))
{
return getWriteability_ApplicantSources ();
}
else if (fieldName.equals (SINGLEREFERENCE_MessageTemplate))
{
return getWriteability_MessageTemplate ();
......@@ -1731,6 +1904,11 @@ public abstract class BaseWorkFlowMessage extends BaseBusinessClass
fields.add (FIELD_IsWithdrawalMessage);
}
if (getWriteability_ApplicantSources () != FieldWriteability.TRUE)
{
fields.add (FIELD_ApplicantSources);
}
super.putUnwriteable (fields);
}
......@@ -1755,6 +1933,7 @@ public abstract class BaseWorkFlowMessage extends BaseBusinessClass
result.add(HELPER_Variance.getAttribObject (getClass (), _Variance, false, FIELD_Variance));
result.add(HELPER_BusinessHoursOnly.getAttribObject (getClass (), _BusinessHoursOnly, false, FIELD_BusinessHoursOnly));
result.add(HELPER_IsWithdrawalMessage.getAttribObject (getClass (), _IsWithdrawalMessage, false, FIELD_IsWithdrawalMessage));
result.add(HELPER_ApplicantSources.getAttribObject (getClass (), _ApplicantSources, false, FIELD_ApplicantSources));
return result;
}
......@@ -1884,6 +2063,24 @@ public abstract class BaseWorkFlowMessage extends BaseBusinessClass
return newIsWithdrawalMessage;
}
/**
* Get the attribute ApplicantSources
*/
public Set<ApplicantSource> getApplicantSources (WorkFlowMessage obj, Set<ApplicantSource> original)
{
return original;
}
/**
* Change the value set for attribute ApplicantSources.
* May modify the field beforehand
* Occurs before validation.
*/
public Set<ApplicantSource> setApplicantSources (WorkFlowMessage obj, Set<ApplicantSource> newApplicantSources) throws FieldException
{
return newApplicantSources;
}
}
@Override
......@@ -1958,6 +2155,10 @@ public abstract class BaseWorkFlowMessage extends BaseBusinessClass
{
return toIsWithdrawalMessage ();
}
if (name.equals ("ApplicantSources"))
{
return toApplicantSources ();
}
if (name.equals ("MessageTemplate"))
{
return toMessageTemplate ();
......@@ -1980,6 +2181,8 @@ public abstract class BaseWorkFlowMessage extends BaseBusinessClass
public PipeLine<From, Boolean> toIsWithdrawalMessage () { return pipe(new ORMAttributePipe<Me, Boolean>(FIELD_IsWithdrawalMessage)); }
public PipeLine<From, Set<ApplicantSource>> toApplicantSources () { return pipe(new ORMAttributePipe<Me, Set<ApplicantSource>>(FIELD_ApplicantSources)); }
public MessageTemplate.MessageTemplatePipeLineFactory<From, MessageTemplate> toMessageTemplate () { return toMessageTemplate (Filter.ALL); }
public MessageTemplate.MessageTemplatePipeLineFactory<From, MessageTemplate> toMessageTemplate (Filter<MessageTemplate> filter)
......
......@@ -40,11 +40,14 @@ public abstract class BaseWorkFlowStage extends BaseBusinessClass
public static final String FIELD_UseMessaging = "UseMessaging";
public static final String FIELD_StageType = "StageType";
public static final String FIELD_SortOrder = "SortOrder";
public static final String FIELD_AutoProgress = "AutoProgress";
public static final String SINGLEREFERENCE_WithdrawalMessage = "WithdrawalMessage";
public static final String SINGLEREFERENCE_WorkFlowTemplate = "WorkFlowTemplate";
public static final String BACKREF_WorkFlowTemplate = "";
public static final String MULTIPLEREFERENCE_WorkFlowMessages = "WorkFlowMessages";
public static final String BACKREF_WorkFlowMessages = "";
public static final String MULTIPLEREFERENCE_Steps = "Steps";
public static final String BACKREF_Steps = "";
// Static constants corresponding to searches
public static final String SEARCH_All = "All";
......@@ -55,6 +58,7 @@ public abstract class BaseWorkFlowStage extends BaseBusinessClass
private static final DefaultAttributeHelper<WorkFlowStage> HELPER_UseMessaging = DefaultAttributeHelper.INSTANCE;
private static final EnumeratedAttributeHelper<WorkFlowStage, StageType> HELPER_StageType = new EnumeratedAttributeHelper<WorkFlowStage, StageType> (StageType.FACTORY_StageType);
private static final DefaultAttributeHelper<WorkFlowStage> HELPER_SortOrder = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<WorkFlowStage> HELPER_AutoProgress = DefaultAttributeHelper.INSTANCE;
// Private attributes corresponding to business object data
......@@ -62,6 +66,7 @@ public abstract class BaseWorkFlowStage extends BaseBusinessClass
private Boolean _UseMessaging;
private StageType _StageType;
private Integer _SortOrder;
private Boolean _AutoProgress;
// Private attributes corresponding to single references
......@@ -71,6 +76,7 @@ public abstract class BaseWorkFlowStage extends BaseBusinessClass
// Private attributes corresponding to multiple references
private MultipleAssociation<WorkFlowStage, WorkFlowMessage> _WorkFlowMessages;
private MultipleAssociation<WorkFlowStage, WorkFlowStep> _Steps;
// Map of maps of metadata
......@@ -81,6 +87,7 @@ public abstract class BaseWorkFlowStage extends BaseBusinessClass
private static final AttributeValidator[] FIELD_UseMessaging_Validators;
private static final AttributeValidator[] FIELD_StageType_Validators;
private static final AttributeValidator[] FIELD_SortOrder_Validators;
private static final AttributeValidator[] FIELD_AutoProgress_Validators;
// Arrays of AttributeDecorators for each attribute
......@@ -88,6 +95,7 @@ public abstract class BaseWorkFlowStage extends BaseBusinessClass
private static final AttributeDecorator<WorkFlowStage, Boolean>[] FIELD_UseMessaging_Decorators;
private static final AttributeDecorator<WorkFlowStage, StageType>[] FIELD_StageType_Decorators;
private static final AttributeDecorator<WorkFlowStage, Integer>[] FIELD_SortOrder_Decorators;
private static final AttributeDecorator<WorkFlowStage, Boolean>[] FIELD_AutoProgress_Decorators;
// Arrays of SingleAssocDecorators for each attribute
......@@ -97,6 +105,7 @@ public abstract class BaseWorkFlowStage extends BaseBusinessClass
// Arrays of MultiAssocDecorators for each attribute
private static final MultiAssocDecorator<WorkFlowStage, WorkFlowMessage>[] MULTIPLEREFERENCE_WorkFlowMessages_Decorators;
private static final MultiAssocDecorator<WorkFlowStage, WorkFlowStep>[] MULTIPLEREFERENCE_Steps_Decorators;
// Arrays of behaviour decorators
......@@ -108,24 +117,29 @@ public abstract class BaseWorkFlowStage extends BaseBusinessClass
{
String tmp_WorkFlowMessages = WorkFlowMessage.BACKREF_WorkFlowStage;
String tmp_Steps = WorkFlowStep.BACKREF_WorkFlowStage;
String tmp_WorkFlowTemplate = WorkFlowTemplate.BACKREF_WorkFlowStages;
Map validatorMapping = ((Map)ConfigMgr.getConfigObject ("CONFIG.ORMVALIDATOR", "ValidatorMapping"));
setupAssocMetaData_WorkFlowMessages();
setupAssocMetaData_Steps();
setupAssocMetaData_WithdrawalMessage();
setupAssocMetaData_WorkFlowTemplate();
FIELD_Name_Validators = (AttributeValidator[])setupAttribMetaData_Name(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_UseMessaging_Validators = (AttributeValidator[])setupAttribMetaData_UseMessaging(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_StageType_Validators = (AttributeValidator[])setupAttribMetaData_StageType(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_SortOrder_Validators = (AttributeValidator[])setupAttribMetaData_SortOrder(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_AutoProgress_Validators = (AttributeValidator[])setupAttribMetaData_AutoProgress(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_Name_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_WorkFlowStage, FIELD_Name).toArray (new AttributeDecorator[0]);
FIELD_UseMessaging_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_WorkFlowStage, FIELD_UseMessaging).toArray (new AttributeDecorator[0]);
FIELD_StageType_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_WorkFlowStage, FIELD_StageType).toArray (new AttributeDecorator[0]);
FIELD_SortOrder_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_WorkFlowStage, FIELD_SortOrder).toArray (new AttributeDecorator[0]);
FIELD_AutoProgress_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_WorkFlowStage, FIELD_AutoProgress).toArray (new AttributeDecorator[0]);
SINGLEREFERENCE_WithdrawalMessage_Decorators = (SingleAssocDecorator[])AttributeDecoratorUtils.getSingleAssocDecorators(REFERENCE_WorkFlowStage, SINGLEREFERENCE_WithdrawalMessage).toArray (new SingleAssocDecorator[0]);
SINGLEREFERENCE_WorkFlowTemplate_Decorators = (SingleAssocDecorator[])AttributeDecoratorUtils.getSingleAssocDecorators(REFERENCE_WorkFlowStage, SINGLEREFERENCE_WorkFlowTemplate).toArray (new SingleAssocDecorator[0]);
MULTIPLEREFERENCE_WorkFlowMessages_Decorators = (MultiAssocDecorator[])AttributeDecoratorUtils.getMultiAssocDecorators(REFERENCE_WorkFlowStage, MULTIPLEREFERENCE_WorkFlowMessages).toArray (new MultiAssocDecorator[0]);
MULTIPLEREFERENCE_Steps_Decorators = (MultiAssocDecorator[])AttributeDecoratorUtils.getMultiAssocDecorators(REFERENCE_WorkFlowStage, MULTIPLEREFERENCE_Steps).toArray (new MultiAssocDecorator[0]);
REFERENCE_WorkFlowStage.initialiseReference ();
......@@ -153,6 +167,19 @@ public abstract class BaseWorkFlowStage extends BaseBusinessClass
}
private static void setupAssocMetaData_Steps()
{
Map metaInfo = new HashMap ();
metaInfo.put ("backreferenceName", "WorkFlowStage");
metaInfo.put ("name", "Steps");
metaInfo.put ("type", "WorkFlowStep");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for WorkFlowStage.Steps:", metaInfo);
ATTRIBUTES_METADATA_WorkFlowStage.put (MULTIPLEREFERENCE_Steps, Collections.unmodifiableMap (metaInfo));
}
private static void setupAssocMetaData_WithdrawalMessage()
{
Map metaInfo = new HashMap ();
......@@ -255,6 +282,25 @@ public abstract class BaseWorkFlowStage extends BaseBusinessClass
return validators;
}
private static List setupAttribMetaData_AutoProgress(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "auto_progress");
metaInfo.put ("defaultValue", "Boolean.FALSE");
metaInfo.put ("mandatory", "false");
metaInfo.put ("name", "AutoProgress");
metaInfo.put ("type", "Boolean");
metaInfo.put (METADATA_DB_TABLENAME, "tl_work_flow_stage");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for WorkFlowStage.AutoProgress:", metaInfo);
ATTRIBUTES_METADATA_WorkFlowStage.put (FIELD_AutoProgress, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(WorkFlowStage.class, "AutoProgress", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for WorkFlowStage.AutoProgress:", validators);
return validators;
}
// END OF STATIC METADATA DEFINITION
......@@ -282,6 +328,7 @@ public abstract class BaseWorkFlowStage extends BaseBusinessClass
_UseMessaging = (Boolean)(Boolean.FALSE);
_StageType = (StageType)(HELPER_StageType.initialise (_StageType));
_SortOrder = (Integer)(HELPER_SortOrder.initialise (_SortOrder));
_AutoProgress = (Boolean)(Boolean.FALSE);
}
......@@ -291,7 +338,7 @@ public abstract class BaseWorkFlowStage extends BaseBusinessClass
_WithdrawalMessage = new SingleAssociation<WorkFlowStage, WorkFlowMessage> (this, SINGLEREFERENCE_WithdrawalMessage, null, WorkFlowMessage.REFERENCE_WorkFlowMessage, "tl_work_flow_stage");
_WorkFlowTemplate = new SingleAssociation<WorkFlowStage, WorkFlowTemplate> (this, SINGLEREFERENCE_WorkFlowTemplate, WorkFlowTemplate.MULTIPLEREFERENCE_WorkFlowStages, WorkFlowTemplate.REFERENCE_WorkFlowTemplate, "tl_work_flow_stage");
_WorkFlowMessages = new MultipleAssociation<WorkFlowStage, WorkFlowMessage> (this, MULTIPLEREFERENCE_WorkFlowMessages, WorkFlowMessage.SINGLEREFERENCE_WorkFlowStage, WorkFlowMessage.REFERENCE_WorkFlowMessage);
_WorkFlowMessages = new MultipleAssociation<WorkFlowStage, WorkFlowMessage> (this, MULTIPLEREFERENCE_WorkFlowMessages, WorkFlowMessage.SINGLEREFERENCE_WorkFlowStage, WorkFlowMessage.REFERENCE_WorkFlowMessage);_Steps = new MultipleAssociation<WorkFlowStage, WorkFlowStep> (this, MULTIPLEREFERENCE_Steps, WorkFlowStep.SINGLEREFERENCE_WorkFlowStage, WorkFlowStep.REFERENCE_WorkFlowStep);
}
......@@ -301,7 +348,7 @@ public abstract class BaseWorkFlowStage extends BaseBusinessClass
_WithdrawalMessage = new SingleAssociation<WorkFlowStage, WorkFlowMessage> (this, SINGLEREFERENCE_WithdrawalMessage, null, WorkFlowMessage.REFERENCE_WorkFlowMessage, "tl_work_flow_stage");
_WorkFlowTemplate = new SingleAssociation<WorkFlowStage, WorkFlowTemplate> (this, SINGLEREFERENCE_WorkFlowTemplate, WorkFlowTemplate.MULTIPLEREFERENCE_WorkFlowStages, WorkFlowTemplate.REFERENCE_WorkFlowTemplate, "tl_work_flow_stage");
_WorkFlowMessages = new MultipleAssociation<WorkFlowStage, WorkFlowMessage> (this, MULTIPLEREFERENCE_WorkFlowMessages, WorkFlowMessage.SINGLEREFERENCE_WorkFlowStage, WorkFlowMessage.REFERENCE_WorkFlowMessage);
_WorkFlowMessages = new MultipleAssociation<WorkFlowStage, WorkFlowMessage> (this, MULTIPLEREFERENCE_WorkFlowMessages, WorkFlowMessage.SINGLEREFERENCE_WorkFlowStage, WorkFlowMessage.REFERENCE_WorkFlowMessage);_Steps = new MultipleAssociation<WorkFlowStage, WorkFlowStep> (this, MULTIPLEREFERENCE_Steps, WorkFlowStep.SINGLEREFERENCE_WorkFlowStage, WorkFlowStep.REFERENCE_WorkFlowStep);
return this;
}
......@@ -710,6 +757,106 @@ public abstract class BaseWorkFlowStage extends BaseBusinessClass
}
}
/**
* Attribute AutoProgress
*/
public Boolean getAutoProgress ()
{
assertValid();
Boolean valToReturn = AttributeDecoratorUtils.getValue (FIELD_AutoProgress_Decorators, (WorkFlowStage)this, FIELD_AutoProgress, _AutoProgress);
for (WorkFlowStageBehaviourDecorator bhd : WorkFlowStage_BehaviourDecorators)
{
valToReturn = bhd.getAutoProgress ((WorkFlowStage)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preAutoProgressChange (Boolean newAutoProgress) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postAutoProgressChange () throws FieldException
{
}
public FieldWriteability getWriteability_AutoProgress ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute AutoProgress. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setAutoProgress (Boolean newAutoProgress) throws FieldException
{
newAutoProgress = AttributeDecoratorUtils.setValue (FIELD_AutoProgress_Decorators, (WorkFlowStage)this, FIELD_AutoProgress, newAutoProgress);
boolean oldAndNewIdentical = HELPER_AutoProgress.compare (_AutoProgress, newAutoProgress);
try
{
for (WorkFlowStageBehaviourDecorator bhd : WorkFlowStage_BehaviourDecorators)
{
newAutoProgress = bhd.setAutoProgress ((WorkFlowStage)this, newAutoProgress);
oldAndNewIdentical = HELPER_AutoProgress.compare (_AutoProgress, newAutoProgress);
}
if (FIELD_AutoProgress_Validators.length > 0)
{
Object newAutoProgressObj = HELPER_AutoProgress.toObject (newAutoProgress);
if (newAutoProgressObj != null)
{
int loopMax = FIELD_AutoProgress_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_WorkFlowStage.get (FIELD_AutoProgress);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_AutoProgress_Validators[v].checkAttribute (this, FIELD_AutoProgress, metadata, newAutoProgressObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (AttributeDecoratorUtils.getWriteability (FIELD_AutoProgress_Decorators, (WorkFlowStage)this, FIELD_AutoProgress ,getWriteability_AutoProgress ()) != FieldWriteability.FALSE, "Field AutoProgress is not writeable");
preAutoProgressChange (newAutoProgress);
markFieldChange (FIELD_AutoProgress);
_AutoProgress = newAutoProgress;
postFieldChange (FIELD_AutoProgress);
postAutoProgressChange ();
}
}
/**
......@@ -1058,6 +1205,7 @@ public abstract class BaseWorkFlowStage extends BaseBusinessClass
List result = super.getMultiAssocs ();
result.add("WorkFlowMessages");
result.add("Steps");
return result;
}
......@@ -1072,6 +1220,10 @@ public abstract class BaseWorkFlowStage extends BaseBusinessClass
{
return WorkFlowMessage.REFERENCE_WorkFlowMessage ;
}
if (MULTIPLEREFERENCE_Steps.equals(attribName))
{
return WorkFlowStep.REFERENCE_WorkFlowStep ;
}
return super.getMultiAssocReferenceInstance(attribName);
}
......@@ -1083,6 +1235,10 @@ public abstract class BaseWorkFlowStage extends BaseBusinessClass
{
return WorkFlowMessage.SINGLEREFERENCE_WorkFlowStage ;
}
if (MULTIPLEREFERENCE_Steps.equals(attribName))
{
return WorkFlowStep.SINGLEREFERENCE_WorkFlowStage ;
}
return super.getMultiAssocBackReference(attribName);
}
......@@ -1097,6 +1253,10 @@ public abstract class BaseWorkFlowStage extends BaseBusinessClass
{
return this.getWorkFlowMessagesCount();
}
if (MULTIPLEREFERENCE_Steps.equals(attribName))
{
return this.getStepsCount();
}
return super.getMultiAssocCount(attribName);
}
......@@ -1111,6 +1271,10 @@ public abstract class BaseWorkFlowStage extends BaseBusinessClass
{
return this.getWorkFlowMessagesAt(index);
}
if (MULTIPLEREFERENCE_Steps.equals(attribName))
{
return this.getStepsAt(index);
}
return super.getMultiAssocAt(attribName, index);
}
......@@ -1126,6 +1290,11 @@ public abstract class BaseWorkFlowStage extends BaseBusinessClass
addToWorkFlowMessages((WorkFlowMessage)newElement);
return;
}
if (MULTIPLEREFERENCE_Steps.equals(attribName))
{
addToSteps((WorkFlowStep)newElement);
return;
}
super.addToMultiAssoc(attribName, newElement);
}
......@@ -1140,6 +1309,11 @@ public abstract class BaseWorkFlowStage extends BaseBusinessClass
removeFromWorkFlowMessages((WorkFlowMessage)oldElement);
return;
}
if (MULTIPLEREFERENCE_Steps.equals(attribName))
{
removeFromSteps((WorkFlowStep)oldElement);
return;
}
super.removeFromMultiAssoc(attribName, oldElement);
}
......@@ -1152,6 +1326,11 @@ public abstract class BaseWorkFlowStage extends BaseBusinessClass
_WorkFlowMessages.__loadAssociation (elements);
return;
}
if (MULTIPLEREFERENCE_Steps.equals(attribName))
{
_Steps.__loadAssociation (elements);
return;
}
super.__loadMultiAssoc(attribName, elements);
}
......@@ -1163,6 +1342,10 @@ public abstract class BaseWorkFlowStage extends BaseBusinessClass
{
return _WorkFlowMessages.isLoaded ();
}
if (MULTIPLEREFERENCE_Steps.equals(attribName))
{
return _Steps.isLoaded ();
}
return super.__isMultiAssocLoaded(attribName);
}
......@@ -1237,6 +1420,75 @@ public abstract class BaseWorkFlowStage extends BaseBusinessClass
return _WorkFlowMessages.getSet ();
}
public FieldWriteability getWriteability_Steps ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
public int getStepsCount () throws StorageException
{
assertValid();
return _Steps.getReferencedObjectsCount ();
}
public void addToSteps (WorkFlowStep newElement) throws StorageException
{
if (_Steps.wouldAddChange (newElement))
{
assertValid();
Debug.assertion (AttributeDecoratorUtils.getWriteability (MULTIPLEREFERENCE_Steps_Decorators, (WorkFlowStage)this, MULTIPLEREFERENCE_Steps ,getWriteability_Steps ()) != FieldWriteability.FALSE, "MultiAssoc Steps is not writeable (add)");
_Steps.appendElement (newElement);
try
{
if (newElement.getWorkFlowStage () != this)
{
newElement.setWorkFlowStage ((WorkFlowStage)(this));
}
}
catch (Exception e)
{
throw NestedException.wrap(e);
}
}
}
public void removeFromSteps (WorkFlowStep elementToRemove) throws StorageException
{
if (_Steps.wouldRemoveChange (elementToRemove))
{
assertValid();
Debug.assertion (AttributeDecoratorUtils.getWriteability (MULTIPLEREFERENCE_Steps_Decorators, (WorkFlowStage)this, MULTIPLEREFERENCE_Steps ,getWriteability_Steps ()) != FieldWriteability.FALSE, "MultiAssoc Steps is not writeable (remove)");
_Steps.removeElement (elementToRemove);
try
{
if (elementToRemove.getWorkFlowStage () != null)
{
elementToRemove.setWorkFlowStage (null);
}
}
catch (Exception e)
{
throw NestedException.wrap(e);
}
}
}
public WorkFlowStep getStepsAt (int index) throws StorageException
{
return (WorkFlowStep)(_Steps.getElementAt (index));
}
public SortedSet<WorkFlowStep> getStepsSet () throws StorageException
{
return _Steps.getSet ();
}
public void onDelete ()
......@@ -1263,6 +1515,12 @@ public abstract class BaseWorkFlowStage extends BaseBusinessClass
referenced.setWorkFlowStage(null);
}
for(WorkFlowStep referenced : CollectionUtils.reverse(getStepsSet()))
{
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Setting backreference to null WorkFlowStage from ", getObjectID (), " to ", referenced.getObjectID ());
referenced.setWorkFlowStage(null);
}
}
catch (Exception e)
{
......@@ -1324,6 +1582,7 @@ public abstract class BaseWorkFlowStage extends BaseBusinessClass
tl_work_flow_stagePSet.setAttrib (FIELD_UseMessaging, HELPER_UseMessaging.toObject (_UseMessaging)); //
tl_work_flow_stagePSet.setAttrib (FIELD_StageType, HELPER_StageType.toObject (_StageType)); //
tl_work_flow_stagePSet.setAttrib (FIELD_SortOrder, HELPER_SortOrder.toObject (_SortOrder)); //
tl_work_flow_stagePSet.setAttrib (FIELD_AutoProgress, HELPER_AutoProgress.toObject (_AutoProgress)); //
_WithdrawalMessage.getPersistentSets (allSets);
_WorkFlowTemplate.getPersistentSets (allSets);
......@@ -1343,6 +1602,7 @@ public abstract class BaseWorkFlowStage extends BaseBusinessClass
_UseMessaging = (Boolean)(HELPER_UseMessaging.fromObject (_UseMessaging, tl_work_flow_stagePSet.getAttrib (FIELD_UseMessaging))); //
_StageType = (StageType)(HELPER_StageType.fromObject (_StageType, tl_work_flow_stagePSet.getAttrib (FIELD_StageType))); //
_SortOrder = (Integer)(HELPER_SortOrder.fromObject (_SortOrder, tl_work_flow_stagePSet.getAttrib (FIELD_SortOrder))); //
_AutoProgress = (Boolean)(HELPER_AutoProgress.fromObject (_AutoProgress, tl_work_flow_stagePSet.getAttrib (FIELD_AutoProgress))); //
_WithdrawalMessage.setFromPersistentSets (objectID, allSets);
_WorkFlowTemplate.setFromPersistentSets (objectID, allSets);
......@@ -1393,6 +1653,15 @@ public abstract class BaseWorkFlowStage extends BaseBusinessClass
{
e.addException (ex);
}
try
{
setAutoProgress (otherWorkFlowStage.getAutoProgress ());
}
catch (FieldException ex)
{
e.addException (ex);
}
}
}
......@@ -1412,6 +1681,7 @@ public abstract class BaseWorkFlowStage extends BaseBusinessClass
_UseMessaging = sourceWorkFlowStage._UseMessaging;
_StageType = sourceWorkFlowStage._StageType;
_SortOrder = sourceWorkFlowStage._SortOrder;
_AutoProgress = sourceWorkFlowStage._AutoProgress;
}
}
......@@ -1447,6 +1717,7 @@ public abstract class BaseWorkFlowStage extends BaseBusinessClass
BaseWorkFlowStage sourceWorkFlowStage = (BaseWorkFlowStage)(source);
_WorkFlowMessages.copyFrom (sourceWorkFlowStage._WorkFlowMessages, linkToGhosts);
_Steps.copyFrom (sourceWorkFlowStage._Steps, linkToGhosts);
}
}
......@@ -1473,9 +1744,11 @@ public abstract class BaseWorkFlowStage extends BaseBusinessClass
_UseMessaging = (Boolean)(HELPER_UseMessaging.readExternal (_UseMessaging, vals.get(FIELD_UseMessaging))); //
_StageType = (StageType)(HELPER_StageType.readExternal (_StageType, vals.get(FIELD_StageType))); //
_SortOrder = (Integer)(HELPER_SortOrder.readExternal (_SortOrder, vals.get(FIELD_SortOrder))); //
_AutoProgress = (Boolean)(HELPER_AutoProgress.readExternal (_AutoProgress, vals.get(FIELD_AutoProgress))); //
_WithdrawalMessage.readExternalData(vals.get(SINGLEREFERENCE_WithdrawalMessage));
_WorkFlowTemplate.readExternalData(vals.get(SINGLEREFERENCE_WorkFlowTemplate));
_WorkFlowMessages.readExternalData(vals.get(MULTIPLEREFERENCE_WorkFlowMessages));
_Steps.readExternalData(vals.get(MULTIPLEREFERENCE_Steps));
}
......@@ -1491,9 +1764,11 @@ public abstract class BaseWorkFlowStage extends BaseBusinessClass
vals.put (FIELD_UseMessaging, HELPER_UseMessaging.writeExternal (_UseMessaging));
vals.put (FIELD_StageType, HELPER_StageType.writeExternal (_StageType));
vals.put (FIELD_SortOrder, HELPER_SortOrder.writeExternal (_SortOrder));
vals.put (FIELD_AutoProgress, HELPER_AutoProgress.writeExternal (_AutoProgress));
vals.put (SINGLEREFERENCE_WithdrawalMessage, _WithdrawalMessage.writeExternalData());
vals.put (SINGLEREFERENCE_WorkFlowTemplate, _WorkFlowTemplate.writeExternalData());
vals.put (MULTIPLEREFERENCE_WorkFlowMessages, _WorkFlowMessages.writeExternalData());
vals.put (MULTIPLEREFERENCE_Steps, _Steps.writeExternalData());
}
......@@ -1523,6 +1798,10 @@ public abstract class BaseWorkFlowStage extends BaseBusinessClass
{
listener.notifyFieldChange(this, other, FIELD_SortOrder, HELPER_SortOrder.toObject(this._SortOrder), HELPER_SortOrder.toObject(otherWorkFlowStage._SortOrder));
}
if (!HELPER_AutoProgress.compare(this._AutoProgress, otherWorkFlowStage._AutoProgress))
{
listener.notifyFieldChange(this, other, FIELD_AutoProgress, HELPER_AutoProgress.toObject(this._AutoProgress), HELPER_AutoProgress.toObject(otherWorkFlowStage._AutoProgress));
}
// Compare single assocs
_WithdrawalMessage.compare (otherWorkFlowStage._WithdrawalMessage, listener);
......@@ -1531,6 +1810,7 @@ public abstract class BaseWorkFlowStage extends BaseBusinessClass
// Compare multiple assocs
_WorkFlowMessages.compare (otherWorkFlowStage._WorkFlowMessages, listener);
_Steps.compare (otherWorkFlowStage._Steps, listener);
}
}
......@@ -1552,9 +1832,11 @@ public abstract class BaseWorkFlowStage extends BaseBusinessClass
visitor.visitField(this, FIELD_UseMessaging, HELPER_UseMessaging.toObject(getUseMessaging()));
visitor.visitField(this, FIELD_StageType, HELPER_StageType.toObject(getStageType()));
visitor.visitField(this, FIELD_SortOrder, HELPER_SortOrder.toObject(getSortOrder()));
visitor.visitField(this, FIELD_AutoProgress, HELPER_AutoProgress.toObject(getAutoProgress()));
visitor.visitAssociation (_WithdrawalMessage);
visitor.visitAssociation (_WorkFlowTemplate);
visitor.visitAssociation (_WorkFlowMessages);
visitor.visitAssociation (_Steps);
}
......@@ -1575,6 +1857,10 @@ public abstract class BaseWorkFlowStage extends BaseBusinessClass
{
visitor.visit (_WorkFlowMessages);
}
if (scope.includes (_Steps))
{
visitor.visit (_Steps);
}
}
......@@ -1616,6 +1902,10 @@ public abstract class BaseWorkFlowStage extends BaseBusinessClass
{
return filter.matches (getSortOrder ());
}
else if (attribName.equals (FIELD_AutoProgress))
{
return filter.matches (getAutoProgress ());
}
else if (attribName.equals (SINGLEREFERENCE_WithdrawalMessage))
{
return filter.matches (getWithdrawalMessage ());
......@@ -1678,6 +1968,12 @@ public abstract class BaseWorkFlowStage extends BaseBusinessClass
return this;
}
public SearchAll andAutoProgress (QueryFilter<Boolean> filter)
{
filter.addFilter (context, "tl_work_flow_stage.auto_progress", "AutoProgress");
return this;
}
public SearchAll andWithdrawalMessage (QueryFilter<WorkFlowMessage> filter)
{
filter.addFilter (context, "tl_work_flow_stage.withdrawal_message_id", "WithdrawalMessage");
......@@ -1738,6 +2034,10 @@ public abstract class BaseWorkFlowStage extends BaseBusinessClass
{
return HELPER_SortOrder.toObject (getSortOrder ());
}
else if (attribName.equals (FIELD_AutoProgress))
{
return HELPER_AutoProgress.toObject (getAutoProgress ());
}
else
{
return super.getAttribute (attribName);
......@@ -1767,6 +2067,10 @@ public abstract class BaseWorkFlowStage extends BaseBusinessClass
{
return HELPER_SortOrder;
}
else if (attribName.equals (FIELD_AutoProgress))
{
return HELPER_AutoProgress;
}
else
{
return super.getAttributeHelper (attribName);
......@@ -1796,6 +2100,10 @@ public abstract class BaseWorkFlowStage extends BaseBusinessClass
{
setSortOrder ((Integer)(HELPER_SortOrder.fromObject (_SortOrder, attribValue)));
}
else if (attribName.equals (FIELD_AutoProgress))
{
setAutoProgress ((Boolean)(HELPER_AutoProgress.fromObject (_AutoProgress, attribValue)));
}
else
{
super.setAttribute (attribName, attribValue);
......@@ -1842,10 +2150,18 @@ public abstract class BaseWorkFlowStage extends BaseBusinessClass
{
return getWriteability_SortOrder ();
}
else if (fieldName.equals (FIELD_AutoProgress))
{
return getWriteability_AutoProgress ();
}
else if (fieldName.equals (MULTIPLEREFERENCE_WorkFlowMessages))
{
return getWriteability_WorkFlowMessages ();
}
else if (fieldName.equals (MULTIPLEREFERENCE_Steps))
{
return getWriteability_Steps ();
}
else if (fieldName.equals (SINGLEREFERENCE_WithdrawalMessage))
{
return getWriteability_WithdrawalMessage ();
......@@ -1883,6 +2199,11 @@ public abstract class BaseWorkFlowStage extends BaseBusinessClass
fields.add (FIELD_SortOrder);
}
if (getWriteability_AutoProgress () != FieldWriteability.TRUE)
{
fields.add (FIELD_AutoProgress);
}
super.putUnwriteable (fields);
}
......@@ -1907,6 +2228,7 @@ public abstract class BaseWorkFlowStage extends BaseBusinessClass
result.add(HELPER_UseMessaging.getAttribObject (getClass (), _UseMessaging, false, FIELD_UseMessaging));
result.add(HELPER_StageType.getAttribObject (getClass (), _StageType, true, FIELD_StageType));
result.add(HELPER_SortOrder.getAttribObject (getClass (), _SortOrder, true, FIELD_SortOrder));
result.add(HELPER_AutoProgress.getAttribObject (getClass (), _AutoProgress, false, FIELD_AutoProgress));
return result;
}
......@@ -2036,6 +2358,24 @@ public abstract class BaseWorkFlowStage extends BaseBusinessClass
return newSortOrder;
}
/**
* Get the attribute AutoProgress
*/
public Boolean getAutoProgress (WorkFlowStage obj, Boolean original)
{
return original;
}
/**
* Change the value set for attribute AutoProgress.
* May modify the field beforehand
* Occurs before validation.
*/
public Boolean setAutoProgress (WorkFlowStage obj, Boolean newAutoProgress) throws FieldException
{
return newAutoProgress;
}
}
@Override
......@@ -2098,6 +2438,10 @@ public abstract class BaseWorkFlowStage extends BaseBusinessClass
{
return toWorkFlowMessages ();
}
if (name.equals ("Steps"))
{
return toSteps ();
}
if (name.equals ("Name"))
{
return toName ();
......@@ -2114,6 +2458,10 @@ public abstract class BaseWorkFlowStage extends BaseBusinessClass
{
return toSortOrder ();
}
if (name.equals ("AutoProgress"))
{
return toAutoProgress ();
}
if (name.equals ("WithdrawalMessage"))
{
return toWithdrawalMessage ();
......@@ -2139,6 +2487,8 @@ public abstract class BaseWorkFlowStage extends BaseBusinessClass
public PipeLine<From, Integer> toSortOrder () { return pipe(new ORMAttributePipe<Me, Integer>(FIELD_SortOrder)); }
public PipeLine<From, Boolean> toAutoProgress () { return pipe(new ORMAttributePipe<Me, Boolean>(FIELD_AutoProgress)); }
public WorkFlowMessage.WorkFlowMessagePipeLineFactory<From, WorkFlowMessage> toWithdrawalMessage () { return toWithdrawalMessage (Filter.ALL); }
public WorkFlowMessage.WorkFlowMessagePipeLineFactory<From, WorkFlowMessage> toWithdrawalMessage (Filter<WorkFlowMessage> filter)
......@@ -2159,6 +2509,13 @@ public abstract class BaseWorkFlowStage extends BaseBusinessClass
{
return WorkFlowMessage.REFERENCE_WorkFlowMessage.new WorkFlowMessagePipeLineFactory<From, WorkFlowMessage> (this, new ORMMultiAssocPipe<Me, WorkFlowMessage>(MULTIPLEREFERENCE_WorkFlowMessages, filter));
}
public WorkFlowStep.WorkFlowStepPipeLineFactory<From, WorkFlowStep> toSteps () { return toSteps(Filter.ALL); }
public WorkFlowStep.WorkFlowStepPipeLineFactory<From, WorkFlowStep> toSteps (Filter<WorkFlowStep> filter)
{
return WorkFlowStep.REFERENCE_WorkFlowStep.new WorkFlowStepPipeLineFactory<From, WorkFlowStep> (this, new ORMMultiAssocPipe<Me, WorkFlowStep>(MULTIPLEREFERENCE_Steps, filter));
}
}
public boolean isTransientAttrib(String attribName)
......@@ -2234,6 +2591,23 @@ class DummyWorkFlowStage extends WorkFlowStage
return new TreeSet();
}
public int getStepsCount () throws StorageException
{
return 0;
}
public WorkFlowStep getStepsAt (int index) throws StorageException
{
throw new RuntimeException ("No elements in a dummy object in association Steps");
}
public SortedSet getStepsSet () throws StorageException
{
return new TreeSet();
}
}
/*
* IMPORTANT!!!! XSL Autogenerated class, DO NOT EDIT!!!!!
* Template: Infrastructure9.0 [oneit.objstore.BusinessObjectTemplate.xsl]
* Vendor: Apache Software Foundation (Xalan XSLTC) (Version: 1.0)
*/
package performa.orm;
import java.io.*;
import java.util.*;
import oneit.appservices.config.*;
import oneit.logging.*;
import oneit.objstore.*;
import oneit.objstore.assocs.*;
import oneit.objstore.attributes.*;
import oneit.objstore.rdbms.filters.*;
import oneit.objstore.parser.*;
import oneit.objstore.validator.*;
import oneit.objstore.utils.*;
import oneit.utils.*;
import oneit.utils.filter.Filter;
import oneit.utils.transform.*;
import oneit.utils.parsers.FieldException;
import performa.orm.types.*;
public abstract class BaseWorkFlowStep extends BaseBusinessClass
{
// Reference instance for the object
public static final WorkFlowStep REFERENCE_WorkFlowStep = new WorkFlowStep ();
// Reference instance for the object
public static final WorkFlowStep DUMMY_WorkFlowStep = new DummyWorkFlowStep ();
// Static constants corresponding to field names
public static final String FIELD_SortOrder = "SortOrder";
public static final String FIELD_StepType = "StepType";
public static final String SINGLEREFERENCE_WorkFlowStage = "WorkFlowStage";
public static final String BACKREF_WorkFlowStage = "";
// Static constants corresponding to searches
public static final String SEARCH_All = "All";
// Static constants corresponding to attribute helpers
private static final DefaultAttributeHelper<WorkFlowStep> HELPER_SortOrder = DefaultAttributeHelper.INSTANCE;
private static final EnumeratedAttributeHelper<WorkFlowStep, StepType> HELPER_StepType = new EnumeratedAttributeHelper<WorkFlowStep, StepType> (StepType.FACTORY_StepType);
// Private attributes corresponding to business object data
private Integer _SortOrder;
private StepType _StepType;
// Private attributes corresponding to single references
private SingleAssociation<WorkFlowStep, WorkFlowStage> _WorkFlowStage;
// Private attributes corresponding to multiple references
// Map of maps of metadata
private static final Map ATTRIBUTES_METADATA_WorkFlowStep = new LinkedHashMap ();
// Arrays of validators for each attribute
private static final AttributeValidator[] FIELD_SortOrder_Validators;
private static final AttributeValidator[] FIELD_StepType_Validators;
// Arrays of AttributeDecorators for each attribute
private static final AttributeDecorator<WorkFlowStep, Integer>[] FIELD_SortOrder_Decorators;
private static final AttributeDecorator<WorkFlowStep, StepType>[] FIELD_StepType_Decorators;
// Arrays of SingleAssocDecorators for each attribute
private static final SingleAssocDecorator<WorkFlowStep, WorkFlowStage>[] SINGLEREFERENCE_WorkFlowStage_Decorators;
// Arrays of MultiAssocDecorators for each attribute
// Arrays of behaviour decorators
private static final WorkFlowStepBehaviourDecorator[] WorkFlowStep_BehaviourDecorators;
static
{
try
{
String tmp_WorkFlowStage = WorkFlowStage.BACKREF_Steps;
Map validatorMapping = ((Map)ConfigMgr.getConfigObject ("CONFIG.ORMVALIDATOR", "ValidatorMapping"));
setupAssocMetaData_WorkFlowStage();
FIELD_SortOrder_Validators = (AttributeValidator[])setupAttribMetaData_SortOrder(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_StepType_Validators = (AttributeValidator[])setupAttribMetaData_StepType(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_SortOrder_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_WorkFlowStep, FIELD_SortOrder).toArray (new AttributeDecorator[0]);
FIELD_StepType_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_WorkFlowStep, FIELD_StepType).toArray (new AttributeDecorator[0]);
SINGLEREFERENCE_WorkFlowStage_Decorators = (SingleAssocDecorator[])AttributeDecoratorUtils.getSingleAssocDecorators(REFERENCE_WorkFlowStep, SINGLEREFERENCE_WorkFlowStage).toArray (new SingleAssocDecorator[0]);
REFERENCE_WorkFlowStep.initialiseReference ();
DUMMY_WorkFlowStep.initialiseReference ();
WorkFlowStep_BehaviourDecorators = BaseBusinessClass.getBBCBehaviours(WorkFlowStep.class).toArray(new WorkFlowStepBehaviourDecorator[0]);
}
catch (RuntimeException e)
{
LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR1, e, "Error initialising");
throw e;
}
}
private static void setupAssocMetaData_WorkFlowStage()
{
Map metaInfo = new HashMap ();
metaInfo.put ("backreferenceName", "Steps");
metaInfo.put ("dbcol", "work_flow_stage_id");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "WorkFlowStage");
metaInfo.put ("type", "WorkFlowStage");
metaInfo.put (METADATA_DB_TABLENAME, "tl_work_flow_step");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for WorkFlowStep.WorkFlowStage:", metaInfo);
ATTRIBUTES_METADATA_WorkFlowStep.put (SINGLEREFERENCE_WorkFlowStage, Collections.unmodifiableMap (metaInfo));
}
private static List setupAttribMetaData_SortOrder(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "sort_order");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "SortOrder");
metaInfo.put ("type", "Integer");
metaInfo.put (METADATA_DB_TABLENAME, "tl_work_flow_step");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for WorkFlowStep.SortOrder:", metaInfo);
ATTRIBUTES_METADATA_WorkFlowStep.put (FIELD_SortOrder, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(WorkFlowStep.class, "SortOrder", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for WorkFlowStep.SortOrder:", validators);
return validators;
}
private static List setupAttribMetaData_StepType(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("attribHelper", "EnumeratedAttributeHelper");
metaInfo.put ("dbcol", "step_type");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "StepType");
metaInfo.put ("type", "StepType");
metaInfo.put (METADATA_DB_TABLENAME, "tl_work_flow_step");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for WorkFlowStep.StepType:", metaInfo);
ATTRIBUTES_METADATA_WorkFlowStep.put (FIELD_StepType, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(WorkFlowStep.class, "StepType", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for WorkFlowStep.StepType:", validators);
return validators;
}
// END OF STATIC METADATA DEFINITION
// This constructor should not be called
protected BaseWorkFlowStep ()
{
}
protected BBCBehaviourDecorator[] getBehaviours()
{
return WorkFlowStep_BehaviourDecorators;
}
protected void _initialiseNewObjAttributes (ObjectTransaction transaction) throws StorageException
{
super._initialiseNewObjAttributes (transaction);
_SortOrder = (Integer)(HELPER_SortOrder.initialise (_SortOrder));
_StepType = (StepType)(HELPER_StepType.initialise (_StepType));
}
protected void _initialiseAssociations ()
{
super._initialiseAssociations ();
_WorkFlowStage = new SingleAssociation<WorkFlowStep, WorkFlowStage> (this, SINGLEREFERENCE_WorkFlowStage, WorkFlowStage.MULTIPLEREFERENCE_Steps, WorkFlowStage.REFERENCE_WorkFlowStage, "tl_work_flow_step");
}
protected BaseBusinessClass initialiseReference ()
{
super.initialiseReference ();
_WorkFlowStage = new SingleAssociation<WorkFlowStep, WorkFlowStage> (this, SINGLEREFERENCE_WorkFlowStage, WorkFlowStage.MULTIPLEREFERENCE_Steps, WorkFlowStage.REFERENCE_WorkFlowStage, "tl_work_flow_step");
return this;
}
/**
* Attribute SortOrder
*/
public Integer getSortOrder ()
{
assertValid();
Integer valToReturn = AttributeDecoratorUtils.getValue (FIELD_SortOrder_Decorators, (WorkFlowStep)this, FIELD_SortOrder, _SortOrder);
for (WorkFlowStepBehaviourDecorator bhd : WorkFlowStep_BehaviourDecorators)
{
valToReturn = bhd.getSortOrder ((WorkFlowStep)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preSortOrderChange (Integer newSortOrder) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postSortOrderChange () throws FieldException
{
}
public FieldWriteability getWriteability_SortOrder ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute SortOrder. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setSortOrder (Integer newSortOrder) throws FieldException
{
newSortOrder = AttributeDecoratorUtils.setValue (FIELD_SortOrder_Decorators, (WorkFlowStep)this, FIELD_SortOrder, newSortOrder);
boolean oldAndNewIdentical = HELPER_SortOrder.compare (_SortOrder, newSortOrder);
try
{
for (WorkFlowStepBehaviourDecorator bhd : WorkFlowStep_BehaviourDecorators)
{
newSortOrder = bhd.setSortOrder ((WorkFlowStep)this, newSortOrder);
oldAndNewIdentical = HELPER_SortOrder.compare (_SortOrder, newSortOrder);
}
BusinessObjectParser.assertFieldCondition (newSortOrder != null, this, FIELD_SortOrder, "mandatory");
if (FIELD_SortOrder_Validators.length > 0)
{
Object newSortOrderObj = HELPER_SortOrder.toObject (newSortOrder);
if (newSortOrderObj != null)
{
int loopMax = FIELD_SortOrder_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_WorkFlowStep.get (FIELD_SortOrder);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_SortOrder_Validators[v].checkAttribute (this, FIELD_SortOrder, metadata, newSortOrderObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (AttributeDecoratorUtils.getWriteability (FIELD_SortOrder_Decorators, (WorkFlowStep)this, FIELD_SortOrder ,getWriteability_SortOrder ()) != FieldWriteability.FALSE, "Field SortOrder is not writeable");
preSortOrderChange (newSortOrder);
markFieldChange (FIELD_SortOrder);
_SortOrder = newSortOrder;
postFieldChange (FIELD_SortOrder);
postSortOrderChange ();
}
}
/**
* Attribute StepType
*/
public StepType getStepType ()
{
assertValid();
StepType valToReturn = AttributeDecoratorUtils.getValue (FIELD_StepType_Decorators, (WorkFlowStep)this, FIELD_StepType, _StepType);
for (WorkFlowStepBehaviourDecorator bhd : WorkFlowStep_BehaviourDecorators)
{
valToReturn = bhd.getStepType ((WorkFlowStep)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preStepTypeChange (StepType newStepType) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postStepTypeChange () throws FieldException
{
}
public FieldWriteability getWriteability_StepType ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute StepType. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setStepType (StepType newStepType) throws FieldException
{
newStepType = AttributeDecoratorUtils.setValue (FIELD_StepType_Decorators, (WorkFlowStep)this, FIELD_StepType, newStepType);
boolean oldAndNewIdentical = HELPER_StepType.compare (_StepType, newStepType);
try
{
for (WorkFlowStepBehaviourDecorator bhd : WorkFlowStep_BehaviourDecorators)
{
newStepType = bhd.setStepType ((WorkFlowStep)this, newStepType);
oldAndNewIdentical = HELPER_StepType.compare (_StepType, newStepType);
}
BusinessObjectParser.assertFieldCondition (newStepType != null, this, FIELD_StepType, "mandatory");
if (FIELD_StepType_Validators.length > 0)
{
Object newStepTypeObj = HELPER_StepType.toObject (newStepType);
if (newStepTypeObj != null)
{
int loopMax = FIELD_StepType_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_WorkFlowStep.get (FIELD_StepType);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_StepType_Validators[v].checkAttribute (this, FIELD_StepType, metadata, newStepTypeObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (AttributeDecoratorUtils.getWriteability (FIELD_StepType_Decorators, (WorkFlowStep)this, FIELD_StepType ,getWriteability_StepType ()) != FieldWriteability.FALSE, "Field StepType is not writeable");
preStepTypeChange (newStepType);
markFieldChange (FIELD_StepType);
_StepType = newStepType;
postFieldChange (FIELD_StepType);
postStepTypeChange ();
}
}
/**
* A list of multi assoc names e.g. list of strings.
*/
public List<String> getSingleAssocs()
{
List result = super.getSingleAssocs ();
result.add("WorkFlowStage");
return result;
}
public BaseBusinessClass getSingleAssocReferenceInstance (String assocName)
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else if (assocName.equals (SINGLEREFERENCE_WorkFlowStage))
{
return _WorkFlowStage.getReferencedType ();
}
else
{
return super.getSingleAssocReferenceInstance (assocName);
}
}
public String getSingleAssocBackReference(String assocName)
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else if (assocName.equals (SINGLEREFERENCE_WorkFlowStage))
{
return WorkFlowStage.MULTIPLEREFERENCE_Steps ;
}
else
{
return super.getSingleAssocBackReference (assocName);
}
}
public BaseBusinessClass getSingleAssoc (String assocName) throws StorageException
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else if (assocName.equals (SINGLEREFERENCE_WorkFlowStage))
{
return getWorkFlowStage ();
}
else
{
return super.getSingleAssoc (assocName);
}
}
public BaseBusinessClass getSingleAssoc (String assocName, Get getType) throws StorageException
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else if (assocName.equals (SINGLEREFERENCE_WorkFlowStage))
{
return getWorkFlowStage (getType);
}
else
{
return super.getSingleAssoc (assocName, getType);
}
}
public Long getSingleAssocID (String assocName) throws StorageException
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else if (assocName.equals (SINGLEREFERENCE_WorkFlowStage))
{
return getWorkFlowStageID ();
}
else
{
return super.getSingleAssocID (assocName);
}
}
public void setSingleAssoc (String assocName, BaseBusinessClass newValue) throws StorageException, FieldException
{
if (assocName == null)
{
throw new RuntimeException ("Game over == null!");
}
else if (assocName.equals (SINGLEREFERENCE_WorkFlowStage))
{
setWorkFlowStage ((WorkFlowStage)(newValue));
}
else
{
super.setSingleAssoc (assocName, newValue);
}
}
/**
* Get the reference WorkFlowStage
*/
public WorkFlowStage getWorkFlowStage () throws StorageException
{
assertValid();
try
{
return (WorkFlowStage)(_WorkFlowStage.get ());
}
catch (ClassCastException e)
{
LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR2, "Cache collision in WorkFlowStep:", this.getObjectID (), ", was trying to get WorkFlowStage:", getWorkFlowStageID ());
LogMgr.log (BUSINESS_OBJECTS, LogLevel.SYSTEMERROR2, "Instead I got:", _WorkFlowStage.get ().getClass ());
throw e;
}
}
/**
* Get the object id for the referenced object. Does not force a DB access.
*/
public WorkFlowStage getWorkFlowStage (Get getType) throws StorageException
{
assertValid();
return _WorkFlowStage.get(getType);
}
/**
* Get the object id for the referenced object. Does not force a DB access.
*/
public Long getWorkFlowStageID ()
{
assertValid();
if (_WorkFlowStage == null)
{
return null;
}
else
{
return _WorkFlowStage.getID ();
}
}
/**
* Called prior to the assoc changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preWorkFlowStageChange (WorkFlowStage newWorkFlowStage) throws FieldException
{
}
/**
* Called after the assoc changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postWorkFlowStageChange () throws FieldException
{
}
public FieldWriteability getWriteability_WorkFlowStage ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the reference WorkFlowStage. Checks to ensure a new value
* has been supplied. If so, marks the reference as altered and sets it.
*/
public void setWorkFlowStage (WorkFlowStage newWorkFlowStage) throws StorageException, FieldException
{
BusinessObjectParser.assertFieldCondition (newWorkFlowStage != null, this, SINGLEREFERENCE_WorkFlowStage, "mandatory");
if (_WorkFlowStage.wouldReferencedChange (newWorkFlowStage))
{
assertValid();
Debug.assertion (AttributeDecoratorUtils.getWriteability (SINGLEREFERENCE_WorkFlowStage_Decorators, (WorkFlowStep)this, SINGLEREFERENCE_WorkFlowStage ,getWriteability_WorkFlowStage ()) != FieldWriteability.FALSE, "Assoc WorkFlowStage is not writeable");
preWorkFlowStageChange (newWorkFlowStage);
WorkFlowStage oldWorkFlowStage = getWorkFlowStage ();
if (oldWorkFlowStage != null)
{
// This is to stop validation from triggering when we are removed
_WorkFlowStage.set (null);
oldWorkFlowStage.removeFromSteps ((WorkFlowStep)(this));
}
_WorkFlowStage.set (newWorkFlowStage);
if (newWorkFlowStage != null)
{
newWorkFlowStage.addToSteps ((WorkFlowStep)(this));
}
postWorkFlowStageChange ();
}
}
/**
* A list of multi assoc names e.g. list of strings.
*/
public List<String> getMultiAssocs()
{
List result = super.getMultiAssocs ();
return result;
}
/**
* Get the reference instance for the multi assoc name.
*/
public BaseBusinessClass getMultiAssocReferenceInstance(String attribName)
{
return super.getMultiAssocReferenceInstance(attribName);
}
public String getMultiAssocBackReference(String attribName)
{
return super.getMultiAssocBackReference(attribName);
}
/**
* Get the assoc count for the multi assoc name.
*/
public int getMultiAssocCount(String attribName) throws StorageException
{
return super.getMultiAssocCount(attribName);
}
/**
* Get the assoc at a particular index
*/
public BaseBusinessClass getMultiAssocAt(String attribName, int index) throws StorageException
{
return super.getMultiAssocAt(attribName, index);
}
/**
* Add to a multi assoc by attribute name
*/
public void addToMultiAssoc(String attribName, BaseBusinessClass newElement) throws StorageException
{
super.addToMultiAssoc(attribName, newElement);
}
/**
* Remove from a multi assoc by attribute name
*/
public void removeFromMultiAssoc(String attribName, BaseBusinessClass oldElement) throws StorageException
{
super.removeFromMultiAssoc(attribName, oldElement);
}
protected void __loadMultiAssoc (String attribName, BaseBusinessClass[] elements)
{
super.__loadMultiAssoc(attribName, elements);
}
protected boolean __isMultiAssocLoaded (String attribName)
{
return super.__isMultiAssocLoaded(attribName);
}
public void onDelete ()
{
try
{
// Ensure we are removed from any loaded multi-associations that aren't mandatory
if (_WorkFlowStage.isLoaded () || getTransaction ().isObjectLoaded (_WorkFlowStage.getReferencedType (), getWorkFlowStageID ()))
{
WorkFlowStage referenced = getWorkFlowStage ();
if (referenced != null)
{
// Stop the callback
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Setting backreference to null Steps from ", getObjectID (), " to ", referenced.getObjectID ());
_WorkFlowStage.set (null);
referenced.removeFromSteps ((WorkFlowStep)this);
}
}
}
catch (Exception e)
{
throw NestedException.wrap(e);
}
super.onDelete ();
}
public WorkFlowStep newInstance ()
{
return new WorkFlowStep ();
}
public WorkFlowStep referenceInstance ()
{
return REFERENCE_WorkFlowStep;
}
public WorkFlowStep getInTransaction (ObjectTransaction t) throws StorageException
{
return getWorkFlowStepByID (t, getObjectID());
}
public BaseBusinessClass dummyInstance ()
{
return DUMMY_WorkFlowStep;
}
public String getBaseSetName ()
{
return "tl_work_flow_step";
}
/**
* This is where an object returns the Persistent sets that will
* store it into the database.
* The should be entered into allSets
*/
public void getPersistentSets (PersistentSetCollection allSets)
{
ObjectStatus myStatus = getStatus ();
PersistentSetStatus myPSetStatus = myStatus.getPSetStatus();
ObjectID myID = getID();
super.getPersistentSets (allSets);
PersistentSet tl_work_flow_stepPSet = allSets.getPersistentSet (myID, "tl_work_flow_step", myPSetStatus);
tl_work_flow_stepPSet.setAttrib (FIELD_ObjectID, myID);
tl_work_flow_stepPSet.setAttrib (FIELD_SortOrder, HELPER_SortOrder.toObject (_SortOrder)); //
tl_work_flow_stepPSet.setAttrib (FIELD_StepType, HELPER_StepType.toObject (_StepType)); //
_WorkFlowStage.getPersistentSets (allSets);
}
/**
* Sets the objects state based on Persistent sets.
*/
public void setFromPersistentSets (ObjectID objectID, PersistentSetCollection allSets)
{
super.setFromPersistentSets (objectID, allSets);
PersistentSet tl_work_flow_stepPSet = allSets.getPersistentSet (objectID, "tl_work_flow_step");
_SortOrder = (Integer)(HELPER_SortOrder.fromObject (_SortOrder, tl_work_flow_stepPSet.getAttrib (FIELD_SortOrder))); //
_StepType = (StepType)(HELPER_StepType.fromObject (_StepType, tl_work_flow_stepPSet.getAttrib (FIELD_StepType))); //
_WorkFlowStage.setFromPersistentSets (objectID, allSets);
}
public void setAttributesFrom (BaseBusinessClass other, MultiException e)
{
super.setAttributesFrom (other, e);
if (other instanceof WorkFlowStep)
{
WorkFlowStep otherWorkFlowStep = (WorkFlowStep)other;
try
{
setSortOrder (otherWorkFlowStep.getSortOrder ());
}
catch (FieldException ex)
{
e.addException (ex);
}
try
{
setStepType (otherWorkFlowStep.getStepType ());
}
catch (FieldException ex)
{
e.addException (ex);
}
}
}
/**
* Set the attributes in this to copies of the attributes in source.
*/
public void copyAttributesFrom (BaseBusinessClass source)
{
super.copyAttributesFrom (source);
if (source instanceof BaseWorkFlowStep)
{
BaseWorkFlowStep sourceWorkFlowStep = (BaseWorkFlowStep)(source);
_SortOrder = sourceWorkFlowStep._SortOrder;
_StepType = sourceWorkFlowStep._StepType;
}
}
/**
* Set the associations in this to copies of the attributes in source.
*/
public void copySingleAssociationsFrom (BaseBusinessClass source, boolean linkToGhosts)
{
super.copySingleAssociationsFrom (source, linkToGhosts);
if (source instanceof BaseWorkFlowStep)
{
BaseWorkFlowStep sourceWorkFlowStep = (BaseWorkFlowStep)(source);
_WorkFlowStage.copyFrom (sourceWorkFlowStep._WorkFlowStage, linkToGhosts);
}
}
/**
* Set the associations in this to copies of the attributes in source.
*/
public void copyAssociationsFrom (BaseBusinessClass source, boolean linkToGhosts)
{
super.copyAssociationsFrom (source, linkToGhosts);
if (source instanceof BaseWorkFlowStep)
{
BaseWorkFlowStep sourceWorkFlowStep = (BaseWorkFlowStep)(source);
}
}
public void validate (ValidationContext context)
{
super.validate (context);
context.check (getWorkFlowStageID() != null, this, SINGLEREFERENCE_WorkFlowStage, "mandatory");
}
/**
* Subclasses must override this to read in their attributes
*/
protected void readExternalData(Map<String, Object> vals) throws IOException, ClassNotFoundException
{
super.readExternalData(vals);
_SortOrder = (Integer)(HELPER_SortOrder.readExternal (_SortOrder, vals.get(FIELD_SortOrder))); //
_StepType = (StepType)(HELPER_StepType.readExternal (_StepType, vals.get(FIELD_StepType))); //
_WorkFlowStage.readExternalData(vals.get(SINGLEREFERENCE_WorkFlowStage));
}
/**
* Subclasses must override this to write out their attributes
*/
protected void writeExternalData(Map<String, Object> vals) throws IOException
{
super.writeExternalData(vals);
vals.put (FIELD_SortOrder, HELPER_SortOrder.writeExternal (_SortOrder));
vals.put (FIELD_StepType, HELPER_StepType.writeExternal (_StepType));
vals.put (SINGLEREFERENCE_WorkFlowStage, _WorkFlowStage.writeExternalData());
}
public void compare (BaseBusinessClass other, AttributeChangeListener listener) throws StorageException
{
super.compare (other, listener);
if (other instanceof BaseWorkFlowStep)
{
BaseWorkFlowStep otherWorkFlowStep = (BaseWorkFlowStep)(other);
if (!HELPER_SortOrder.compare(this._SortOrder, otherWorkFlowStep._SortOrder))
{
listener.notifyFieldChange(this, other, FIELD_SortOrder, HELPER_SortOrder.toObject(this._SortOrder), HELPER_SortOrder.toObject(otherWorkFlowStep._SortOrder));
}
if (!HELPER_StepType.compare(this._StepType, otherWorkFlowStep._StepType))
{
listener.notifyFieldChange(this, other, FIELD_StepType, HELPER_StepType.toObject(this._StepType), HELPER_StepType.toObject(otherWorkFlowStep._StepType));
}
// Compare single assocs
_WorkFlowStage.compare (otherWorkFlowStep._WorkFlowStage, listener);
// Compare multiple assocs
}
}
public void visitTransients (AttributeVisitor visitor) throws StorageException
{
super.visitAttributes (visitor);
}
public void visitAttributes (AttributeVisitor visitor) throws StorageException
{
super.visitAttributes (visitor);
visitor.visitField(this, FIELD_SortOrder, HELPER_SortOrder.toObject(getSortOrder()));
visitor.visitField(this, FIELD_StepType, HELPER_StepType.toObject(getStepType()));
visitor.visitAssociation (_WorkFlowStage);
}
public void visitAssociations (AssociationVisitor visitor, AssociatedScope scope) throws StorageException
{
super.visitAssociations (visitor, scope);
if (scope.includes (_WorkFlowStage))
{
visitor.visit (_WorkFlowStage);
}
}
public static WorkFlowStep createWorkFlowStep (ObjectTransaction transaction) throws StorageException
{
WorkFlowStep result = new WorkFlowStep ();
result.initialiseNewObject (transaction);
return result;
}
public static WorkFlowStep getWorkFlowStepByID (ObjectTransaction transaction, Long objectID) throws StorageException
{
return (WorkFlowStep)(transaction.getObjectByID (REFERENCE_WorkFlowStep, objectID));
}
public boolean testFilter (String attribName, QueryFilter filter) throws StorageException
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_SortOrder))
{
return filter.matches (getSortOrder ());
}
else if (attribName.equals (FIELD_StepType))
{
return filter.matches (getStepType ());
}
else if (attribName.equals (SINGLEREFERENCE_WorkFlowStage))
{
return filter.matches (getWorkFlowStage ());
}
else
{
return super.testFilter (attribName, filter);
}
}
public static SearchAll SearchByAll () { return new SearchAll (); }
public static class SearchAll extends SearchObject<WorkFlowStep>
{
public SearchAll andObjectID (QueryFilter<Long> filter)
{
filter.addFilter (context, "tl_work_flow_step.object_id", FIELD_ObjectID);
return this;
}
public SearchAll andObjectCreated (QueryFilter<Date> filter)
{
filter.addFilter (context, "tl_work_flow_step.object_created_date", FIELD_ObjectCreated);
return this;
}
public SearchAll andObjectLastModified (QueryFilter<Date> filter)
{
filter.addFilter (context, "tl_work_flow_step.object_last_updated_date", FIELD_ObjectLastModified);
return this;
}
public SearchAll andSortOrder (QueryFilter<Integer> filter)
{
filter.addFilter (context, "tl_work_flow_step.sort_order", "SortOrder");
return this;
}
public SearchAll andStepType (QueryFilter<StepType> filter)
{
filter.addFilter (context, "tl_work_flow_step.step_type", "StepType");
return this;
}
public SearchAll andWorkFlowStage (QueryFilter<WorkFlowStage> filter)
{
filter.addFilter (context, "tl_work_flow_step.work_flow_stage_id", "WorkFlowStage");
return this;
}
public WorkFlowStep[] search (ObjectTransaction transaction) throws StorageException
{
BaseBusinessClass[] results = super.search (transaction, REFERENCE_WorkFlowStep, SEARCH_All, criteria);
Set<WorkFlowStep> typedResults = new LinkedHashSet <WorkFlowStep> ();
for (BaseBusinessClass bbcResult : results)
{
WorkFlowStep aResult = (WorkFlowStep)bbcResult;
typedResults.add (aResult);
}
return ObjstoreUtils.removeDeleted(transaction, typedResults).toArray (new WorkFlowStep[0]);
}
}
public static WorkFlowStep[] searchAll (ObjectTransaction transaction) throws StorageException
{
return SearchByAll ()
.search (transaction);
}
public Object getAttribute (String attribName)
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_SortOrder))
{
return HELPER_SortOrder.toObject (getSortOrder ());
}
else if (attribName.equals (FIELD_StepType))
{
return HELPER_StepType.toObject (getStepType ());
}
else
{
return super.getAttribute (attribName);
}
}
public AttributeHelper getAttributeHelper (String attribName)
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_SortOrder))
{
return HELPER_SortOrder;
}
else if (attribName.equals (FIELD_StepType))
{
return HELPER_StepType;
}
else
{
return super.getAttributeHelper (attribName);
}
}
public void setAttribute (String attribName, Object attribValue) throws FieldException
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (attribName.equals (FIELD_SortOrder))
{
setSortOrder ((Integer)(HELPER_SortOrder.fromObject (_SortOrder, attribValue)));
}
else if (attribName.equals (FIELD_StepType))
{
setStepType ((StepType)(HELPER_StepType.fromObject (_StepType, attribValue)));
}
else
{
super.setAttribute (attribName, attribValue);
}
}
public boolean isWriteable (String fieldName)
{
return getWriteable (fieldName) == FieldWriteability.TRUE;
}
public boolean isReadable ()
{
return super.isReadable();
}
public boolean isReadable (String fieldName)
{
return super.isReadable(fieldName);
}
public FieldWriteability getWriteable (String fieldName)
{
if (false)
{
throw new RuntimeException ("Game over man!!");
}
else if (fieldName.equals (FIELD_SortOrder))
{
return getWriteability_SortOrder ();
}
else if (fieldName.equals (FIELD_StepType))
{
return getWriteability_StepType ();
}
else if (fieldName.equals (SINGLEREFERENCE_WorkFlowStage))
{
return getWriteability_WorkFlowStage ();
}
else
{
return super.getWriteable (fieldName);
}
}
public void putUnwriteable (Set<String> fields)
{
if (getWriteability_SortOrder () != FieldWriteability.TRUE)
{
fields.add (FIELD_SortOrder);
}
if (getWriteability_StepType () != FieldWriteability.TRUE)
{
fields.add (FIELD_StepType);
}
super.putUnwriteable (fields);
}
public String[] getAllTableNames()
{
return new String[] {"tl_work_flow_step"};
}
public boolean isPolymorphic(String tableName)
{
return super.isPolymorphic(tableName);
}
public List<AbstractAttribute> getAttributes ()
{
List result = super.getAttributes ();
result.add(HELPER_SortOrder.getAttribObject (getClass (), _SortOrder, true, FIELD_SortOrder));
result.add(HELPER_StepType.getAttribObject (getClass (), _StepType, true, FIELD_StepType));
return result;
}
public Map getAttributeMetadata (String attribute)
{
if (ATTRIBUTES_METADATA_WorkFlowStep.containsKey (attribute))
{
return (Map)ATTRIBUTES_METADATA_WorkFlowStep.get (attribute);
}
else
{
return super.getAttributeMetadata (attribute);
}
}
public Object getAttributeMetadata (String attribute, String metadata)
{
if (ATTRIBUTES_METADATA_WorkFlowStep.containsKey (attribute))
{
return ((Map)ATTRIBUTES_METADATA_WorkFlowStep.get (attribute)).get(metadata);
}
else
{
return super.getAttributeMetadata (attribute, metadata);
}
}
public void copyAllAttributeMetadata (Map copyInto)
{
super.copyAllAttributeMetadata(copyInto);
copyInto.putAll(ATTRIBUTES_METADATA_WorkFlowStep);
}
public void preCommit (boolean willBeStored) throws Exception
{
super.preCommit(willBeStored);
if(willBeStored)
{
}
}
public oneit.servlets.objstore.binary.BinaryContentHandler getBinaryContentHandler(String attribName)
{
return super.getBinaryContentHandler(attribName);
}
public static class WorkFlowStepBehaviourDecorator extends BaseBusinessClass.BBCBehaviourDecorator<WorkFlowStep>
{
/**
* Get the attribute SortOrder
*/
public Integer getSortOrder (WorkFlowStep obj, Integer original)
{
return original;
}
/**
* Change the value set for attribute SortOrder.
* May modify the field beforehand
* Occurs before validation.
*/
public Integer setSortOrder (WorkFlowStep obj, Integer newSortOrder) throws FieldException
{
return newSortOrder;
}
/**
* Get the attribute StepType
*/
public StepType getStepType (WorkFlowStep obj, StepType original)
{
return original;
}
/**
* Change the value set for attribute StepType.
* May modify the field beforehand
* Occurs before validation.
*/
public StepType setStepType (WorkFlowStep obj, StepType newStepType) throws FieldException
{
return newStepType;
}
}
@Override
public ORMPipeLine pipes()
{
return new WorkFlowStepPipeLineFactory<WorkFlowStep, WorkFlowStep> ((WorkFlowStep)this);
}
@Override
public ORMPipeLine pipes(Collection _items)
{
return pipesWorkFlowStep(_items);
}
/**
* Use this instead of pipes() to get rid of type casting.
*/
public WorkFlowStepPipeLineFactory<WorkFlowStep, WorkFlowStep> pipelineWorkFlowStep()
{
return (WorkFlowStepPipeLineFactory<WorkFlowStep, WorkFlowStep>) pipes();
}
public static WorkFlowStepPipeLineFactory<WorkFlowStep, WorkFlowStep> pipesWorkFlowStep(Collection<WorkFlowStep> items)
{
return REFERENCE_WorkFlowStep.new WorkFlowStepPipeLineFactory<WorkFlowStep, WorkFlowStep> (items);
}
public static WorkFlowStepPipeLineFactory<WorkFlowStep, WorkFlowStep> pipesWorkFlowStep(WorkFlowStep[] _items)
{
return pipesWorkFlowStep(Arrays.asList (_items));
}
public static WorkFlowStepPipeLineFactory<WorkFlowStep, WorkFlowStep> pipesWorkFlowStep()
{
return pipesWorkFlowStep((Collection)null);
}
public class WorkFlowStepPipeLineFactory<From extends BaseBusinessClass, Me extends WorkFlowStep> extends BaseBusinessClass.ORMPipeLine<From, Me>
{
public <Prev> WorkFlowStepPipeLineFactory (PipeLine<From, Prev> pipeLine, Pipe<Prev, Me> nextPipe)
{
super (pipeLine, nextPipe);
}
public WorkFlowStepPipeLineFactory (From seed)
{
super(seed);
}
public WorkFlowStepPipeLineFactory (Collection<From> seed)
{
super(seed);
}
public PipeLine<From, ? extends Object> to(String name)
{
if (name.equals ("SortOrder"))
{
return toSortOrder ();
}
if (name.equals ("StepType"))
{
return toStepType ();
}
if (name.equals ("WorkFlowStage"))
{
return toWorkFlowStage ();
}
return super.to(name);
}
public PipeLine<From, Integer> toSortOrder () { return pipe(new ORMAttributePipe<Me, Integer>(FIELD_SortOrder)); }
public StepType.StepTypePipeLineFactory<From, StepType> toStepType ()
{
return new StepType.StepTypePipeLineFactory<> (this, new ORMAttributePipe<>(FIELD_StepType));
}
public WorkFlowStage.WorkFlowStagePipeLineFactory<From, WorkFlowStage> toWorkFlowStage () { return toWorkFlowStage (Filter.ALL); }
public WorkFlowStage.WorkFlowStagePipeLineFactory<From, WorkFlowStage> toWorkFlowStage (Filter<WorkFlowStage> filter)
{
return WorkFlowStage.REFERENCE_WorkFlowStage.new WorkFlowStagePipeLineFactory<From, WorkFlowStage> (this, new ORMSingleAssocPipe<Me, WorkFlowStage>(SINGLEREFERENCE_WorkFlowStage, filter));
}
}
public boolean isTransientAttrib(String attribName)
{
return super.isTransientAttrib(attribName);
}
public boolean isTransientSingleReference(String assocName)
{
return super.isTransientSingleReference(assocName);
}
}
class DummyWorkFlowStep extends WorkFlowStep
{
// Default constructor primarily to support Externalisable
public DummyWorkFlowStep()
{
super();
}
public void assertValid ()
{
}
public WorkFlowStage getWorkFlowStage () throws StorageException
{
return (WorkFlowStage)(WorkFlowStage.DUMMY_WorkFlowStage);
}
/**
* Get the object id for the referenced object. Does not force a DB access.
*/
public Long getWorkFlowStageID ()
{
return WorkFlowStage.DUMMY_WorkFlowStage.getObjectID();
}
}
......@@ -48,7 +48,7 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
public static final String FIELD_ThankYouHeaderText = "ThankYouHeaderText";
public static final String FIELD_ThankYouSecondaryText = "ThankYouSecondaryText";
public static final String FIELD_JobOutlineButtonText = "JobOutlineButtonText";
public static final String FIELD_IsGlobalTemplate = "IsGlobalTemplate";
public static final String FIELD_RelatedToJob = "RelatedToJob";
public static final String FIELD_IsSystemGenerated = "IsSystemGenerated";
public static final String SINGLEREFERENCE_WithdrawalMessage = "WithdrawalMessage";
public static final String SINGLEREFERENCE_HiringTeam = "HiringTeam";
......@@ -75,7 +75,7 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
private static final DefaultAttributeHelper<WorkFlowTemplate> HELPER_ThankYouHeaderText = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<WorkFlowTemplate> HELPER_ThankYouSecondaryText = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<WorkFlowTemplate> HELPER_JobOutlineButtonText = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<WorkFlowTemplate> HELPER_IsGlobalTemplate = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<WorkFlowTemplate> HELPER_RelatedToJob = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<WorkFlowTemplate> HELPER_IsSystemGenerated = DefaultAttributeHelper.INSTANCE;
......@@ -92,7 +92,7 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
private String _ThankYouHeaderText;
private String _ThankYouSecondaryText;
private String _JobOutlineButtonText;
private Boolean _IsGlobalTemplate;
private Boolean _RelatedToJob;
private Boolean _IsSystemGenerated;
......@@ -122,7 +122,7 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
private static final AttributeValidator[] FIELD_ThankYouHeaderText_Validators;
private static final AttributeValidator[] FIELD_ThankYouSecondaryText_Validators;
private static final AttributeValidator[] FIELD_JobOutlineButtonText_Validators;
private static final AttributeValidator[] FIELD_IsGlobalTemplate_Validators;
private static final AttributeValidator[] FIELD_RelatedToJob_Validators;
private static final AttributeValidator[] FIELD_IsSystemGenerated_Validators;
......@@ -139,7 +139,7 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
private static final AttributeDecorator<WorkFlowTemplate, String>[] FIELD_ThankYouHeaderText_Decorators;
private static final AttributeDecorator<WorkFlowTemplate, String>[] FIELD_ThankYouSecondaryText_Decorators;
private static final AttributeDecorator<WorkFlowTemplate, String>[] FIELD_JobOutlineButtonText_Decorators;
private static final AttributeDecorator<WorkFlowTemplate, Boolean>[] FIELD_IsGlobalTemplate_Decorators;
private static final AttributeDecorator<WorkFlowTemplate, Boolean>[] FIELD_RelatedToJob_Decorators;
private static final AttributeDecorator<WorkFlowTemplate, Boolean>[] FIELD_IsSystemGenerated_Decorators;
......@@ -183,7 +183,7 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
FIELD_ThankYouHeaderText_Validators = (AttributeValidator[])setupAttribMetaData_ThankYouHeaderText(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_ThankYouSecondaryText_Validators = (AttributeValidator[])setupAttribMetaData_ThankYouSecondaryText(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_JobOutlineButtonText_Validators = (AttributeValidator[])setupAttribMetaData_JobOutlineButtonText(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_IsGlobalTemplate_Validators = (AttributeValidator[])setupAttribMetaData_IsGlobalTemplate(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_RelatedToJob_Validators = (AttributeValidator[])setupAttribMetaData_RelatedToJob(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_IsSystemGenerated_Validators = (AttributeValidator[])setupAttribMetaData_IsSystemGenerated(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_TemplateName_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_WorkFlowTemplate, FIELD_TemplateName).toArray (new AttributeDecorator[0]);
FIELD_LandingButtonText_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_WorkFlowTemplate, FIELD_LandingButtonText).toArray (new AttributeDecorator[0]);
......@@ -197,7 +197,7 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
FIELD_ThankYouHeaderText_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_WorkFlowTemplate, FIELD_ThankYouHeaderText).toArray (new AttributeDecorator[0]);
FIELD_ThankYouSecondaryText_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_WorkFlowTemplate, FIELD_ThankYouSecondaryText).toArray (new AttributeDecorator[0]);
FIELD_JobOutlineButtonText_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_WorkFlowTemplate, FIELD_JobOutlineButtonText).toArray (new AttributeDecorator[0]);
FIELD_IsGlobalTemplate_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_WorkFlowTemplate, FIELD_IsGlobalTemplate).toArray (new AttributeDecorator[0]);
FIELD_RelatedToJob_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_WorkFlowTemplate, FIELD_RelatedToJob).toArray (new AttributeDecorator[0]);
FIELD_IsSystemGenerated_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_WorkFlowTemplate, FIELD_IsSystemGenerated).toArray (new AttributeDecorator[0]);
SINGLEREFERENCE_WithdrawalMessage_Decorators = (SingleAssocDecorator[])AttributeDecoratorUtils.getSingleAssocDecorators(REFERENCE_WorkFlowTemplate, SINGLEREFERENCE_WithdrawalMessage).toArray (new SingleAssocDecorator[0]);
SINGLEREFERENCE_HiringTeam_Decorators = (SingleAssocDecorator[])AttributeDecoratorUtils.getSingleAssocDecorators(REFERENCE_WorkFlowTemplate, SINGLEREFERENCE_HiringTeam).toArray (new SingleAssocDecorator[0]);
......@@ -499,20 +499,21 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
return validators;
}
private static List setupAttribMetaData_IsGlobalTemplate(Map validatorMapping)
private static List setupAttribMetaData_RelatedToJob(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "is_global_template");
metaInfo.put ("dbcol", "related_to_job");
metaInfo.put ("defaultValue", "Boolean.FALSE");
metaInfo.put ("mandatory", "false");
metaInfo.put ("name", "IsGlobalTemplate");
metaInfo.put ("name", "RelatedToJob");
metaInfo.put ("type", "Boolean");
metaInfo.put (METADATA_DB_TABLENAME, "tl_work_flow_template");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for WorkFlowTemplate.IsGlobalTemplate:", metaInfo);
ATTRIBUTES_METADATA_WorkFlowTemplate.put (FIELD_IsGlobalTemplate, Collections.unmodifiableMap (metaInfo));
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for WorkFlowTemplate.RelatedToJob:", metaInfo);
ATTRIBUTES_METADATA_WorkFlowTemplate.put (FIELD_RelatedToJob, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(WorkFlowTemplate.class, "IsGlobalTemplate", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for WorkFlowTemplate.IsGlobalTemplate:", validators);
List validators = BaseBusinessClass.getAttribValidators(WorkFlowTemplate.class, "RelatedToJob", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for WorkFlowTemplate.RelatedToJob:", validators);
return validators;
}
......@@ -571,7 +572,7 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
_ThankYouHeaderText = (String)("Thank You for your application to:");
_ThankYouSecondaryText = (String)("We will get in touch with you soon");
_JobOutlineButtonText = (String)("Continue");
_IsGlobalTemplate = (Boolean)(HELPER_IsGlobalTemplate.initialise (_IsGlobalTemplate));
_RelatedToJob = (Boolean)(Boolean.FALSE);
_IsSystemGenerated = (Boolean)(Boolean.FALSE);
}
......@@ -1801,17 +1802,17 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
}
/**
* Attribute IsGlobalTemplate
* Attribute RelatedToJob
*/
public Boolean getIsGlobalTemplate ()
public Boolean getRelatedToJob ()
{
assertValid();
Boolean valToReturn = AttributeDecoratorUtils.getValue (FIELD_IsGlobalTemplate_Decorators, (WorkFlowTemplate)this, FIELD_IsGlobalTemplate, _IsGlobalTemplate);
Boolean valToReturn = AttributeDecoratorUtils.getValue (FIELD_RelatedToJob_Decorators, (WorkFlowTemplate)this, FIELD_RelatedToJob, _RelatedToJob);
for (WorkFlowTemplateBehaviourDecorator bhd : WorkFlowTemplate_BehaviourDecorators)
{
valToReturn = bhd.getIsGlobalTemplate ((WorkFlowTemplate)this, valToReturn);
valToReturn = bhd.getRelatedToJob ((WorkFlowTemplate)this, valToReturn);
}
return valToReturn;
......@@ -1822,7 +1823,7 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preIsGlobalTemplateChange (Boolean newIsGlobalTemplate) throws FieldException
protected void preRelatedToJobChange (Boolean newRelatedToJob) throws FieldException
{
}
......@@ -1832,48 +1833,48 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postIsGlobalTemplateChange () throws FieldException
protected void postRelatedToJobChange () throws FieldException
{
}
public FieldWriteability getWriteability_IsGlobalTemplate ()
public FieldWriteability getWriteability_RelatedToJob ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute IsGlobalTemplate. Checks to ensure a new value
* Set the attribute RelatedToJob. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setIsGlobalTemplate (Boolean newIsGlobalTemplate) throws FieldException
public void setRelatedToJob (Boolean newRelatedToJob) throws FieldException
{
newIsGlobalTemplate = AttributeDecoratorUtils.setValue (FIELD_IsGlobalTemplate_Decorators, (WorkFlowTemplate)this, FIELD_IsGlobalTemplate, newIsGlobalTemplate);
newRelatedToJob = AttributeDecoratorUtils.setValue (FIELD_RelatedToJob_Decorators, (WorkFlowTemplate)this, FIELD_RelatedToJob, newRelatedToJob);
boolean oldAndNewIdentical = HELPER_IsGlobalTemplate.compare (_IsGlobalTemplate, newIsGlobalTemplate);
boolean oldAndNewIdentical = HELPER_RelatedToJob.compare (_RelatedToJob, newRelatedToJob);
try
{
for (WorkFlowTemplateBehaviourDecorator bhd : WorkFlowTemplate_BehaviourDecorators)
{
newIsGlobalTemplate = bhd.setIsGlobalTemplate ((WorkFlowTemplate)this, newIsGlobalTemplate);
oldAndNewIdentical = HELPER_IsGlobalTemplate.compare (_IsGlobalTemplate, newIsGlobalTemplate);
newRelatedToJob = bhd.setRelatedToJob ((WorkFlowTemplate)this, newRelatedToJob);
oldAndNewIdentical = HELPER_RelatedToJob.compare (_RelatedToJob, newRelatedToJob);
}
if (FIELD_IsGlobalTemplate_Validators.length > 0)
if (FIELD_RelatedToJob_Validators.length > 0)
{
Object newIsGlobalTemplateObj = HELPER_IsGlobalTemplate.toObject (newIsGlobalTemplate);
Object newRelatedToJobObj = HELPER_RelatedToJob.toObject (newRelatedToJob);
if (newIsGlobalTemplateObj != null)
if (newRelatedToJobObj != null)
{
int loopMax = FIELD_IsGlobalTemplate_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_WorkFlowTemplate.get (FIELD_IsGlobalTemplate);
int loopMax = FIELD_RelatedToJob_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_WorkFlowTemplate.get (FIELD_RelatedToJob);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_IsGlobalTemplate_Validators[v].checkAttribute (this, FIELD_IsGlobalTemplate, metadata, newIsGlobalTemplateObj);
FIELD_RelatedToJob_Validators[v].checkAttribute (this, FIELD_RelatedToJob, metadata, newRelatedToJobObj);
}
}
}
......@@ -1891,12 +1892,12 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (AttributeDecoratorUtils.getWriteability (FIELD_IsGlobalTemplate_Decorators, (WorkFlowTemplate)this, FIELD_IsGlobalTemplate ,getWriteability_IsGlobalTemplate ()) != FieldWriteability.FALSE, "Field IsGlobalTemplate is not writeable");
preIsGlobalTemplateChange (newIsGlobalTemplate);
markFieldChange (FIELD_IsGlobalTemplate);
_IsGlobalTemplate = newIsGlobalTemplate;
postFieldChange (FIELD_IsGlobalTemplate);
postIsGlobalTemplateChange ();
Debug.assertion (AttributeDecoratorUtils.getWriteability (FIELD_RelatedToJob_Decorators, (WorkFlowTemplate)this, FIELD_RelatedToJob ,getWriteability_RelatedToJob ()) != FieldWriteability.FALSE, "Field RelatedToJob is not writeable");
preRelatedToJobChange (newRelatedToJob);
markFieldChange (FIELD_RelatedToJob);
_RelatedToJob = newRelatedToJob;
postFieldChange (FIELD_RelatedToJob);
postRelatedToJobChange ();
}
}
......@@ -2731,7 +2732,7 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
tl_work_flow_templatePSet.setAttrib (FIELD_ThankYouHeaderText, HELPER_ThankYouHeaderText.toObject (_ThankYouHeaderText)); //
tl_work_flow_templatePSet.setAttrib (FIELD_ThankYouSecondaryText, HELPER_ThankYouSecondaryText.toObject (_ThankYouSecondaryText)); //
tl_work_flow_templatePSet.setAttrib (FIELD_JobOutlineButtonText, HELPER_JobOutlineButtonText.toObject (_JobOutlineButtonText)); //
tl_work_flow_templatePSet.setAttrib (FIELD_IsGlobalTemplate, HELPER_IsGlobalTemplate.toObject (_IsGlobalTemplate)); //
tl_work_flow_templatePSet.setAttrib (FIELD_RelatedToJob, HELPER_RelatedToJob.toObject (_RelatedToJob)); //
tl_work_flow_templatePSet.setAttrib (FIELD_IsSystemGenerated, HELPER_IsSystemGenerated.toObject (_IsSystemGenerated)); //
_WithdrawalMessage.getPersistentSets (allSets);
_HiringTeam.getPersistentSets (allSets);
......@@ -2760,7 +2761,7 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
_ThankYouHeaderText = (String)(HELPER_ThankYouHeaderText.fromObject (_ThankYouHeaderText, tl_work_flow_templatePSet.getAttrib (FIELD_ThankYouHeaderText))); //
_ThankYouSecondaryText = (String)(HELPER_ThankYouSecondaryText.fromObject (_ThankYouSecondaryText, tl_work_flow_templatePSet.getAttrib (FIELD_ThankYouSecondaryText))); //
_JobOutlineButtonText = (String)(HELPER_JobOutlineButtonText.fromObject (_JobOutlineButtonText, tl_work_flow_templatePSet.getAttrib (FIELD_JobOutlineButtonText))); //
_IsGlobalTemplate = (Boolean)(HELPER_IsGlobalTemplate.fromObject (_IsGlobalTemplate, tl_work_flow_templatePSet.getAttrib (FIELD_IsGlobalTemplate))); //
_RelatedToJob = (Boolean)(HELPER_RelatedToJob.fromObject (_RelatedToJob, tl_work_flow_templatePSet.getAttrib (FIELD_RelatedToJob))); //
_IsSystemGenerated = (Boolean)(HELPER_IsSystemGenerated.fromObject (_IsSystemGenerated, tl_work_flow_templatePSet.getAttrib (FIELD_IsSystemGenerated))); //
_WithdrawalMessage.setFromPersistentSets (objectID, allSets);
_HiringTeam.setFromPersistentSets (objectID, allSets);
......@@ -2887,7 +2888,7 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
try
{
setIsGlobalTemplate (otherWorkFlowTemplate.getIsGlobalTemplate ());
setRelatedToJob (otherWorkFlowTemplate.getRelatedToJob ());
}
catch (FieldException ex)
{
......@@ -2929,7 +2930,7 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
_ThankYouHeaderText = sourceWorkFlowTemplate._ThankYouHeaderText;
_ThankYouSecondaryText = sourceWorkFlowTemplate._ThankYouSecondaryText;
_JobOutlineButtonText = sourceWorkFlowTemplate._JobOutlineButtonText;
_IsGlobalTemplate = sourceWorkFlowTemplate._IsGlobalTemplate;
_RelatedToJob = sourceWorkFlowTemplate._RelatedToJob;
_IsSystemGenerated = sourceWorkFlowTemplate._IsSystemGenerated;
}
......@@ -2999,7 +3000,7 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
_ThankYouHeaderText = (String)(HELPER_ThankYouHeaderText.readExternal (_ThankYouHeaderText, vals.get(FIELD_ThankYouHeaderText))); //
_ThankYouSecondaryText = (String)(HELPER_ThankYouSecondaryText.readExternal (_ThankYouSecondaryText, vals.get(FIELD_ThankYouSecondaryText))); //
_JobOutlineButtonText = (String)(HELPER_JobOutlineButtonText.readExternal (_JobOutlineButtonText, vals.get(FIELD_JobOutlineButtonText))); //
_IsGlobalTemplate = (Boolean)(HELPER_IsGlobalTemplate.readExternal (_IsGlobalTemplate, vals.get(FIELD_IsGlobalTemplate))); //
_RelatedToJob = (Boolean)(HELPER_RelatedToJob.readExternal (_RelatedToJob, vals.get(FIELD_RelatedToJob))); //
_IsSystemGenerated = (Boolean)(HELPER_IsSystemGenerated.readExternal (_IsSystemGenerated, vals.get(FIELD_IsSystemGenerated))); //
_WithdrawalMessage.readExternalData(vals.get(SINGLEREFERENCE_WithdrawalMessage));
_HiringTeam.readExternalData(vals.get(SINGLEREFERENCE_HiringTeam));
......@@ -3028,7 +3029,7 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
vals.put (FIELD_ThankYouHeaderText, HELPER_ThankYouHeaderText.writeExternal (_ThankYouHeaderText));
vals.put (FIELD_ThankYouSecondaryText, HELPER_ThankYouSecondaryText.writeExternal (_ThankYouSecondaryText));
vals.put (FIELD_JobOutlineButtonText, HELPER_JobOutlineButtonText.writeExternal (_JobOutlineButtonText));
vals.put (FIELD_IsGlobalTemplate, HELPER_IsGlobalTemplate.writeExternal (_IsGlobalTemplate));
vals.put (FIELD_RelatedToJob, HELPER_RelatedToJob.writeExternal (_RelatedToJob));
vals.put (FIELD_IsSystemGenerated, HELPER_IsSystemGenerated.writeExternal (_IsSystemGenerated));
vals.put (SINGLEREFERENCE_WithdrawalMessage, _WithdrawalMessage.writeExternalData());
vals.put (SINGLEREFERENCE_HiringTeam, _HiringTeam.writeExternalData());
......@@ -3095,9 +3096,9 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
{
listener.notifyFieldChange(this, other, FIELD_JobOutlineButtonText, HELPER_JobOutlineButtonText.toObject(this._JobOutlineButtonText), HELPER_JobOutlineButtonText.toObject(otherWorkFlowTemplate._JobOutlineButtonText));
}
if (!HELPER_IsGlobalTemplate.compare(this._IsGlobalTemplate, otherWorkFlowTemplate._IsGlobalTemplate))
if (!HELPER_RelatedToJob.compare(this._RelatedToJob, otherWorkFlowTemplate._RelatedToJob))
{
listener.notifyFieldChange(this, other, FIELD_IsGlobalTemplate, HELPER_IsGlobalTemplate.toObject(this._IsGlobalTemplate), HELPER_IsGlobalTemplate.toObject(otherWorkFlowTemplate._IsGlobalTemplate));
listener.notifyFieldChange(this, other, FIELD_RelatedToJob, HELPER_RelatedToJob.toObject(this._RelatedToJob), HELPER_RelatedToJob.toObject(otherWorkFlowTemplate._RelatedToJob));
}
if (!HELPER_IsSystemGenerated.compare(this._IsSystemGenerated, otherWorkFlowTemplate._IsSystemGenerated))
{
......@@ -3141,7 +3142,7 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
visitor.visitField(this, FIELD_ThankYouHeaderText, HELPER_ThankYouHeaderText.toObject(getThankYouHeaderText()));
visitor.visitField(this, FIELD_ThankYouSecondaryText, HELPER_ThankYouSecondaryText.toObject(getThankYouSecondaryText()));
visitor.visitField(this, FIELD_JobOutlineButtonText, HELPER_JobOutlineButtonText.toObject(getJobOutlineButtonText()));
visitor.visitField(this, FIELD_IsGlobalTemplate, HELPER_IsGlobalTemplate.toObject(getIsGlobalTemplate()));
visitor.visitField(this, FIELD_RelatedToJob, HELPER_RelatedToJob.toObject(getRelatedToJob()));
visitor.visitField(this, FIELD_IsSystemGenerated, HELPER_IsSystemGenerated.toObject(getIsSystemGenerated()));
visitor.visitAssociation (_WithdrawalMessage);
visitor.visitAssociation (_HiringTeam);
......@@ -3244,9 +3245,9 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
{
return filter.matches (getJobOutlineButtonText ());
}
else if (attribName.equals (FIELD_IsGlobalTemplate))
else if (attribName.equals (FIELD_RelatedToJob))
{
return filter.matches (getIsGlobalTemplate ());
return filter.matches (getRelatedToJob ());
}
else if (attribName.equals (FIELD_IsSystemGenerated))
{
......@@ -3362,9 +3363,9 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
return this;
}
public SearchAll andIsGlobalTemplate (QueryFilter<Boolean> filter)
public SearchAll andRelatedToJob (QueryFilter<Boolean> filter)
{
filter.addFilter (context, "tl_work_flow_template.is_global_template", "IsGlobalTemplate");
filter.addFilter (context, "tl_work_flow_template.related_to_job", "RelatedToJob");
return this;
}
......@@ -3466,9 +3467,9 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
{
return HELPER_JobOutlineButtonText.toObject (getJobOutlineButtonText ());
}
else if (attribName.equals (FIELD_IsGlobalTemplate))
else if (attribName.equals (FIELD_RelatedToJob))
{
return HELPER_IsGlobalTemplate.toObject (getIsGlobalTemplate ());
return HELPER_RelatedToJob.toObject (getRelatedToJob ());
}
else if (attribName.equals (FIELD_IsSystemGenerated))
{
......@@ -3535,9 +3536,9 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
{
return HELPER_JobOutlineButtonText;
}
else if (attribName.equals (FIELD_IsGlobalTemplate))
else if (attribName.equals (FIELD_RelatedToJob))
{
return HELPER_IsGlobalTemplate;
return HELPER_RelatedToJob;
}
else if (attribName.equals (FIELD_IsSystemGenerated))
{
......@@ -3604,9 +3605,9 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
{
setJobOutlineButtonText ((String)(HELPER_JobOutlineButtonText.fromObject (_JobOutlineButtonText, attribValue)));
}
else if (attribName.equals (FIELD_IsGlobalTemplate))
else if (attribName.equals (FIELD_RelatedToJob))
{
setIsGlobalTemplate ((Boolean)(HELPER_IsGlobalTemplate.fromObject (_IsGlobalTemplate, attribValue)));
setRelatedToJob ((Boolean)(HELPER_RelatedToJob.fromObject (_RelatedToJob, attribValue)));
}
else if (attribName.equals (FIELD_IsSystemGenerated))
{
......@@ -3690,9 +3691,9 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
{
return getWriteability_JobOutlineButtonText ();
}
else if (fieldName.equals (FIELD_IsGlobalTemplate))
else if (fieldName.equals (FIELD_RelatedToJob))
{
return getWriteability_IsGlobalTemplate ();
return getWriteability_RelatedToJob ();
}
else if (fieldName.equals (FIELD_IsSystemGenerated))
{
......@@ -3783,9 +3784,9 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
fields.add (FIELD_JobOutlineButtonText);
}
if (getWriteability_IsGlobalTemplate () != FieldWriteability.TRUE)
if (getWriteability_RelatedToJob () != FieldWriteability.TRUE)
{
fields.add (FIELD_IsGlobalTemplate);
fields.add (FIELD_RelatedToJob);
}
if (getWriteability_IsSystemGenerated () != FieldWriteability.TRUE)
......@@ -3825,7 +3826,7 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
result.add(HELPER_ThankYouHeaderText.getAttribObject (getClass (), _ThankYouHeaderText, false, FIELD_ThankYouHeaderText));
result.add(HELPER_ThankYouSecondaryText.getAttribObject (getClass (), _ThankYouSecondaryText, false, FIELD_ThankYouSecondaryText));
result.add(HELPER_JobOutlineButtonText.getAttribObject (getClass (), _JobOutlineButtonText, false, FIELD_JobOutlineButtonText));
result.add(HELPER_IsGlobalTemplate.getAttribObject (getClass (), _IsGlobalTemplate, false, FIELD_IsGlobalTemplate));
result.add(HELPER_RelatedToJob.getAttribObject (getClass (), _RelatedToJob, false, FIELD_RelatedToJob));
result.add(HELPER_IsSystemGenerated.getAttribObject (getClass (), _IsSystemGenerated, false, FIELD_IsSystemGenerated));
return result;
......@@ -4101,21 +4102,21 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
}
/**
* Get the attribute IsGlobalTemplate
* Get the attribute RelatedToJob
*/
public Boolean getIsGlobalTemplate (WorkFlowTemplate obj, Boolean original)
public Boolean getRelatedToJob (WorkFlowTemplate obj, Boolean original)
{
return original;
}
/**
* Change the value set for attribute IsGlobalTemplate.
* Change the value set for attribute RelatedToJob.
* May modify the field beforehand
* Occurs before validation.
*/
public Boolean setIsGlobalTemplate (WorkFlowTemplate obj, Boolean newIsGlobalTemplate) throws FieldException
public Boolean setRelatedToJob (WorkFlowTemplate obj, Boolean newRelatedToJob) throws FieldException
{
return newIsGlobalTemplate;
return newRelatedToJob;
}
/**
......@@ -4250,9 +4251,9 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
{
return toJobOutlineButtonText ();
}
if (name.equals ("IsGlobalTemplate"))
if (name.equals ("RelatedToJob"))
{
return toIsGlobalTemplate ();
return toRelatedToJob ();
}
if (name.equals ("IsSystemGenerated"))
{
......@@ -4299,7 +4300,7 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
public PipeLine<From, String> toJobOutlineButtonText () { return pipe(new ORMAttributePipe<Me, String>(FIELD_JobOutlineButtonText)); }
public PipeLine<From, Boolean> toIsGlobalTemplate () { return pipe(new ORMAttributePipe<Me, Boolean>(FIELD_IsGlobalTemplate)); }
public PipeLine<From, Boolean> toRelatedToJob () { return pipe(new ORMAttributePipe<Me, Boolean>(FIELD_RelatedToJob)); }
public PipeLine<From, Boolean> toIsSystemGenerated () { return pipe(new ORMAttributePipe<Me, Boolean>(FIELD_IsSystemGenerated)); }
......
......@@ -231,7 +231,7 @@ public class Job extends BaseJob
public int getNoOfCandidatesApplied()
{
Filter<JobApplication> filter = JobApplication.SearchByAll().andWorkFlowStage(new NotInFilter<>(pipelineJob().toWorkFlowTemplate().toWorkFlowStages(WorkFlowStage.SearchByAll().andStageType(new InFilter<>(StageType.INCOMPLETE, StageType.POST_INGEST))).uniqueVals()));
Filter<JobApplication> filter = JobApplication.SearchByAll().andWorkFlowStage(new NotInFilter<>(pipelineJob().toWorkFlowTemplate().toWorkFlowStages(WorkFlowStage.SearchByAll().andStageType(new InFilter<>(StageType.INITIAL))).uniqueVals()));
return pipelineJob().toJobApplications(filter).toCandidate().vals().size();
}
......@@ -247,7 +247,7 @@ public class Job extends BaseJob
public Collection<JobApplication> getSubmittedApplications()
{
Filter<JobApplication> filter = JobApplication.SearchByStageType().byStageTypesNotIn(CollectionUtils.createSet(StageType.INCOMPLETE, StageType.POST_INGEST));
Filter<JobApplication> filter = JobApplication.SearchByStageType().byStageTypesNotIn(CollectionUtils.createSet(StageType.INITIAL));
return CollectionFilter.filter(getJobApplicationsSet(), filter);
}
......@@ -622,7 +622,7 @@ public class Job extends BaseJob
public List<WorkFlowStage> getSortedMiddleStages()
{
Filter<WorkFlowStage> filter = WorkFlowStage.SearchByAll().andStageType(new NotInFilter<>(StageType.POST_INGEST, StageType.INCOMPLETE, StageType.UNSUITABLE, StageType.WITHDREW));
Filter<WorkFlowStage> filter = WorkFlowStage.SearchByAll().andStageType(new NotInFilter<>(StageType.INITIAL, StageType.UNSUITABLE, StageType.WITHDREW));
return ObjstoreUtils.sort(pipelineJob().toWorkFlowTemplate().toWorkFlowStages(filter).uniqueVals(),
new ObjectTransform[]{WorkFlowStage.pipesWorkFlowStage().toSortOrder()},
......@@ -645,13 +645,13 @@ public class Job extends BaseJob
public Set<WorkFlowStage> getIncompleteApplicantStages()
{
Filter<WorkFlowStage> filter = WorkFlowStage.SearchByAll().andStageType(new InFilter<>(StageType.INCOMPLETE, StageType.POST_INGEST, StageType.UNSUITABLE));
Filter<WorkFlowStage> filter = WorkFlowStage.SearchByAll().andStageType(new InFilter<>(StageType.INITIAL, StageType.UNSUITABLE));
return pipelineJob().toWorkFlowTemplate().toWorkFlowStages(filter).uniqueVals();
}
public Set<WorkFlowStage> getApplicantStages()
{
Filter<WorkFlowStage> filter = WorkFlowStage.SearchByAll().andStageType(new NotInFilter<>(StageType.INCOMPLETE, StageType.POST_INGEST));
Filter<WorkFlowStage> filter = WorkFlowStage.SearchByAll().andStageType(new NotInFilter<>(StageType.INITIAL));
return pipelineJob().toWorkFlowTemplate().toWorkFlowStages(filter).uniqueVals();
}
......
......@@ -30,6 +30,7 @@
<ATTRIB name="PreferRemote" type="Boolean" dbcol="prefer_remote" defaultValue="Boolean.FALSE"/>
<ATTRIB name="HappyToRelocate" type="Boolean" dbcol="happy_to_relocate"/>
<ATTRIB name="IsEmailIngest" type="Boolean" dbcol="is_email_ingest" defaultValue="Boolean.FALSE"/>
<ATTRIB name="ApplicantSource" type="ApplicantSource" dbcol="applicant_source" defaultValue="ApplicantSource.APPLY_URL" mandatory="false" attribHelper="EnumeratedAttributeHelper"/>
<SINGLEREFERENCE name="Candidate" type="Candidate" dbcol="candidate_id" backreferenceName="JobApplications" mandatory="true"/>
<SINGLEREFERENCE name="Job" type="Job" dbcol="job_id" backreferenceName="JobApplications" mandatory="true"/>
......
......@@ -35,6 +35,7 @@ public class JobApplicationPersistenceMgr extends ObjectPersistenceMgr
private Boolean dummyPreferRemote;
private Boolean dummyHappyToRelocate;
private Boolean dummyIsEmailIngest;
private ApplicantSource dummyApplicantSource;
// Static constants corresponding to attribute helpers
......@@ -46,6 +47,7 @@ public class JobApplicationPersistenceMgr extends ObjectPersistenceMgr
private static final DefaultAttributeHelper HELPER_PreferRemote = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_HappyToRelocate = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_IsEmailIngest = DefaultAttributeHelper.INSTANCE;
private static final EnumeratedAttributeHelper HELPER_ApplicantSource = new EnumeratedAttributeHelper (ApplicantSource.FACTORY_ApplicantSource);
......@@ -60,10 +62,11 @@ public class JobApplicationPersistenceMgr extends ObjectPersistenceMgr
dummyPreferRemote = (Boolean)(HELPER_PreferRemote.initialise (dummyPreferRemote));
dummyHappyToRelocate = (Boolean)(HELPER_HappyToRelocate.initialise (dummyHappyToRelocate));
dummyIsEmailIngest = (Boolean)(HELPER_IsEmailIngest.initialise (dummyIsEmailIngest));
dummyApplicantSource = (ApplicantSource)(HELPER_ApplicantSource.initialise (dummyApplicantSource));
}
private String SELECT_COLUMNS = "{PREFIX}tl_job_application.object_id as id, {PREFIX}tl_job_application.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_job_application.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_job_application.cv, {PREFIX}tl_job_application.cover_letter, {PREFIX}tl_job_application.application_status, {PREFIX}tl_job_application.submitted_date, {PREFIX}tl_job_application.google_address_text, {PREFIX}tl_job_application.prefer_remote, {PREFIX}tl_job_application.happy_to_relocate, {PREFIX}tl_job_application.is_email_ingest, {PREFIX}tl_job_application.candidate_id, {PREFIX}tl_job_application.job_id, {PREFIX}tl_job_application.work_flow_stage_id, 1 AS commasafe ";
private String SELECT_COLUMNS = "{PREFIX}tl_job_application.object_id as id, {PREFIX}tl_job_application.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_job_application.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_job_application.cv, {PREFIX}tl_job_application.cover_letter, {PREFIX}tl_job_application.application_status, {PREFIX}tl_job_application.submitted_date, {PREFIX}tl_job_application.google_address_text, {PREFIX}tl_job_application.prefer_remote, {PREFIX}tl_job_application.happy_to_relocate, {PREFIX}tl_job_application.is_email_ingest, {PREFIX}tl_job_application.applicant_source, {PREFIX}tl_job_application.candidate_id, {PREFIX}tl_job_application.job_id, {PREFIX}tl_job_application.work_flow_stage_id, 1 AS commasafe ";
private String SELECT_JOINS = "";
public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
......@@ -122,6 +125,7 @@ public class JobApplicationPersistenceMgr extends ObjectPersistenceMgr
!tl_job_applicationPSet.containsAttrib(JobApplication.FIELD_PreferRemote)||
!tl_job_applicationPSet.containsAttrib(JobApplication.FIELD_HappyToRelocate)||
!tl_job_applicationPSet.containsAttrib(JobApplication.FIELD_IsEmailIngest)||
!tl_job_applicationPSet.containsAttrib(JobApplication.FIELD_ApplicantSource)||
!tl_job_applicationPSet.containsAttrib(JobApplication.SINGLEREFERENCE_Candidate)||
!tl_job_applicationPSet.containsAttrib(JobApplication.SINGLEREFERENCE_Job)||
!tl_job_applicationPSet.containsAttrib(JobApplication.SINGLEREFERENCE_WorkFlowStage))
......@@ -214,10 +218,10 @@ public class JobApplicationPersistenceMgr extends ObjectPersistenceMgr
{
int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}tl_job_application " +
"SET cv = ?, cover_letter = ?, application_status = ?, submitted_date = ?, google_address_text = ?, prefer_remote = ?, happy_to_relocate = ?, is_email_ingest = ?, candidate_id = ? , job_id = ? , work_flow_stage_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"SET cv = ?, cover_letter = ?, application_status = ?, submitted_date = ?, google_address_text = ?, prefer_remote = ?, happy_to_relocate = ?, is_email_ingest = ?, applicant_source = ?, candidate_id = ? , job_id = ? , work_flow_stage_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE tl_job_application.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ",
CollectionUtils.listEntry (HELPER_CV.getForSQL(dummyCV, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_CV))).listEntry (HELPER_CoverLetter.getForSQL(dummyCoverLetter, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_CoverLetter))).listEntry (HELPER_ApplicationStatus.getForSQL(dummyApplicationStatus, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_ApplicationStatus))).listEntry (HELPER_SubmittedDate.getForSQL(dummySubmittedDate, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_SubmittedDate))).listEntry (HELPER_GoogleAddressText.getForSQL(dummyGoogleAddressText, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_GoogleAddressText))).listEntry (HELPER_PreferRemote.getForSQL(dummyPreferRemote, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_PreferRemote))).listEntry (HELPER_HappyToRelocate.getForSQL(dummyHappyToRelocate, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_HappyToRelocate))).listEntry (HELPER_IsEmailIngest.getForSQL(dummyIsEmailIngest, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_IsEmailIngest))).listEntry (SQLManager.CheckNull((Long)(tl_job_applicationPSet.getAttrib (JobApplication.SINGLEREFERENCE_Candidate)))).listEntry (SQLManager.CheckNull((Long)(tl_job_applicationPSet.getAttrib (JobApplication.SINGLEREFERENCE_Job)))).listEntry (SQLManager.CheckNull((Long)(tl_job_applicationPSet.getAttrib (JobApplication.SINGLEREFERENCE_WorkFlowStage)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
CollectionUtils.listEntry (HELPER_CV.getForSQL(dummyCV, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_CV))).listEntry (HELPER_CoverLetter.getForSQL(dummyCoverLetter, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_CoverLetter))).listEntry (HELPER_ApplicationStatus.getForSQL(dummyApplicationStatus, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_ApplicationStatus))).listEntry (HELPER_SubmittedDate.getForSQL(dummySubmittedDate, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_SubmittedDate))).listEntry (HELPER_GoogleAddressText.getForSQL(dummyGoogleAddressText, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_GoogleAddressText))).listEntry (HELPER_PreferRemote.getForSQL(dummyPreferRemote, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_PreferRemote))).listEntry (HELPER_HappyToRelocate.getForSQL(dummyHappyToRelocate, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_HappyToRelocate))).listEntry (HELPER_IsEmailIngest.getForSQL(dummyIsEmailIngest, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_IsEmailIngest))).listEntry (HELPER_ApplicantSource.getForSQL(dummyApplicantSource, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_ApplicantSource))).listEntry (SQLManager.CheckNull((Long)(tl_job_applicationPSet.getAttrib (JobApplication.SINGLEREFERENCE_Candidate)))).listEntry (SQLManager.CheckNull((Long)(tl_job_applicationPSet.getAttrib (JobApplication.SINGLEREFERENCE_Job)))).listEntry (SQLManager.CheckNull((Long)(tl_job_applicationPSet.getAttrib (JobApplication.SINGLEREFERENCE_WorkFlowStage)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
if (rowsUpdated != 1)
{
......@@ -657,6 +661,7 @@ public class JobApplicationPersistenceMgr extends ObjectPersistenceMgr
tl_job_applicationPSet.setAttrib(JobApplication.FIELD_PreferRemote, HELPER_PreferRemote.getFromRS(dummyPreferRemote, r, "prefer_remote"));
tl_job_applicationPSet.setAttrib(JobApplication.FIELD_HappyToRelocate, HELPER_HappyToRelocate.getFromRS(dummyHappyToRelocate, r, "happy_to_relocate"));
tl_job_applicationPSet.setAttrib(JobApplication.FIELD_IsEmailIngest, HELPER_IsEmailIngest.getFromRS(dummyIsEmailIngest, r, "is_email_ingest"));
tl_job_applicationPSet.setAttrib(JobApplication.FIELD_ApplicantSource, HELPER_ApplicantSource.getFromRS(dummyApplicantSource, r, "applicant_source"));
tl_job_applicationPSet.setAttrib(JobApplication.SINGLEREFERENCE_Candidate, r.getObject ("candidate_id"));
tl_job_applicationPSet.setAttrib(JobApplication.SINGLEREFERENCE_Job, r.getObject ("job_id"));
......@@ -677,10 +682,10 @@ public class JobApplicationPersistenceMgr extends ObjectPersistenceMgr
{
executeStatement (sqlMgr,
"INSERT INTO {PREFIX}tl_job_application " +
" (cv, cover_letter, application_status, submitted_date, google_address_text, prefer_remote, happy_to_relocate, is_email_ingest, candidate_id, job_id, work_flow_stage_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
" (cv, cover_letter, application_status, submitted_date, google_address_text, prefer_remote, happy_to_relocate, is_email_ingest, applicant_source, candidate_id, job_id, work_flow_stage_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
"VALUES " +
" (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_CV.getForSQL(dummyCV, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_CV))).listEntry (HELPER_CoverLetter.getForSQL(dummyCoverLetter, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_CoverLetter))).listEntry (HELPER_ApplicationStatus.getForSQL(dummyApplicationStatus, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_ApplicationStatus))).listEntry (HELPER_SubmittedDate.getForSQL(dummySubmittedDate, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_SubmittedDate))).listEntry (HELPER_GoogleAddressText.getForSQL(dummyGoogleAddressText, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_GoogleAddressText))).listEntry (HELPER_PreferRemote.getForSQL(dummyPreferRemote, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_PreferRemote))).listEntry (HELPER_HappyToRelocate.getForSQL(dummyHappyToRelocate, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_HappyToRelocate))).listEntry (HELPER_IsEmailIngest.getForSQL(dummyIsEmailIngest, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_IsEmailIngest))) .listEntry (SQLManager.CheckNull((Long)(tl_job_applicationPSet.getAttrib (JobApplication.SINGLEREFERENCE_Candidate)))).listEntry (SQLManager.CheckNull((Long)(tl_job_applicationPSet.getAttrib (JobApplication.SINGLEREFERENCE_Job)))).listEntry (SQLManager.CheckNull((Long)(tl_job_applicationPSet.getAttrib (JobApplication.SINGLEREFERENCE_WorkFlowStage)))) .listEntry (objectID.longID ()).toList().toArray());
" (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_CV.getForSQL(dummyCV, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_CV))).listEntry (HELPER_CoverLetter.getForSQL(dummyCoverLetter, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_CoverLetter))).listEntry (HELPER_ApplicationStatus.getForSQL(dummyApplicationStatus, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_ApplicationStatus))).listEntry (HELPER_SubmittedDate.getForSQL(dummySubmittedDate, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_SubmittedDate))).listEntry (HELPER_GoogleAddressText.getForSQL(dummyGoogleAddressText, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_GoogleAddressText))).listEntry (HELPER_PreferRemote.getForSQL(dummyPreferRemote, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_PreferRemote))).listEntry (HELPER_HappyToRelocate.getForSQL(dummyHappyToRelocate, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_HappyToRelocate))).listEntry (HELPER_IsEmailIngest.getForSQL(dummyIsEmailIngest, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_IsEmailIngest))).listEntry (HELPER_ApplicantSource.getForSQL(dummyApplicantSource, tl_job_applicationPSet.getAttrib (JobApplication.FIELD_ApplicantSource))) .listEntry (SQLManager.CheckNull((Long)(tl_job_applicationPSet.getAttrib (JobApplication.SINGLEREFERENCE_Candidate)))).listEntry (SQLManager.CheckNull((Long)(tl_job_applicationPSet.getAttrib (JobApplication.SINGLEREFERENCE_Job)))).listEntry (SQLManager.CheckNull((Long)(tl_job_applicationPSet.getAttrib (JobApplication.SINGLEREFERENCE_WorkFlowStage)))) .listEntry (objectID.longID ()).toList().toArray());
tl_job_applicationPSet.setStatus (PersistentSetStatus.PROCESSED);
}
......
......@@ -16,7 +16,7 @@
<ATTRIB name="BusinessHoursOnly" type="Boolean" dbcol="business_hours_only" mandatory="false" defaultValue="Boolean.FALSE"/>
<ATTRIB name="MessageContent" type="String" dbcol="message_content" mandatory="true" />
<ATTRIB name="TemplateType" type="TemplateType" dbcol="template_type" attribHelper="EnumeratedAttributeHelper" mandatory="true" defaultValue="TemplateType.EMAIL"/>
<ATTRIB name="IsGlobalTemplate" type="Boolean" dbcol="is_global_template" mandatory="false"/>
<ATTRIB name="RelatedToJob" type="Boolean" dbcol="related_to_job" mandatory="false" defaultValue="Boolean.FALSE"/>
<ATTRIB name="IsSystemGenerated" type="Boolean" dbcol="is_system_generated" mandatory="false" defaultValue="Boolean.FALSE"/>
<SINGLEREFERENCE name="HiringTeam" type="HiringTeam" dbcol="hiring_team_id" backreferenceName="MessageTemplates" mandatory="false"/>
......
......@@ -38,7 +38,7 @@ public class MessageTemplatePersistenceMgr extends ObjectPersistenceMgr
private Boolean dummyBusinessHoursOnly;
private String dummyMessageContent;
private TemplateType dummyTemplateType;
private Boolean dummyIsGlobalTemplate;
private Boolean dummyRelatedToJob;
private Boolean dummyIsSystemGenerated;
......@@ -53,7 +53,7 @@ public class MessageTemplatePersistenceMgr extends ObjectPersistenceMgr
private static final DefaultAttributeHelper HELPER_BusinessHoursOnly = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_MessageContent = DefaultAttributeHelper.INSTANCE;
private static final EnumeratedAttributeHelper HELPER_TemplateType = new EnumeratedAttributeHelper (TemplateType.FACTORY_TemplateType);
private static final DefaultAttributeHelper HELPER_IsGlobalTemplate = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_RelatedToJob = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_IsSystemGenerated = DefaultAttributeHelper.INSTANCE;
......@@ -71,12 +71,12 @@ public class MessageTemplatePersistenceMgr extends ObjectPersistenceMgr
dummyBusinessHoursOnly = (Boolean)(HELPER_BusinessHoursOnly.initialise (dummyBusinessHoursOnly));
dummyMessageContent = (String)(HELPER_MessageContent.initialise (dummyMessageContent));
dummyTemplateType = (TemplateType)(HELPER_TemplateType.initialise (dummyTemplateType));
dummyIsGlobalTemplate = (Boolean)(HELPER_IsGlobalTemplate.initialise (dummyIsGlobalTemplate));
dummyRelatedToJob = (Boolean)(HELPER_RelatedToJob.initialise (dummyRelatedToJob));
dummyIsSystemGenerated = (Boolean)(HELPER_IsSystemGenerated.initialise (dummyIsSystemGenerated));
}
private String SELECT_COLUMNS = "{PREFIX}tl_message_template.object_id as id, {PREFIX}tl_message_template.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_message_template.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_message_template.message_id, {PREFIX}tl_message_template.template_name, {PREFIX}tl_message_template.subject, {PREFIX}tl_message_template.application_status, {PREFIX}tl_message_template.delay_hrs, {PREFIX}tl_message_template.delay_min, {PREFIX}tl_message_template.variance, {PREFIX}tl_message_template.business_hours_only, {PREFIX}tl_message_template.message_content, {PREFIX}tl_message_template.template_type, {PREFIX}tl_message_template.is_global_template, {PREFIX}tl_message_template.is_system_generated, {PREFIX}tl_message_template.hiring_team_id, 1 AS commasafe ";
private String SELECT_COLUMNS = "{PREFIX}tl_message_template.object_id as id, {PREFIX}tl_message_template.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_message_template.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_message_template.message_id, {PREFIX}tl_message_template.template_name, {PREFIX}tl_message_template.subject, {PREFIX}tl_message_template.application_status, {PREFIX}tl_message_template.delay_hrs, {PREFIX}tl_message_template.delay_min, {PREFIX}tl_message_template.variance, {PREFIX}tl_message_template.business_hours_only, {PREFIX}tl_message_template.message_content, {PREFIX}tl_message_template.template_type, {PREFIX}tl_message_template.related_to_job, {PREFIX}tl_message_template.is_system_generated, {PREFIX}tl_message_template.hiring_team_id, 1 AS commasafe ";
private String SELECT_JOINS = "";
public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
......@@ -137,7 +137,7 @@ public class MessageTemplatePersistenceMgr extends ObjectPersistenceMgr
!tl_message_templatePSet.containsAttrib(MessageTemplate.FIELD_BusinessHoursOnly)||
!tl_message_templatePSet.containsAttrib(MessageTemplate.FIELD_MessageContent)||
!tl_message_templatePSet.containsAttrib(MessageTemplate.FIELD_TemplateType)||
!tl_message_templatePSet.containsAttrib(MessageTemplate.FIELD_IsGlobalTemplate)||
!tl_message_templatePSet.containsAttrib(MessageTemplate.FIELD_RelatedToJob)||
!tl_message_templatePSet.containsAttrib(MessageTemplate.FIELD_IsSystemGenerated)||
!tl_message_templatePSet.containsAttrib(MessageTemplate.SINGLEREFERENCE_HiringTeam))
{
......@@ -219,10 +219,10 @@ public class MessageTemplatePersistenceMgr extends ObjectPersistenceMgr
{
int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}tl_message_template " +
"SET message_id = ?, template_name = ?, subject = ?, application_status = ?, delay_hrs = ?, delay_min = ?, variance = ?, business_hours_only = ?, message_content = ?, template_type = ?, is_global_template = ?, is_system_generated = ?, hiring_team_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"SET message_id = ?, template_name = ?, subject = ?, application_status = ?, delay_hrs = ?, delay_min = ?, variance = ?, business_hours_only = ?, message_content = ?, template_type = ?, related_to_job = ?, is_system_generated = ?, hiring_team_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE tl_message_template.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ",
CollectionUtils.listEntry (HELPER_MessageID.getForSQL(dummyMessageID, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_MessageID))).listEntry (HELPER_TemplateName.getForSQL(dummyTemplateName, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_TemplateName))).listEntry (HELPER_Subject.getForSQL(dummySubject, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_Subject))).listEntry (HELPER_ApplicationStatus.getForSQL(dummyApplicationStatus, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_ApplicationStatus))).listEntry (HELPER_DelayHrs.getForSQL(dummyDelayHrs, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_DelayHrs))).listEntry (HELPER_DelayMin.getForSQL(dummyDelayMin, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_DelayMin))).listEntry (HELPER_Variance.getForSQL(dummyVariance, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_Variance))).listEntry (HELPER_BusinessHoursOnly.getForSQL(dummyBusinessHoursOnly, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_BusinessHoursOnly))).listEntry (HELPER_MessageContent.getForSQL(dummyMessageContent, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_MessageContent))).listEntry (HELPER_TemplateType.getForSQL(dummyTemplateType, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_TemplateType))).listEntry (HELPER_IsGlobalTemplate.getForSQL(dummyIsGlobalTemplate, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_IsGlobalTemplate))).listEntry (HELPER_IsSystemGenerated.getForSQL(dummyIsSystemGenerated, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_IsSystemGenerated))).listEntry (SQLManager.CheckNull((Long)(tl_message_templatePSet.getAttrib (MessageTemplate.SINGLEREFERENCE_HiringTeam)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
CollectionUtils.listEntry (HELPER_MessageID.getForSQL(dummyMessageID, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_MessageID))).listEntry (HELPER_TemplateName.getForSQL(dummyTemplateName, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_TemplateName))).listEntry (HELPER_Subject.getForSQL(dummySubject, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_Subject))).listEntry (HELPER_ApplicationStatus.getForSQL(dummyApplicationStatus, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_ApplicationStatus))).listEntry (HELPER_DelayHrs.getForSQL(dummyDelayHrs, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_DelayHrs))).listEntry (HELPER_DelayMin.getForSQL(dummyDelayMin, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_DelayMin))).listEntry (HELPER_Variance.getForSQL(dummyVariance, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_Variance))).listEntry (HELPER_BusinessHoursOnly.getForSQL(dummyBusinessHoursOnly, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_BusinessHoursOnly))).listEntry (HELPER_MessageContent.getForSQL(dummyMessageContent, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_MessageContent))).listEntry (HELPER_TemplateType.getForSQL(dummyTemplateType, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_TemplateType))).listEntry (HELPER_RelatedToJob.getForSQL(dummyRelatedToJob, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_RelatedToJob))).listEntry (HELPER_IsSystemGenerated.getForSQL(dummyIsSystemGenerated, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_IsSystemGenerated))).listEntry (SQLManager.CheckNull((Long)(tl_message_templatePSet.getAttrib (MessageTemplate.SINGLEREFERENCE_HiringTeam)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
if (rowsUpdated != 1)
{
......@@ -488,7 +488,7 @@ public class MessageTemplatePersistenceMgr extends ObjectPersistenceMgr
tl_message_templatePSet.setAttrib(MessageTemplate.FIELD_BusinessHoursOnly, HELPER_BusinessHoursOnly.getFromRS(dummyBusinessHoursOnly, r, "business_hours_only"));
tl_message_templatePSet.setAttrib(MessageTemplate.FIELD_MessageContent, HELPER_MessageContent.getFromRS(dummyMessageContent, r, "message_content"));
tl_message_templatePSet.setAttrib(MessageTemplate.FIELD_TemplateType, HELPER_TemplateType.getFromRS(dummyTemplateType, r, "template_type"));
tl_message_templatePSet.setAttrib(MessageTemplate.FIELD_IsGlobalTemplate, HELPER_IsGlobalTemplate.getFromRS(dummyIsGlobalTemplate, r, "is_global_template"));
tl_message_templatePSet.setAttrib(MessageTemplate.FIELD_RelatedToJob, HELPER_RelatedToJob.getFromRS(dummyRelatedToJob, r, "related_to_job"));
tl_message_templatePSet.setAttrib(MessageTemplate.FIELD_IsSystemGenerated, HELPER_IsSystemGenerated.getFromRS(dummyIsSystemGenerated, r, "is_system_generated"));
tl_message_templatePSet.setAttrib(MessageTemplate.SINGLEREFERENCE_HiringTeam, r.getObject ("hiring_team_id"));
......@@ -508,10 +508,10 @@ public class MessageTemplatePersistenceMgr extends ObjectPersistenceMgr
{
executeStatement (sqlMgr,
"INSERT INTO {PREFIX}tl_message_template " +
" (message_id, template_name, subject, application_status, delay_hrs, delay_min, variance, business_hours_only, message_content, template_type, is_global_template, is_system_generated, hiring_team_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
" (message_id, template_name, subject, application_status, delay_hrs, delay_min, variance, business_hours_only, message_content, template_type, related_to_job, is_system_generated, hiring_team_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
"VALUES " +
" (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_MessageID.getForSQL(dummyMessageID, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_MessageID))).listEntry (HELPER_TemplateName.getForSQL(dummyTemplateName, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_TemplateName))).listEntry (HELPER_Subject.getForSQL(dummySubject, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_Subject))).listEntry (HELPER_ApplicationStatus.getForSQL(dummyApplicationStatus, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_ApplicationStatus))).listEntry (HELPER_DelayHrs.getForSQL(dummyDelayHrs, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_DelayHrs))).listEntry (HELPER_DelayMin.getForSQL(dummyDelayMin, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_DelayMin))).listEntry (HELPER_Variance.getForSQL(dummyVariance, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_Variance))).listEntry (HELPER_BusinessHoursOnly.getForSQL(dummyBusinessHoursOnly, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_BusinessHoursOnly))).listEntry (HELPER_MessageContent.getForSQL(dummyMessageContent, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_MessageContent))).listEntry (HELPER_TemplateType.getForSQL(dummyTemplateType, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_TemplateType))).listEntry (HELPER_IsGlobalTemplate.getForSQL(dummyIsGlobalTemplate, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_IsGlobalTemplate))).listEntry (HELPER_IsSystemGenerated.getForSQL(dummyIsSystemGenerated, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_IsSystemGenerated))) .listEntry (SQLManager.CheckNull((Long)(tl_message_templatePSet.getAttrib (MessageTemplate.SINGLEREFERENCE_HiringTeam)))) .listEntry (objectID.longID ()).toList().toArray());
CollectionUtils.listEntry (HELPER_MessageID.getForSQL(dummyMessageID, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_MessageID))).listEntry (HELPER_TemplateName.getForSQL(dummyTemplateName, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_TemplateName))).listEntry (HELPER_Subject.getForSQL(dummySubject, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_Subject))).listEntry (HELPER_ApplicationStatus.getForSQL(dummyApplicationStatus, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_ApplicationStatus))).listEntry (HELPER_DelayHrs.getForSQL(dummyDelayHrs, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_DelayHrs))).listEntry (HELPER_DelayMin.getForSQL(dummyDelayMin, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_DelayMin))).listEntry (HELPER_Variance.getForSQL(dummyVariance, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_Variance))).listEntry (HELPER_BusinessHoursOnly.getForSQL(dummyBusinessHoursOnly, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_BusinessHoursOnly))).listEntry (HELPER_MessageContent.getForSQL(dummyMessageContent, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_MessageContent))).listEntry (HELPER_TemplateType.getForSQL(dummyTemplateType, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_TemplateType))).listEntry (HELPER_RelatedToJob.getForSQL(dummyRelatedToJob, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_RelatedToJob))).listEntry (HELPER_IsSystemGenerated.getForSQL(dummyIsSystemGenerated, tl_message_templatePSet.getAttrib (MessageTemplate.FIELD_IsSystemGenerated))) .listEntry (SQLManager.CheckNull((Long)(tl_message_templatePSet.getAttrib (MessageTemplate.SINGLEREFERENCE_HiringTeam)))) .listEntry (objectID.longID ()).toList().toArray());
tl_message_templatePSet.setStatus (PersistentSetStatus.PROCESSED);
}
......
......@@ -11,6 +11,7 @@
<ATTRIB name="Variance" type="String" dbcol="variance" mandatory="false"/>
<ATTRIB name="BusinessHoursOnly" type="Boolean" dbcol="business_hours_only" mandatory="false" defaultValue="Boolean.FALSE"/>
<ATTRIB name="IsWithdrawalMessage" type="Boolean" dbcol="is_withdrawal_message" mandatory="false"/>
<ATTRIB name="ApplicantSources" type="Set&lt;ApplicantSource&gt;" dbcol="applicant_sources" mandatory="false" attribHelper="DelimitedEnumsAttributeHelper" attribHelperInstance="new DelimitedEnumsAttributeHelper (ApplicantSource.FACTORY_ApplicantSource)"/>
<SINGLEREFERENCE name="MessageTemplate" type="MessageTemplate" dbcol="message_template_id" />
<SINGLEREFERENCE name="WorkFlowStage" type="WorkFlowStage" dbcol="work_flow_stage_id" backreferenceName="WorkFlowMessages" mandatory="false"/>
......
......@@ -31,6 +31,7 @@ public class WorkFlowMessagePersistenceMgr extends ObjectPersistenceMgr
private String dummyVariance;
private Boolean dummyBusinessHoursOnly;
private Boolean dummyIsWithdrawalMessage;
private Set<ApplicantSource> dummyApplicantSources;
// Static constants corresponding to attribute helpers
......@@ -38,6 +39,7 @@ public class WorkFlowMessagePersistenceMgr extends ObjectPersistenceMgr
private static final DefaultAttributeHelper HELPER_Variance = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_BusinessHoursOnly = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_IsWithdrawalMessage = DefaultAttributeHelper.INSTANCE;
private static final DelimitedEnumsAttributeHelper HELPER_ApplicantSources = new DelimitedEnumsAttributeHelper (ApplicantSource.FACTORY_ApplicantSource);
......@@ -48,10 +50,11 @@ public class WorkFlowMessagePersistenceMgr extends ObjectPersistenceMgr
dummyVariance = (String)(HELPER_Variance.initialise (dummyVariance));
dummyBusinessHoursOnly = (Boolean)(HELPER_BusinessHoursOnly.initialise (dummyBusinessHoursOnly));
dummyIsWithdrawalMessage = (Boolean)(HELPER_IsWithdrawalMessage.initialise (dummyIsWithdrawalMessage));
dummyApplicantSources = (Set<ApplicantSource>)(HELPER_ApplicantSources.initialise (dummyApplicantSources));
}
private String SELECT_COLUMNS = "{PREFIX}tl_work_flow_message.object_id as id, {PREFIX}tl_work_flow_message.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_work_flow_message.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_work_flow_message.delay, {PREFIX}tl_work_flow_message.variance, {PREFIX}tl_work_flow_message.business_hours_only, {PREFIX}tl_work_flow_message.is_withdrawal_message, {PREFIX}tl_work_flow_message.message_template_id, {PREFIX}tl_work_flow_message.work_flow_stage_id, 1 AS commasafe ";
private String SELECT_COLUMNS = "{PREFIX}tl_work_flow_message.object_id as id, {PREFIX}tl_work_flow_message.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_work_flow_message.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_work_flow_message.delay, {PREFIX}tl_work_flow_message.variance, {PREFIX}tl_work_flow_message.business_hours_only, {PREFIX}tl_work_flow_message.is_withdrawal_message, {PREFIX}tl_work_flow_message.applicant_sources, {PREFIX}tl_work_flow_message.message_template_id, {PREFIX}tl_work_flow_message.work_flow_stage_id, 1 AS commasafe ";
private String SELECT_JOINS = "";
public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
......@@ -106,6 +109,7 @@ public class WorkFlowMessagePersistenceMgr extends ObjectPersistenceMgr
!tl_work_flow_messagePSet.containsAttrib(WorkFlowMessage.FIELD_Variance)||
!tl_work_flow_messagePSet.containsAttrib(WorkFlowMessage.FIELD_BusinessHoursOnly)||
!tl_work_flow_messagePSet.containsAttrib(WorkFlowMessage.FIELD_IsWithdrawalMessage)||
!tl_work_flow_messagePSet.containsAttrib(WorkFlowMessage.FIELD_ApplicantSources)||
!tl_work_flow_messagePSet.containsAttrib(WorkFlowMessage.SINGLEREFERENCE_MessageTemplate)||
!tl_work_flow_messagePSet.containsAttrib(WorkFlowMessage.SINGLEREFERENCE_WorkFlowStage))
{
......@@ -187,10 +191,10 @@ public class WorkFlowMessagePersistenceMgr extends ObjectPersistenceMgr
{
int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}tl_work_flow_message " +
"SET delay = ?, variance = ?, business_hours_only = ?, is_withdrawal_message = ?, message_template_id = ? , work_flow_stage_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"SET delay = ?, variance = ?, business_hours_only = ?, is_withdrawal_message = ?, applicant_sources = ?, message_template_id = ? , work_flow_stage_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE tl_work_flow_message.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ",
CollectionUtils.listEntry (HELPER_Delay.getForSQL(dummyDelay, tl_work_flow_messagePSet.getAttrib (WorkFlowMessage.FIELD_Delay))).listEntry (HELPER_Variance.getForSQL(dummyVariance, tl_work_flow_messagePSet.getAttrib (WorkFlowMessage.FIELD_Variance))).listEntry (HELPER_BusinessHoursOnly.getForSQL(dummyBusinessHoursOnly, tl_work_flow_messagePSet.getAttrib (WorkFlowMessage.FIELD_BusinessHoursOnly))).listEntry (HELPER_IsWithdrawalMessage.getForSQL(dummyIsWithdrawalMessage, tl_work_flow_messagePSet.getAttrib (WorkFlowMessage.FIELD_IsWithdrawalMessage))).listEntry (SQLManager.CheckNull((Long)(tl_work_flow_messagePSet.getAttrib (WorkFlowMessage.SINGLEREFERENCE_MessageTemplate)))).listEntry (SQLManager.CheckNull((Long)(tl_work_flow_messagePSet.getAttrib (WorkFlowMessage.SINGLEREFERENCE_WorkFlowStage)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
CollectionUtils.listEntry (HELPER_Delay.getForSQL(dummyDelay, tl_work_flow_messagePSet.getAttrib (WorkFlowMessage.FIELD_Delay))).listEntry (HELPER_Variance.getForSQL(dummyVariance, tl_work_flow_messagePSet.getAttrib (WorkFlowMessage.FIELD_Variance))).listEntry (HELPER_BusinessHoursOnly.getForSQL(dummyBusinessHoursOnly, tl_work_flow_messagePSet.getAttrib (WorkFlowMessage.FIELD_BusinessHoursOnly))).listEntry (HELPER_IsWithdrawalMessage.getForSQL(dummyIsWithdrawalMessage, tl_work_flow_messagePSet.getAttrib (WorkFlowMessage.FIELD_IsWithdrawalMessage))).listEntry (HELPER_ApplicantSources.getForSQL(dummyApplicantSources, tl_work_flow_messagePSet.getAttrib (WorkFlowMessage.FIELD_ApplicantSources))).listEntry (SQLManager.CheckNull((Long)(tl_work_flow_messagePSet.getAttrib (WorkFlowMessage.SINGLEREFERENCE_MessageTemplate)))).listEntry (SQLManager.CheckNull((Long)(tl_work_flow_messagePSet.getAttrib (WorkFlowMessage.SINGLEREFERENCE_WorkFlowStage)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
if (rowsUpdated != 1)
{
......@@ -450,6 +454,7 @@ public class WorkFlowMessagePersistenceMgr extends ObjectPersistenceMgr
tl_work_flow_messagePSet.setAttrib(WorkFlowMessage.FIELD_Variance, HELPER_Variance.getFromRS(dummyVariance, r, "variance"));
tl_work_flow_messagePSet.setAttrib(WorkFlowMessage.FIELD_BusinessHoursOnly, HELPER_BusinessHoursOnly.getFromRS(dummyBusinessHoursOnly, r, "business_hours_only"));
tl_work_flow_messagePSet.setAttrib(WorkFlowMessage.FIELD_IsWithdrawalMessage, HELPER_IsWithdrawalMessage.getFromRS(dummyIsWithdrawalMessage, r, "is_withdrawal_message"));
tl_work_flow_messagePSet.setAttrib(WorkFlowMessage.FIELD_ApplicantSources, HELPER_ApplicantSources.getFromRS(dummyApplicantSources, r, "applicant_sources"));
tl_work_flow_messagePSet.setAttrib(WorkFlowMessage.SINGLEREFERENCE_MessageTemplate, r.getObject ("message_template_id"));
tl_work_flow_messagePSet.setAttrib(WorkFlowMessage.SINGLEREFERENCE_WorkFlowStage, r.getObject ("work_flow_stage_id"));
......@@ -469,10 +474,10 @@ public class WorkFlowMessagePersistenceMgr extends ObjectPersistenceMgr
{
executeStatement (sqlMgr,
"INSERT INTO {PREFIX}tl_work_flow_message " +
" (delay, variance, business_hours_only, is_withdrawal_message, message_template_id, work_flow_stage_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
" (delay, variance, business_hours_only, is_withdrawal_message, applicant_sources, message_template_id, work_flow_stage_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
"VALUES " +
" (?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_Delay.getForSQL(dummyDelay, tl_work_flow_messagePSet.getAttrib (WorkFlowMessage.FIELD_Delay))).listEntry (HELPER_Variance.getForSQL(dummyVariance, tl_work_flow_messagePSet.getAttrib (WorkFlowMessage.FIELD_Variance))).listEntry (HELPER_BusinessHoursOnly.getForSQL(dummyBusinessHoursOnly, tl_work_flow_messagePSet.getAttrib (WorkFlowMessage.FIELD_BusinessHoursOnly))).listEntry (HELPER_IsWithdrawalMessage.getForSQL(dummyIsWithdrawalMessage, tl_work_flow_messagePSet.getAttrib (WorkFlowMessage.FIELD_IsWithdrawalMessage))) .listEntry (SQLManager.CheckNull((Long)(tl_work_flow_messagePSet.getAttrib (WorkFlowMessage.SINGLEREFERENCE_MessageTemplate)))).listEntry (SQLManager.CheckNull((Long)(tl_work_flow_messagePSet.getAttrib (WorkFlowMessage.SINGLEREFERENCE_WorkFlowStage)))) .listEntry (objectID.longID ()).toList().toArray());
" (?, ?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_Delay.getForSQL(dummyDelay, tl_work_flow_messagePSet.getAttrib (WorkFlowMessage.FIELD_Delay))).listEntry (HELPER_Variance.getForSQL(dummyVariance, tl_work_flow_messagePSet.getAttrib (WorkFlowMessage.FIELD_Variance))).listEntry (HELPER_BusinessHoursOnly.getForSQL(dummyBusinessHoursOnly, tl_work_flow_messagePSet.getAttrib (WorkFlowMessage.FIELD_BusinessHoursOnly))).listEntry (HELPER_IsWithdrawalMessage.getForSQL(dummyIsWithdrawalMessage, tl_work_flow_messagePSet.getAttrib (WorkFlowMessage.FIELD_IsWithdrawalMessage))).listEntry (HELPER_ApplicantSources.getForSQL(dummyApplicantSources, tl_work_flow_messagePSet.getAttrib (WorkFlowMessage.FIELD_ApplicantSources))) .listEntry (SQLManager.CheckNull((Long)(tl_work_flow_messagePSet.getAttrib (WorkFlowMessage.SINGLEREFERENCE_MessageTemplate)))).listEntry (SQLManager.CheckNull((Long)(tl_work_flow_messagePSet.getAttrib (WorkFlowMessage.SINGLEREFERENCE_WorkFlowStage)))) .listEntry (objectID.longID ()).toList().toArray());
tl_work_flow_messagePSet.setStatus (PersistentSetStatus.PROCESSED);
}
......
......@@ -6,6 +6,7 @@
<IMPORT value="performa.orm.types.*"/>
<MULTIPLEREFERENCE name="WorkFlowMessages" type="WorkFlowMessage" backreferenceName="WorkFlowStage" />
<MULTIPLEREFERENCE name="Steps" type="WorkFlowStep" backreferenceName="WorkFlowStage" />
<TABLE name="tl_work_flow_stage" tablePrefix="object" polymorphic="FALSE">
......@@ -13,6 +14,7 @@
<ATTRIB name="UseMessaging" type="Boolean" dbcol="use_messaging" mandatory="false" defaultValue="Boolean.FALSE"/>
<ATTRIB name="StageType" type="StageType" dbcol="stage_type" attribHelper="EnumeratedAttributeHelper" mandatory="true"/>
<ATTRIB name="SortOrder" type="Integer" dbcol="sort_order" mandatory="true"/>
<ATTRIB name="AutoProgress" type="Boolean" dbcol="auto_progress" mandatory="false" defaultValue="Boolean.FALSE"/>
<SINGLEREFERENCE name="WithdrawalMessage" type="WorkFlowMessage" dbcol="withdrawal_message_id" />
<SINGLEREFERENCE name="WorkFlowTemplate" type="WorkFlowTemplate" dbcol="work_flow_template_id" backreferenceName="WorkFlowStages" mandatory="true"/>
......
......@@ -31,6 +31,7 @@ public class WorkFlowStagePersistenceMgr extends ObjectPersistenceMgr
private Boolean dummyUseMessaging;
private StageType dummyStageType;
private Integer dummySortOrder;
private Boolean dummyAutoProgress;
// Static constants corresponding to attribute helpers
......@@ -38,6 +39,7 @@ public class WorkFlowStagePersistenceMgr extends ObjectPersistenceMgr
private static final DefaultAttributeHelper HELPER_UseMessaging = DefaultAttributeHelper.INSTANCE;
private static final EnumeratedAttributeHelper HELPER_StageType = new EnumeratedAttributeHelper (StageType.FACTORY_StageType);
private static final DefaultAttributeHelper HELPER_SortOrder = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_AutoProgress = DefaultAttributeHelper.INSTANCE;
......@@ -48,10 +50,11 @@ public class WorkFlowStagePersistenceMgr extends ObjectPersistenceMgr
dummyUseMessaging = (Boolean)(HELPER_UseMessaging.initialise (dummyUseMessaging));
dummyStageType = (StageType)(HELPER_StageType.initialise (dummyStageType));
dummySortOrder = (Integer)(HELPER_SortOrder.initialise (dummySortOrder));
dummyAutoProgress = (Boolean)(HELPER_AutoProgress.initialise (dummyAutoProgress));
}
private String SELECT_COLUMNS = "{PREFIX}tl_work_flow_stage.object_id as id, {PREFIX}tl_work_flow_stage.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_work_flow_stage.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_work_flow_stage.name, {PREFIX}tl_work_flow_stage.use_messaging, {PREFIX}tl_work_flow_stage.stage_type, {PREFIX}tl_work_flow_stage.sort_order, {PREFIX}tl_work_flow_stage.withdrawal_message_id, {PREFIX}tl_work_flow_stage.work_flow_template_id, 1 AS commasafe ";
private String SELECT_COLUMNS = "{PREFIX}tl_work_flow_stage.object_id as id, {PREFIX}tl_work_flow_stage.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_work_flow_stage.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_work_flow_stage.name, {PREFIX}tl_work_flow_stage.use_messaging, {PREFIX}tl_work_flow_stage.stage_type, {PREFIX}tl_work_flow_stage.sort_order, {PREFIX}tl_work_flow_stage.auto_progress, {PREFIX}tl_work_flow_stage.withdrawal_message_id, {PREFIX}tl_work_flow_stage.work_flow_template_id, 1 AS commasafe ";
private String SELECT_JOINS = "";
public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
......@@ -106,6 +109,7 @@ public class WorkFlowStagePersistenceMgr extends ObjectPersistenceMgr
!tl_work_flow_stagePSet.containsAttrib(WorkFlowStage.FIELD_UseMessaging)||
!tl_work_flow_stagePSet.containsAttrib(WorkFlowStage.FIELD_StageType)||
!tl_work_flow_stagePSet.containsAttrib(WorkFlowStage.FIELD_SortOrder)||
!tl_work_flow_stagePSet.containsAttrib(WorkFlowStage.FIELD_AutoProgress)||
!tl_work_flow_stagePSet.containsAttrib(WorkFlowStage.SINGLEREFERENCE_WithdrawalMessage)||
!tl_work_flow_stagePSet.containsAttrib(WorkFlowStage.SINGLEREFERENCE_WorkFlowTemplate))
{
......@@ -187,10 +191,10 @@ public class WorkFlowStagePersistenceMgr extends ObjectPersistenceMgr
{
int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}tl_work_flow_stage " +
"SET name = ?, use_messaging = ?, stage_type = ?, sort_order = ?, withdrawal_message_id = ? , work_flow_template_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"SET name = ?, use_messaging = ?, stage_type = ?, sort_order = ?, auto_progress = ?, withdrawal_message_id = ? , work_flow_template_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE tl_work_flow_stage.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ",
CollectionUtils.listEntry (HELPER_Name.getForSQL(dummyName, tl_work_flow_stagePSet.getAttrib (WorkFlowStage.FIELD_Name))).listEntry (HELPER_UseMessaging.getForSQL(dummyUseMessaging, tl_work_flow_stagePSet.getAttrib (WorkFlowStage.FIELD_UseMessaging))).listEntry (HELPER_StageType.getForSQL(dummyStageType, tl_work_flow_stagePSet.getAttrib (WorkFlowStage.FIELD_StageType))).listEntry (HELPER_SortOrder.getForSQL(dummySortOrder, tl_work_flow_stagePSet.getAttrib (WorkFlowStage.FIELD_SortOrder))).listEntry (SQLManager.CheckNull((Long)(tl_work_flow_stagePSet.getAttrib (WorkFlowStage.SINGLEREFERENCE_WithdrawalMessage)))).listEntry (SQLManager.CheckNull((Long)(tl_work_flow_stagePSet.getAttrib (WorkFlowStage.SINGLEREFERENCE_WorkFlowTemplate)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
CollectionUtils.listEntry (HELPER_Name.getForSQL(dummyName, tl_work_flow_stagePSet.getAttrib (WorkFlowStage.FIELD_Name))).listEntry (HELPER_UseMessaging.getForSQL(dummyUseMessaging, tl_work_flow_stagePSet.getAttrib (WorkFlowStage.FIELD_UseMessaging))).listEntry (HELPER_StageType.getForSQL(dummyStageType, tl_work_flow_stagePSet.getAttrib (WorkFlowStage.FIELD_StageType))).listEntry (HELPER_SortOrder.getForSQL(dummySortOrder, tl_work_flow_stagePSet.getAttrib (WorkFlowStage.FIELD_SortOrder))).listEntry (HELPER_AutoProgress.getForSQL(dummyAutoProgress, tl_work_flow_stagePSet.getAttrib (WorkFlowStage.FIELD_AutoProgress))).listEntry (SQLManager.CheckNull((Long)(tl_work_flow_stagePSet.getAttrib (WorkFlowStage.SINGLEREFERENCE_WithdrawalMessage)))).listEntry (SQLManager.CheckNull((Long)(tl_work_flow_stagePSet.getAttrib (WorkFlowStage.SINGLEREFERENCE_WorkFlowTemplate)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
if (rowsUpdated != 1)
{
......@@ -450,6 +454,7 @@ public class WorkFlowStagePersistenceMgr extends ObjectPersistenceMgr
tl_work_flow_stagePSet.setAttrib(WorkFlowStage.FIELD_UseMessaging, HELPER_UseMessaging.getFromRS(dummyUseMessaging, r, "use_messaging"));
tl_work_flow_stagePSet.setAttrib(WorkFlowStage.FIELD_StageType, HELPER_StageType.getFromRS(dummyStageType, r, "stage_type"));
tl_work_flow_stagePSet.setAttrib(WorkFlowStage.FIELD_SortOrder, HELPER_SortOrder.getFromRS(dummySortOrder, r, "sort_order"));
tl_work_flow_stagePSet.setAttrib(WorkFlowStage.FIELD_AutoProgress, HELPER_AutoProgress.getFromRS(dummyAutoProgress, r, "auto_progress"));
tl_work_flow_stagePSet.setAttrib(WorkFlowStage.SINGLEREFERENCE_WithdrawalMessage, r.getObject ("withdrawal_message_id"));
tl_work_flow_stagePSet.setAttrib(WorkFlowStage.SINGLEREFERENCE_WorkFlowTemplate, r.getObject ("work_flow_template_id"));
......@@ -469,10 +474,10 @@ public class WorkFlowStagePersistenceMgr extends ObjectPersistenceMgr
{
executeStatement (sqlMgr,
"INSERT INTO {PREFIX}tl_work_flow_stage " +
" (name, use_messaging, stage_type, sort_order, withdrawal_message_id, work_flow_template_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
" (name, use_messaging, stage_type, sort_order, auto_progress, withdrawal_message_id, work_flow_template_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
"VALUES " +
" (?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_Name.getForSQL(dummyName, tl_work_flow_stagePSet.getAttrib (WorkFlowStage.FIELD_Name))).listEntry (HELPER_UseMessaging.getForSQL(dummyUseMessaging, tl_work_flow_stagePSet.getAttrib (WorkFlowStage.FIELD_UseMessaging))).listEntry (HELPER_StageType.getForSQL(dummyStageType, tl_work_flow_stagePSet.getAttrib (WorkFlowStage.FIELD_StageType))).listEntry (HELPER_SortOrder.getForSQL(dummySortOrder, tl_work_flow_stagePSet.getAttrib (WorkFlowStage.FIELD_SortOrder))) .listEntry (SQLManager.CheckNull((Long)(tl_work_flow_stagePSet.getAttrib (WorkFlowStage.SINGLEREFERENCE_WithdrawalMessage)))).listEntry (SQLManager.CheckNull((Long)(tl_work_flow_stagePSet.getAttrib (WorkFlowStage.SINGLEREFERENCE_WorkFlowTemplate)))) .listEntry (objectID.longID ()).toList().toArray());
" (?, ?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_Name.getForSQL(dummyName, tl_work_flow_stagePSet.getAttrib (WorkFlowStage.FIELD_Name))).listEntry (HELPER_UseMessaging.getForSQL(dummyUseMessaging, tl_work_flow_stagePSet.getAttrib (WorkFlowStage.FIELD_UseMessaging))).listEntry (HELPER_StageType.getForSQL(dummyStageType, tl_work_flow_stagePSet.getAttrib (WorkFlowStage.FIELD_StageType))).listEntry (HELPER_SortOrder.getForSQL(dummySortOrder, tl_work_flow_stagePSet.getAttrib (WorkFlowStage.FIELD_SortOrder))).listEntry (HELPER_AutoProgress.getForSQL(dummyAutoProgress, tl_work_flow_stagePSet.getAttrib (WorkFlowStage.FIELD_AutoProgress))) .listEntry (SQLManager.CheckNull((Long)(tl_work_flow_stagePSet.getAttrib (WorkFlowStage.SINGLEREFERENCE_WithdrawalMessage)))).listEntry (SQLManager.CheckNull((Long)(tl_work_flow_stagePSet.getAttrib (WorkFlowStage.SINGLEREFERENCE_WorkFlowTemplate)))) .listEntry (objectID.longID ()).toList().toArray());
tl_work_flow_stagePSet.setStatus (PersistentSetStatus.PROCESSED);
}
......
package performa.orm;
import java.io.*;
import java.util.*;
import oneit.appservices.config.*;
import oneit.logging.*;
import oneit.objstore.*;
import oneit.utils.*;
import performa.orm.types.*;
public class WorkFlowStep extends BaseWorkFlowStep
{
private static final long serialVersionUID = 0L;
// This constructor should not be called
public WorkFlowStep ()
{
// Do not add any code to this, always put it in initialiseNewObject
}
}
<?xml version="1.0" encoding="UTF-8"?>
<ROOT xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='http://www.oneit.com.au/schemas/5.2/BusinessObject.xsd'>
<BUSINESSCLASS name="WorkFlowStep" package="performa.orm">
<IMPORT value="performa.orm.types.*"/>
<TABLE name="tl_work_flow_step" tablePrefix="object" polymorphic="FALSE">
<ATTRIB name="SortOrder" type="Integer" dbcol="sort_order" mandatory="true"/>
<ATTRIB name="StepType" type="StepType" dbcol="step_type" mandatory="true" attribHelper="EnumeratedAttributeHelper"/>
<SINGLEREFERENCE name="WorkFlowStage" type="WorkFlowStage" dbcol="work_flow_stage_id" backreferenceName="Steps" mandatory="true"/>
</TABLE>
<SEARCH type="All" paramFilter="tl_work_flow_step.object_id is not null" orderBy="tl_work_flow_step.object_id" />
</BUSINESSCLASS>
</ROOT>
\ No newline at end of file
package performa.orm;
import java.io.*;
import java.util.*;
import java.sql.ResultSet;
import java.sql.SQLException;
import oneit.logging.*;
import oneit.objstore.*;
import oneit.objstore.assocs.*;
import oneit.objstore.rdbms.*;
import oneit.objstore.utils.*;
import oneit.sql.*;
import oneit.utils.resource.*;
import oneit.utils.*;
import oneit.utils.threading.*;
import performa.orm.types.*;
/**
* IMPORTANT!!!! Autogenerated class, DO NOT EDIT!!!!!
* Template: Infrastructure8.2[oneit.objstore.PersistenceMgrTemplate.xsl]
*/
public class WorkFlowStepPersistenceMgr extends ObjectPersistenceMgr
{
private static final LoggingArea WorkFlowStepPersistence = LoggingArea.createLoggingArea(ObjectPersistenceMgr.OBJECT_PERSISTENCE, "WorkFlowStep");
// Private attributes corresponding to business object data
private Integer dummySortOrder;
private StepType dummyStepType;
// Static constants corresponding to attribute helpers
private static final DefaultAttributeHelper HELPER_SortOrder = DefaultAttributeHelper.INSTANCE;
private static final EnumeratedAttributeHelper HELPER_StepType = new EnumeratedAttributeHelper (StepType.FACTORY_StepType);
public WorkFlowStepPersistenceMgr ()
{
dummySortOrder = (Integer)(HELPER_SortOrder.initialise (dummySortOrder));
dummyStepType = (StepType)(HELPER_StepType.initialise (dummyStepType));
}
private String SELECT_COLUMNS = "{PREFIX}tl_work_flow_step.object_id as id, {PREFIX}tl_work_flow_step.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_work_flow_step.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_work_flow_step.sort_order, {PREFIX}tl_work_flow_step.step_type, {PREFIX}tl_work_flow_step.work_flow_stage_id, 1 AS commasafe ";
private String SELECT_JOINS = "";
public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
Set<BaseBusinessClass> resultByIDs = fetchByIDs(Collections.singleton (id), allPSets, context, sqlMgr);
if (resultByIDs.isEmpty ())
{
return null;
}
else if (resultByIDs.size () > 1)
{
throw new StorageException ("Multiple results for id:" + id);
}
else
{
return resultByIDs.iterator ().next ();
}
}
public Set<BaseBusinessClass> fetchByIDs(Set<ObjectID> ids, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
Set<BaseBusinessClass> results = new HashSet ();
Set<Long> idsToFetch = new HashSet ();
for (ObjectID id : ids)
{
if (context.containsObject(id)) // Check for cached version
{
BaseBusinessClass objectToReturn = context.getObjectToReplace(id, WorkFlowStep.REFERENCE_WorkFlowStep);
if (objectToReturn instanceof WorkFlowStep)
{
LogMgr.log (WorkFlowStepPersistence, LogLevel.TRACE, "Cache hit for id:", id);
results.add (objectToReturn);
}
else
{
throw new StorageException ("Cache collision for id:" + id + " with object " + objectToReturn + "while fetching a WorkFlowStep");
}
}
PersistentSet tl_work_flow_stepPSet = allPSets.getPersistentSet(id, "tl_work_flow_step", PersistentSetStatus.FETCHED);
// Check for persistent sets already prefetched
if (false || !tl_work_flow_stepPSet.containsAttrib(BaseBusinessClass.FIELD_ObjectLastModified) ||
!tl_work_flow_stepPSet.containsAttrib(WorkFlowStep.FIELD_SortOrder)||
!tl_work_flow_stepPSet.containsAttrib(WorkFlowStep.FIELD_StepType)||
!tl_work_flow_stepPSet.containsAttrib(WorkFlowStep.SINGLEREFERENCE_WorkFlowStage))
{
// We will need to retrieve it
idsToFetch.add (id.longValue());
}
else
{
LogMgr.log (WorkFlowStepPersistence, LogLevel.DEBUG2, "Persistent set preloaded id:", id);
/* Non Polymorphic */
WorkFlowStep result = new WorkFlowStep ();
result.setFromPersistentSets(id, allPSets);
context.addRetrievedObject(result);
results.add (result);
}
}
if (idsToFetch.size () > 0)
{
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}tl_work_flow_step " +
"WHERE " + SELECT_JOINS + "{PREFIX}tl_work_flow_step.object_id IN ?";
BaseBusinessClass[] resultsFetched = loadQuery (allPSets, sqlMgr, context, query, new Object[] { idsToFetch }, null, false);
for (BaseBusinessClass objFetched : resultsFetched)
{
results.add (objFetched);
}
}
return results;
}
public BaseBusinessClass[] getReferencedObjects(ObjectID _objectID, String refName, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
if (false)
{
throw new RuntimeException ();
}
else if (refName.equals (WorkFlowStep.SINGLEREFERENCE_WorkFlowStage))
{
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}tl_work_flow_step " +
"WHERE " + SELECT_JOINS + "work_flow_stage_id = ?";
BaseBusinessClass[] results = loadQuery (allPSets, sqlMgr, context, query, new Object[] { _objectID.longID () }, null, false);
return results;
}
else
{
throw new IllegalArgumentException ("Illegal reference type:" + refName);
}
}
public void update(BaseBusinessClass obj, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, ConcurrentUpdateConflictException, StorageException
{
EqualityResult test = EqualityResult.compare (obj, obj.getBackup ());
ObjectID objectID = obj.getID ();
if (!test.areAttributesEqual () || !test.areSingleAssocsEqual () || obj.getForcedSave())
{
PersistentSet tl_work_flow_stepPSet = allPSets.getPersistentSet(objectID, "tl_work_flow_step");
if (tl_work_flow_stepPSet.getStatus () != PersistentSetStatus.PROCESSED &&
tl_work_flow_stepPSet.getStatus () != PersistentSetStatus.DEFERRED)
{
int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}tl_work_flow_step " +
"SET sort_order = ?, step_type = ?, work_flow_stage_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE tl_work_flow_step.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ",
CollectionUtils.listEntry (HELPER_SortOrder.getForSQL(dummySortOrder, tl_work_flow_stepPSet.getAttrib (WorkFlowStep.FIELD_SortOrder))).listEntry (HELPER_StepType.getForSQL(dummyStepType, tl_work_flow_stepPSet.getAttrib (WorkFlowStep.FIELD_StepType))).listEntry (SQLManager.CheckNull((Long)(tl_work_flow_stepPSet.getAttrib (WorkFlowStep.SINGLEREFERENCE_WorkFlowStage)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
if (rowsUpdated != 1)
{
// Error, either a concurrency error or a not-exists error
ResultSet r = executeQuery (sqlMgr,
"SELECT object_id, object_LAST_UPDATED_DATE FROM {PREFIX}tl_work_flow_step WHERE object_id = ?",
new Object[] { objectID.longID () });
if (r.next ())
{
Date d = new java.util.Date (r.getTimestamp (2).getTime());
String errorMsg = QueryBuilder.buildQueryString ("Concurrent update error:[?] for row:[?] objDate:[?] dbDate:[?]",
new Object[] { "tl_work_flow_step", objectID.longID (), obj.getObjectLastModified (), d },
sqlMgr.getPortabilityServices ());
LogMgr.log (WorkFlowStepPersistence, LogLevel.BUSINESS1, errorMsg);
throw new ConcurrentUpdateConflictException (obj, "tl_work_flow_step");
}
else
{
String errorMsg = "Attempt to update nonexistent row in table:tl_work_flow_step for row:" + objectID + " objDate:" + obj.getObjectLastModified ();
LogMgr.log (WorkFlowStepPersistence, LogLevel.BUSINESS1, errorMsg);
throw new RuntimeException (errorMsg);
}
}
tl_work_flow_stepPSet.setStatus (PersistentSetStatus.PROCESSED);
}
}
else
{
LogMgr.log (WorkFlowStepPersistence, LogLevel.DEBUG1, "Skipping update since no attribs or simple assocs changed on ", objectID);
}
}
public void delete(BaseBusinessClass obj, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, ConcurrentUpdateConflictException, StorageException
{
ObjectID objectID = obj.getID ();
PersistentSet tl_work_flow_stepPSet = allPSets.getPersistentSet(objectID, "tl_work_flow_step");
LogMgr.log (WorkFlowStepPersistence, LogLevel.DEBUG2, "Deleting:", objectID);
if (tl_work_flow_stepPSet.getStatus () != PersistentSetStatus.PROCESSED &&
tl_work_flow_stepPSet.getStatus () != PersistentSetStatus.DEFERRED)
{
int rowsDeleted = executeStatement (sqlMgr,
"DELETE " +
"FROM {PREFIX}tl_work_flow_step " +
"WHERE tl_work_flow_step.object_id = ? AND " + sqlMgr.getPortabilityServices ().getTruncatedTimestampColumn ("object_LAST_UPDATED_DATE") + " = " + sqlMgr.getPortabilityServices ().getTruncatedTimestampParam("?") + " ",
new Object[] { objectID.longID(), obj.getObjectLastModified () });
if (rowsDeleted != 1)
{
// Error, either a concurrency error or a not-exists error
ResultSet r = executeQuery (sqlMgr,
"SELECT object_id FROM {PREFIX}tl_work_flow_step WHERE object_id = ?",
new Object[] { objectID.longID() });
if (r.next ())
{
throw new ConcurrentUpdateConflictException (obj, "tl_work_flow_step");
}
else
{
String errorMsg = "Attempt to delete nonexistent row in table:tl_work_flow_step for row:" + objectID;
LogMgr.log (WorkFlowStepPersistence, LogLevel.SYSTEMERROR1, errorMsg);
throw new RuntimeException (errorMsg);
}
}
tl_work_flow_stepPSet.setStatus (PersistentSetStatus.PROCESSED);
}
}
public ResultSet executeSearchQueryAll (SQLManager sqlMgr) throws SQLException
{
throw new RuntimeException ("NOT implemented: executeSearchQueryAll");
}
public BaseBusinessClass[] loadQuery (PersistentSetCollection allPSets, SQLManager sqlMgr, RDBMSPersistenceContext context, String query, Object[] params, Integer maxRows, boolean truncateExtra) throws SQLException, StorageException
{
LinkedHashMap<ObjectID, WorkFlowStep> results = new LinkedHashMap ();
ResultSet r = executeQuery (sqlMgr, query, params);
while (r.next())
{
ThreadUtils.checkInterrupted ();
ObjectID objectID = new ObjectID (WorkFlowStep.REFERENCE_WorkFlowStep.getObjectIDSpace (), r.getLong ("id"));
WorkFlowStep resultElement;
if (maxRows != null && !results.containsKey (objectID) && results.size () >= maxRows)
{
if (truncateExtra)
{
break;
}
else
{
throw new SearchRowsExceededException ("Maximum rows exceeded:" + maxRows);
}
}
if (context.containsObject(objectID))
{
BaseBusinessClass cachedElement = context.getObjectToReplace(objectID, WorkFlowStep.REFERENCE_WorkFlowStep);
if (cachedElement instanceof WorkFlowStep)
{
LogMgr.log (WorkFlowStepPersistence, LogLevel.TRACE, "Cache hit for id:", objectID);
resultElement = (WorkFlowStep)cachedElement;
}
else
{
throw new StorageException ("Cache collision for id:" + objectID + " with object " + cachedElement + "while fetching a WorkFlowStep");
}
}
else
{
PersistentSet tl_work_flow_stepPSet = allPSets.getPersistentSet(objectID, "tl_work_flow_step", PersistentSetStatus.FETCHED);
createPersistentSetFromRS(allPSets, r, objectID);
resultElement = new WorkFlowStep ();
resultElement.setFromPersistentSets(objectID, allPSets);
context.addRetrievedObject(resultElement);
}
results.put (objectID, resultElement);
}
BaseBusinessClass[] resultsArr = new BaseBusinessClass[results.size ()];
return results.values ().toArray (resultsArr);
}
public BaseBusinessClass[] find(String searchType, PersistentSetCollection allPSets, Hashtable criteria, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
LogMgr.log (WorkFlowStepPersistence, LogLevel.DEBUG2, "Search executing:", searchType, " criteria:", criteria);
String customParamFilter = (String)criteria.get (SEARCH_CustomFilter);
String customOrderBy = (String)criteria.get (SEARCH_OrderBy);
String customTables = (String)criteria.get (SEARCH_CustomExtraTables);
Boolean noCommaBeforeCustomExtraTables = (Boolean)criteria.get (SEARCH_CustomExtraTablesNoComma);
if (searchType.equals (SEARCH_CustomSQL))
{
Set<ObjectID> processedIDs = new HashSet();
SearchParamTransform tx = new SearchParamTransform (criteria);
Object[] searchParams;
customParamFilter = StringUtils.replaceParams (customParamFilter, tx);
searchParams = tx.getParamsArray();
if (customOrderBy != null)
{
customOrderBy = " ORDER BY " + customOrderBy;
}
else
{
customOrderBy = "";
}
ResultSet r;
String concatCustomTableWith = CollectionUtils.equals(noCommaBeforeCustomExtraTables, true) ? " " : ", ";
String tables = StringUtils.subBlanks(customTables) == null ? " " : concatCustomTableWith + customTables + " ";
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}tl_work_flow_step " + tables +
"WHERE " + SELECT_JOINS + " " + customParamFilter + customOrderBy;
BaseBusinessClass[] results = loadQuery (allPSets, sqlMgr, context, query, searchParams, null, false);
return results;
}
else if (searchType.equals (WorkFlowStep.SEARCH_All))
{
// Local scope for transformed variables
{
}
String orderBy = " ORDER BY tl_work_flow_step.object_id";
String tables = " ";
Set<String> joinTableSet = new HashSet<String>();
String filter;
Object[] searchParams; // paramFilter: tl_work_flow_step.object_id is not null
String preFilter = "(tl_work_flow_step.object_id is not null)"
+ " ";
preFilter += context.getLoadingAttributes ().getCustomSQL() ;
SearchParamTransform tx = new SearchParamTransform (criteria);
filter = StringUtils.replaceParams (preFilter, tx);
searchParams = tx.getParamsArray();
Integer maxRows = context.getLoadingAttributes ().getMaxRows ();
boolean truncateExtra = !context.getLoadingAttributes ().isFailIfMaxExceeded();
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}tl_work_flow_step " + tables + tableSetToSQL(joinTableSet) +
"WHERE " + SELECT_JOINS + " " + filter + orderBy;
BaseBusinessClass[] results = loadQuery (allPSets, sqlMgr, context, query, searchParams, maxRows, truncateExtra);
return results;
}
else
{
throw new IllegalArgumentException ("Illegal search type:" + searchType);
}
}
private void createPersistentSetFromRS(PersistentSetCollection allPSets, ResultSet r, ObjectID objectID) throws SQLException
{
PersistentSet tl_work_flow_stepPSet = allPSets.getPersistentSet(objectID, "tl_work_flow_step", PersistentSetStatus.FETCHED);
// Object Modified
tl_work_flow_stepPSet.setAttrib(BaseBusinessClass.FIELD_ObjectLastModified, r.getTimestamp ("LAST_UPDATED_DATE"));
// Object Created
tl_work_flow_stepPSet.setAttrib(BaseBusinessClass.FIELD_ObjectCreated, r.getTimestamp ("CREATED_DATE"));
tl_work_flow_stepPSet.setAttrib(WorkFlowStep.FIELD_SortOrder, HELPER_SortOrder.getFromRS(dummySortOrder, r, "sort_order"));
tl_work_flow_stepPSet.setAttrib(WorkFlowStep.FIELD_StepType, HELPER_StepType.getFromRS(dummyStepType, r, "step_type"));
tl_work_flow_stepPSet.setAttrib(WorkFlowStep.SINGLEREFERENCE_WorkFlowStage, r.getObject ("work_flow_stage_id"));
}
public void create(BaseBusinessClass obj, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
{
ObjectID objectID = obj.getID ();
PersistentSet tl_work_flow_stepPSet = allPSets.getPersistentSet(objectID, "tl_work_flow_step");
if (tl_work_flow_stepPSet.getStatus () != PersistentSetStatus.PROCESSED &&
tl_work_flow_stepPSet.getStatus () != PersistentSetStatus.DEFERRED)
{
executeStatement (sqlMgr,
"INSERT INTO {PREFIX}tl_work_flow_step " +
" (sort_order, step_type, work_flow_stage_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
"VALUES " +
" (?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_SortOrder.getForSQL(dummySortOrder, tl_work_flow_stepPSet.getAttrib (WorkFlowStep.FIELD_SortOrder))).listEntry (HELPER_StepType.getForSQL(dummyStepType, tl_work_flow_stepPSet.getAttrib (WorkFlowStep.FIELD_StepType))) .listEntry (SQLManager.CheckNull((Long)(tl_work_flow_stepPSet.getAttrib (WorkFlowStep.SINGLEREFERENCE_WorkFlowStage)))) .listEntry (objectID.longID ()).toList().toArray());
tl_work_flow_stepPSet.setStatus (PersistentSetStatus.PROCESSED);
}
}
}
......@@ -22,7 +22,7 @@
<ATTRIB name="ThankYouHeaderText" type="String" dbcol="thank_you_header_text" mandatory="false" defaultValue='"Thank You for your application to&#58;"'/>
<ATTRIB name="ThankYouSecondaryText" type="String" dbcol="thank_you_secondary_text" mandatory="false" defaultValue='"We will get in touch with you soon"'/>
<ATTRIB name="JobOutlineButtonText" type="String" dbcol="job_outline_button_text" mandatory="false" defaultValue='"Continue"'/>
<ATTRIB name="IsGlobalTemplate" type="Boolean" dbcol="is_global_template" mandatory="false"/>
<ATTRIB name="RelatedToJob" type="Boolean" dbcol="related_to_job" mandatory="false" defaultValue="Boolean.FALSE"/>
<ATTRIB name="IsSystemGenerated" type="Boolean" dbcol="is_system_generated" mandatory="false" defaultValue="Boolean.FALSE"/>
<SINGLEREFERENCE name="WithdrawalMessage" type="WorkFlowMessage" dbcol="withdrawal_message_id" />
......
......@@ -39,7 +39,7 @@ public class WorkFlowTemplatePersistenceMgr extends ObjectPersistenceMgr
private String dummyThankYouHeaderText;
private String dummyThankYouSecondaryText;
private String dummyJobOutlineButtonText;
private Boolean dummyIsGlobalTemplate;
private Boolean dummyRelatedToJob;
private Boolean dummyIsSystemGenerated;
......@@ -56,7 +56,7 @@ public class WorkFlowTemplatePersistenceMgr extends ObjectPersistenceMgr
private static final DefaultAttributeHelper HELPER_ThankYouHeaderText = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_ThankYouSecondaryText = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_JobOutlineButtonText = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_IsGlobalTemplate = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_RelatedToJob = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_IsSystemGenerated = DefaultAttributeHelper.INSTANCE;
......@@ -76,12 +76,12 @@ public class WorkFlowTemplatePersistenceMgr extends ObjectPersistenceMgr
dummyThankYouHeaderText = (String)(HELPER_ThankYouHeaderText.initialise (dummyThankYouHeaderText));
dummyThankYouSecondaryText = (String)(HELPER_ThankYouSecondaryText.initialise (dummyThankYouSecondaryText));
dummyJobOutlineButtonText = (String)(HELPER_JobOutlineButtonText.initialise (dummyJobOutlineButtonText));
dummyIsGlobalTemplate = (Boolean)(HELPER_IsGlobalTemplate.initialise (dummyIsGlobalTemplate));
dummyRelatedToJob = (Boolean)(HELPER_RelatedToJob.initialise (dummyRelatedToJob));
dummyIsSystemGenerated = (Boolean)(HELPER_IsSystemGenerated.initialise (dummyIsSystemGenerated));
}
private String SELECT_COLUMNS = "{PREFIX}tl_work_flow_template.object_id as id, {PREFIX}tl_work_flow_template.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_work_flow_template.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_work_flow_template.template_name, {PREFIX}tl_work_flow_template.landing_button_text, {PREFIX}tl_work_flow_template.verification_header_text, {PREFIX}tl_work_flow_template.capture_cv, {PREFIX}tl_work_flow_template.is_cv_mandatory, {PREFIX}tl_work_flow_template.capture_cl, {PREFIX}tl_work_flow_template.is_cl_mandatory, {PREFIX}tl_work_flow_template.application_button_text, {PREFIX}tl_work_flow_template.application_response_action, {PREFIX}tl_work_flow_template.thank_you_header_text, {PREFIX}tl_work_flow_template.thank_you_secondary_text, {PREFIX}tl_work_flow_template.job_outline_button_text, {PREFIX}tl_work_flow_template.is_global_template, {PREFIX}tl_work_flow_template.is_system_generated, {PREFIX}tl_work_flow_template.withdrawal_message_id, {PREFIX}tl_work_flow_template.hiring_team_id, 1 AS commasafe ";
private String SELECT_COLUMNS = "{PREFIX}tl_work_flow_template.object_id as id, {PREFIX}tl_work_flow_template.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_work_flow_template.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_work_flow_template.template_name, {PREFIX}tl_work_flow_template.landing_button_text, {PREFIX}tl_work_flow_template.verification_header_text, {PREFIX}tl_work_flow_template.capture_cv, {PREFIX}tl_work_flow_template.is_cv_mandatory, {PREFIX}tl_work_flow_template.capture_cl, {PREFIX}tl_work_flow_template.is_cl_mandatory, {PREFIX}tl_work_flow_template.application_button_text, {PREFIX}tl_work_flow_template.application_response_action, {PREFIX}tl_work_flow_template.thank_you_header_text, {PREFIX}tl_work_flow_template.thank_you_secondary_text, {PREFIX}tl_work_flow_template.job_outline_button_text, {PREFIX}tl_work_flow_template.related_to_job, {PREFIX}tl_work_flow_template.is_system_generated, {PREFIX}tl_work_flow_template.withdrawal_message_id, {PREFIX}tl_work_flow_template.hiring_team_id, 1 AS commasafe ";
private String SELECT_JOINS = "";
public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
......@@ -144,7 +144,7 @@ public class WorkFlowTemplatePersistenceMgr extends ObjectPersistenceMgr
!tl_work_flow_templatePSet.containsAttrib(WorkFlowTemplate.FIELD_ThankYouHeaderText)||
!tl_work_flow_templatePSet.containsAttrib(WorkFlowTemplate.FIELD_ThankYouSecondaryText)||
!tl_work_flow_templatePSet.containsAttrib(WorkFlowTemplate.FIELD_JobOutlineButtonText)||
!tl_work_flow_templatePSet.containsAttrib(WorkFlowTemplate.FIELD_IsGlobalTemplate)||
!tl_work_flow_templatePSet.containsAttrib(WorkFlowTemplate.FIELD_RelatedToJob)||
!tl_work_flow_templatePSet.containsAttrib(WorkFlowTemplate.FIELD_IsSystemGenerated)||
!tl_work_flow_templatePSet.containsAttrib(WorkFlowTemplate.SINGLEREFERENCE_WithdrawalMessage)||
!tl_work_flow_templatePSet.containsAttrib(WorkFlowTemplate.SINGLEREFERENCE_HiringTeam))
......@@ -227,10 +227,10 @@ public class WorkFlowTemplatePersistenceMgr extends ObjectPersistenceMgr
{
int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}tl_work_flow_template " +
"SET template_name = ?, landing_button_text = ?, verification_header_text = ?, capture_cv = ?, is_cv_mandatory = ?, capture_cl = ?, is_cl_mandatory = ?, application_button_text = ?, application_response_action = ?, thank_you_header_text = ?, thank_you_secondary_text = ?, job_outline_button_text = ?, is_global_template = ?, is_system_generated = ?, withdrawal_message_id = ? , hiring_team_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"SET template_name = ?, landing_button_text = ?, verification_header_text = ?, capture_cv = ?, is_cv_mandatory = ?, capture_cl = ?, is_cl_mandatory = ?, application_button_text = ?, application_response_action = ?, thank_you_header_text = ?, thank_you_secondary_text = ?, job_outline_button_text = ?, related_to_job = ?, is_system_generated = ?, withdrawal_message_id = ? , hiring_team_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE tl_work_flow_template.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ",
CollectionUtils.listEntry (HELPER_TemplateName.getForSQL(dummyTemplateName, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_TemplateName))).listEntry (HELPER_LandingButtonText.getForSQL(dummyLandingButtonText, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_LandingButtonText))).listEntry (HELPER_VerificationHeaderText.getForSQL(dummyVerificationHeaderText, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_VerificationHeaderText))).listEntry (HELPER_CaptureCV.getForSQL(dummyCaptureCV, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_CaptureCV))).listEntry (HELPER_IsCVMandatory.getForSQL(dummyIsCVMandatory, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_IsCVMandatory))).listEntry (HELPER_CaptureCL.getForSQL(dummyCaptureCL, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_CaptureCL))).listEntry (HELPER_IsCLMandatory.getForSQL(dummyIsCLMandatory, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_IsCLMandatory))).listEntry (HELPER_ApplicationButtonText.getForSQL(dummyApplicationButtonText, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_ApplicationButtonText))).listEntry (HELPER_ApplicationResponseAction.getForSQL(dummyApplicationResponseAction, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_ApplicationResponseAction))).listEntry (HELPER_ThankYouHeaderText.getForSQL(dummyThankYouHeaderText, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_ThankYouHeaderText))).listEntry (HELPER_ThankYouSecondaryText.getForSQL(dummyThankYouSecondaryText, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_ThankYouSecondaryText))).listEntry (HELPER_JobOutlineButtonText.getForSQL(dummyJobOutlineButtonText, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_JobOutlineButtonText))).listEntry (HELPER_IsGlobalTemplate.getForSQL(dummyIsGlobalTemplate, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_IsGlobalTemplate))).listEntry (HELPER_IsSystemGenerated.getForSQL(dummyIsSystemGenerated, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_IsSystemGenerated))).listEntry (SQLManager.CheckNull((Long)(tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.SINGLEREFERENCE_WithdrawalMessage)))).listEntry (SQLManager.CheckNull((Long)(tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.SINGLEREFERENCE_HiringTeam)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
CollectionUtils.listEntry (HELPER_TemplateName.getForSQL(dummyTemplateName, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_TemplateName))).listEntry (HELPER_LandingButtonText.getForSQL(dummyLandingButtonText, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_LandingButtonText))).listEntry (HELPER_VerificationHeaderText.getForSQL(dummyVerificationHeaderText, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_VerificationHeaderText))).listEntry (HELPER_CaptureCV.getForSQL(dummyCaptureCV, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_CaptureCV))).listEntry (HELPER_IsCVMandatory.getForSQL(dummyIsCVMandatory, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_IsCVMandatory))).listEntry (HELPER_CaptureCL.getForSQL(dummyCaptureCL, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_CaptureCL))).listEntry (HELPER_IsCLMandatory.getForSQL(dummyIsCLMandatory, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_IsCLMandatory))).listEntry (HELPER_ApplicationButtonText.getForSQL(dummyApplicationButtonText, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_ApplicationButtonText))).listEntry (HELPER_ApplicationResponseAction.getForSQL(dummyApplicationResponseAction, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_ApplicationResponseAction))).listEntry (HELPER_ThankYouHeaderText.getForSQL(dummyThankYouHeaderText, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_ThankYouHeaderText))).listEntry (HELPER_ThankYouSecondaryText.getForSQL(dummyThankYouSecondaryText, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_ThankYouSecondaryText))).listEntry (HELPER_JobOutlineButtonText.getForSQL(dummyJobOutlineButtonText, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_JobOutlineButtonText))).listEntry (HELPER_RelatedToJob.getForSQL(dummyRelatedToJob, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_RelatedToJob))).listEntry (HELPER_IsSystemGenerated.getForSQL(dummyIsSystemGenerated, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_IsSystemGenerated))).listEntry (SQLManager.CheckNull((Long)(tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.SINGLEREFERENCE_WithdrawalMessage)))).listEntry (SQLManager.CheckNull((Long)(tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.SINGLEREFERENCE_HiringTeam)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
if (rowsUpdated != 1)
{
......@@ -498,7 +498,7 @@ public class WorkFlowTemplatePersistenceMgr extends ObjectPersistenceMgr
tl_work_flow_templatePSet.setAttrib(WorkFlowTemplate.FIELD_ThankYouHeaderText, HELPER_ThankYouHeaderText.getFromRS(dummyThankYouHeaderText, r, "thank_you_header_text"));
tl_work_flow_templatePSet.setAttrib(WorkFlowTemplate.FIELD_ThankYouSecondaryText, HELPER_ThankYouSecondaryText.getFromRS(dummyThankYouSecondaryText, r, "thank_you_secondary_text"));
tl_work_flow_templatePSet.setAttrib(WorkFlowTemplate.FIELD_JobOutlineButtonText, HELPER_JobOutlineButtonText.getFromRS(dummyJobOutlineButtonText, r, "job_outline_button_text"));
tl_work_flow_templatePSet.setAttrib(WorkFlowTemplate.FIELD_IsGlobalTemplate, HELPER_IsGlobalTemplate.getFromRS(dummyIsGlobalTemplate, r, "is_global_template"));
tl_work_flow_templatePSet.setAttrib(WorkFlowTemplate.FIELD_RelatedToJob, HELPER_RelatedToJob.getFromRS(dummyRelatedToJob, r, "related_to_job"));
tl_work_flow_templatePSet.setAttrib(WorkFlowTemplate.FIELD_IsSystemGenerated, HELPER_IsSystemGenerated.getFromRS(dummyIsSystemGenerated, r, "is_system_generated"));
tl_work_flow_templatePSet.setAttrib(WorkFlowTemplate.SINGLEREFERENCE_WithdrawalMessage, r.getObject ("withdrawal_message_id"));
......@@ -519,10 +519,10 @@ public class WorkFlowTemplatePersistenceMgr extends ObjectPersistenceMgr
{
executeStatement (sqlMgr,
"INSERT INTO {PREFIX}tl_work_flow_template " +
" (template_name, landing_button_text, verification_header_text, capture_cv, is_cv_mandatory, capture_cl, is_cl_mandatory, application_button_text, application_response_action, thank_you_header_text, thank_you_secondary_text, job_outline_button_text, is_global_template, is_system_generated, withdrawal_message_id, hiring_team_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
" (template_name, landing_button_text, verification_header_text, capture_cv, is_cv_mandatory, capture_cl, is_cl_mandatory, application_button_text, application_response_action, thank_you_header_text, thank_you_secondary_text, job_outline_button_text, related_to_job, is_system_generated, withdrawal_message_id, hiring_team_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
"VALUES " +
" (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_TemplateName.getForSQL(dummyTemplateName, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_TemplateName))).listEntry (HELPER_LandingButtonText.getForSQL(dummyLandingButtonText, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_LandingButtonText))).listEntry (HELPER_VerificationHeaderText.getForSQL(dummyVerificationHeaderText, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_VerificationHeaderText))).listEntry (HELPER_CaptureCV.getForSQL(dummyCaptureCV, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_CaptureCV))).listEntry (HELPER_IsCVMandatory.getForSQL(dummyIsCVMandatory, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_IsCVMandatory))).listEntry (HELPER_CaptureCL.getForSQL(dummyCaptureCL, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_CaptureCL))).listEntry (HELPER_IsCLMandatory.getForSQL(dummyIsCLMandatory, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_IsCLMandatory))).listEntry (HELPER_ApplicationButtonText.getForSQL(dummyApplicationButtonText, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_ApplicationButtonText))).listEntry (HELPER_ApplicationResponseAction.getForSQL(dummyApplicationResponseAction, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_ApplicationResponseAction))).listEntry (HELPER_ThankYouHeaderText.getForSQL(dummyThankYouHeaderText, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_ThankYouHeaderText))).listEntry (HELPER_ThankYouSecondaryText.getForSQL(dummyThankYouSecondaryText, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_ThankYouSecondaryText))).listEntry (HELPER_JobOutlineButtonText.getForSQL(dummyJobOutlineButtonText, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_JobOutlineButtonText))).listEntry (HELPER_IsGlobalTemplate.getForSQL(dummyIsGlobalTemplate, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_IsGlobalTemplate))).listEntry (HELPER_IsSystemGenerated.getForSQL(dummyIsSystemGenerated, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_IsSystemGenerated))) .listEntry (SQLManager.CheckNull((Long)(tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.SINGLEREFERENCE_WithdrawalMessage)))).listEntry (SQLManager.CheckNull((Long)(tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.SINGLEREFERENCE_HiringTeam)))) .listEntry (objectID.longID ()).toList().toArray());
CollectionUtils.listEntry (HELPER_TemplateName.getForSQL(dummyTemplateName, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_TemplateName))).listEntry (HELPER_LandingButtonText.getForSQL(dummyLandingButtonText, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_LandingButtonText))).listEntry (HELPER_VerificationHeaderText.getForSQL(dummyVerificationHeaderText, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_VerificationHeaderText))).listEntry (HELPER_CaptureCV.getForSQL(dummyCaptureCV, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_CaptureCV))).listEntry (HELPER_IsCVMandatory.getForSQL(dummyIsCVMandatory, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_IsCVMandatory))).listEntry (HELPER_CaptureCL.getForSQL(dummyCaptureCL, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_CaptureCL))).listEntry (HELPER_IsCLMandatory.getForSQL(dummyIsCLMandatory, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_IsCLMandatory))).listEntry (HELPER_ApplicationButtonText.getForSQL(dummyApplicationButtonText, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_ApplicationButtonText))).listEntry (HELPER_ApplicationResponseAction.getForSQL(dummyApplicationResponseAction, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_ApplicationResponseAction))).listEntry (HELPER_ThankYouHeaderText.getForSQL(dummyThankYouHeaderText, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_ThankYouHeaderText))).listEntry (HELPER_ThankYouSecondaryText.getForSQL(dummyThankYouSecondaryText, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_ThankYouSecondaryText))).listEntry (HELPER_JobOutlineButtonText.getForSQL(dummyJobOutlineButtonText, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_JobOutlineButtonText))).listEntry (HELPER_RelatedToJob.getForSQL(dummyRelatedToJob, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_RelatedToJob))).listEntry (HELPER_IsSystemGenerated.getForSQL(dummyIsSystemGenerated, tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.FIELD_IsSystemGenerated))) .listEntry (SQLManager.CheckNull((Long)(tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.SINGLEREFERENCE_WithdrawalMessage)))).listEntry (SQLManager.CheckNull((Long)(tl_work_flow_templatePSet.getAttrib (WorkFlowTemplate.SINGLEREFERENCE_HiringTeam)))) .listEntry (objectID.longID ()).toList().toArray());
tl_work_flow_templatePSet.setStatus (PersistentSetStatus.PROCESSED);
}
......
package performa.orm.types;
import java.util.*;
import oneit.utils.*;
import oneit.utils.transform.*;
/**
* This class was generated using constGen.bat.
* DO NOT MODIFY THIS CODE.
* Edit the associated .xml file, and regenerate this file
* constGen (directory) (file minus extension)
* e.g. constGen C:\...\sql FieldType
*/
public class ApplicantSource extends AbstractEnumerated
{
public static final EnumeratedFactory FACTORY_ApplicantSource = new ApplicantSourceFactory();
public static final ApplicantSource INGEST = new ApplicantSource ("INGEST", "INGEST", "Ingest", false);
public static final ApplicantSource ATS = new ApplicantSource ("ATS", "ATS", "ATS", false);
public static final ApplicantSource APPLY_URL = new ApplicantSource ("APPLY_URL", "APPLY_URL", "Apply URL", false);
private static final ApplicantSource[] allApplicantSources =
new ApplicantSource[] { INGEST,ATS,APPLY_URL};
private static ApplicantSource[] getAllApplicantSources ()
{
return allApplicantSources;
}
private ApplicantSource (String name, String value, String description, boolean disabled)
{
super (name, value, description, disabled);
}
public static final Comparator COMPARE_BY_POSITION = new CompareEnumByPosition (allApplicantSources);
static
{
defineAdditionalData ();
}
public boolean isEqual (ApplicantSource other)
{
return this.name.equals (other.name);
}
public Enumeration getAllInstances ()
{
return ApplicantSource.getAll ();
}
private Object readResolve() throws java.io.ObjectStreamException
{
return ApplicantSource.forName (this.name);
}
public EnumeratedFactory getFactory ()
{
return FACTORY_ApplicantSource;
}
public static ApplicantSource forName (String name)
{
if (name == null) { return null; }
ApplicantSource[] all = getAllApplicantSources();
int enumIndex = AbstractEnumerated.getIndexForName (all, name);
return all[enumIndex];
}
public static ApplicantSource forValue (String value)
{
if (value == null) { return null; }
ApplicantSource[] all = getAllApplicantSources();
int enumIndex = AbstractEnumerated.getIndexForValue (getAllApplicantSources (), value);
return all[enumIndex];
}
public static java.util.Enumeration getAll ()
{
return AbstractEnumerated.getAll (getAllApplicantSources());
}
public static ApplicantSource[] getApplicantSourceArray ()
{
return (ApplicantSource[])getAllApplicantSources().clone ();
}
public static void defineAdditionalData ()
{
}
static class ApplicantSourceFactory implements EnumeratedFactory
{
public AbstractEnumerated getForName (String name)
{
return ApplicantSource.forName (name);
}
public AbstractEnumerated getForValue (String name)
{
return ApplicantSource.forValue (name);
}
public Enumeration getAll ()
{
return ApplicantSource.getAll ();
}
}
public Map getAdditionalAttributes ()
{
Map attribs = new HashMap ();
return attribs;
}
public static class ApplicantSourcePipeLineFactory<From, Me extends ApplicantSource> extends AbstractEnumerated.EnumPipeLine<From, Me>
{
public <Prev> ApplicantSourcePipeLineFactory (PipeLine<From, Prev> pipeLine, Pipe<Prev, Me> nextPipe)
{
super (pipeLine, nextPipe);
}
public ApplicantSourcePipeLineFactory (From seed)
{
super(seed);
}
public ApplicantSourcePipeLineFactory (Collection<From> seed)
{
super(seed);
}
public PipeLine<From, ? extends Object> to(String name)
{
return super.to(name);
}
}
}
<?xml version="1.0" encoding="UTF-8"?>
<ROOT>
<CONSTANT package="performa.orm.types" name="ApplicantSource">
<VALUE name="INGEST" description="Ingest" />
<VALUE name="ATS" description="ATS" />
<VALUE name="APPLY_URL" description="Apply URL" />
</CONSTANT>
</ROOT>
\ No newline at end of file
......@@ -58,6 +58,8 @@ public class PlaceholderOptions extends AbstractEnumerated
private transient Boolean ShowForContent;
private transient Boolean IsLink;
private PlaceholderOptions (String name, String value, String description, boolean disabled)
{
super (name, value, description, disabled);
......@@ -78,6 +80,11 @@ public class PlaceholderOptions extends AbstractEnumerated
return ShowForContent;
}
public Boolean getIsLink()
{
return IsLink;
}
public static final Comparator COMPARE_BY_POSITION = new CompareEnumByPosition (allPlaceholderOptionss);
......@@ -148,36 +155,47 @@ public class PlaceholderOptions extends AbstractEnumerated
FIRST_NAME.Placeholder = "$firstName";
FIRST_NAME.ShowForSubject = Boolean.TRUE;
FIRST_NAME.ShowForContent = Boolean.TRUE;
FIRST_NAME.IsLink = Boolean.FALSE;
SURNAME.Placeholder = "$surname";
SURNAME.ShowForSubject = Boolean.TRUE;
SURNAME.ShowForContent = Boolean.TRUE;
SURNAME.IsLink = Boolean.FALSE;
EMAIL_ADDRESS.Placeholder = "$emailAddress";
EMAIL_ADDRESS.ShowForSubject = Boolean.TRUE;
EMAIL_ADDRESS.ShowForContent = Boolean.TRUE;
EMAIL_ADDRESS.IsLink = Boolean.FALSE;
LOCATION.Placeholder = "$location";
LOCATION.ShowForSubject = Boolean.TRUE;
LOCATION.ShowForContent = Boolean.TRUE;
LOCATION.IsLink = Boolean.FALSE;
HIRING_TEAM.Placeholder = "$hiringTeam";
HIRING_TEAM.ShowForSubject = Boolean.TRUE;
HIRING_TEAM.ShowForContent = Boolean.TRUE;
HIRING_TEAM.IsLink = Boolean.FALSE;
JOB_TITLE.Placeholder = "$jobTitle";
JOB_TITLE.ShowForSubject = Boolean.TRUE;
JOB_TITLE.ShowForContent = Boolean.TRUE;
JOB_TITLE.IsLink = Boolean.FALSE;
JOB_REFERENCE.Placeholder = "$jobReference";
JOB_REFERENCE.ShowForSubject = Boolean.TRUE;
JOB_REFERENCE.ShowForContent = Boolean.TRUE;
JOB_REFERENCE.IsLink = Boolean.FALSE;
JOB_LINK.Placeholder = "$jobLink";
JOB_LINK.ShowForSubject = Boolean.FALSE;
JOB_LINK.ShowForContent = Boolean.TRUE;
JOB_LINK.IsLink = Boolean.TRUE;
WITHDRAW_LINK.Placeholder = "$withdrawLink";
WITHDRAW_LINK.ShowForSubject = Boolean.FALSE;
WITHDRAW_LINK.ShowForContent = Boolean.TRUE;
WITHDRAW_LINK.IsLink = Boolean.TRUE;
JOB_OWNER_FIRST_NAME.Placeholder = "$jobOwnerFirstName";
JOB_OWNER_FIRST_NAME.ShowForSubject = Boolean.TRUE;
JOB_OWNER_FIRST_NAME.ShowForContent = Boolean.TRUE;
JOB_OWNER_FIRST_NAME.IsLink = Boolean.FALSE;
JOB_OWNER_LAST_NAME.Placeholder = "$jobOwnerLastName";
JOB_OWNER_LAST_NAME.ShowForSubject = Boolean.TRUE;
JOB_OWNER_LAST_NAME.ShowForContent = Boolean.TRUE;
JOB_OWNER_LAST_NAME.IsLink = Boolean.FALSE;
}
......@@ -208,6 +226,7 @@ public class PlaceholderOptions extends AbstractEnumerated
attribs.put ("Placeholder", ArrayFormatter.toObject(getPlaceholder()));
attribs.put ("ShowForSubject", ArrayFormatter.toObject(getShowForSubject()));
attribs.put ("ShowForContent", ArrayFormatter.toObject(getShowForContent()));
attribs.put ("IsLink", ArrayFormatter.toObject(getIsLink()));
return attribs;
}
......@@ -243,6 +262,10 @@ public class PlaceholderOptions extends AbstractEnumerated
{
return toShowForContent ();
}
if (name.equals ("IsLink"))
{
return toIsLink ();
}
return super.to(name);
}
......@@ -253,6 +276,8 @@ public class PlaceholderOptions extends AbstractEnumerated
public PipeLine<From, Boolean> toShowForSubject () { return pipe(new EnumAttributePipe<Me, Boolean>("ShowForSubject")); }
public PipeLine<From, Boolean> toShowForContent () { return pipe(new EnumAttributePipe<Me, Boolean>("ShowForContent")); }
public PipeLine<From, Boolean> toIsLink () { return pipe(new EnumAttributePipe<Me, Boolean>("IsLink")); }
}
}
......@@ -6,29 +6,30 @@
<DATA name="Placeholder" type="String"/>
<DATA name="ShowForSubject" type="Boolean"/>
<DATA name="ShowForContent" type="Boolean"/>
<DATA name="IsLink" type="Boolean"/>
<VALUE name="FIRST_NAME" value="FIRST_NAME" description="First Name" Placeholder='"$firstName"'
ShowForSubject="Boolean.TRUE" ShowForContent="Boolean.TRUE"/>
ShowForSubject="Boolean.TRUE" ShowForContent="Boolean.TRUE" IsLink="Boolean.FALSE"/>
<VALUE name="SURNAME" value="SURNAME" description="Surname" Placeholder='"$surname"'
ShowForSubject="Boolean.TRUE" ShowForContent="Boolean.TRUE"/>
ShowForSubject="Boolean.TRUE" ShowForContent="Boolean.TRUE" IsLink="Boolean.FALSE"/>
<VALUE name="EMAIL_ADDRESS" value="EMAIL_ADDRESS" description="Email Address" Placeholder='"$emailAddress"'
ShowForSubject="Boolean.TRUE" ShowForContent="Boolean.TRUE"/>
ShowForSubject="Boolean.TRUE" ShowForContent="Boolean.TRUE" IsLink="Boolean.FALSE"/>
<VALUE name="LOCATION" value="LOCATION" description="Location" Placeholder='"$location"'
ShowForSubject="Boolean.TRUE" ShowForContent="Boolean.TRUE"/>
ShowForSubject="Boolean.TRUE" ShowForContent="Boolean.TRUE" IsLink="Boolean.FALSE"/>
<VALUE name="HIRING_TEAM" value="HIRING_TEAM" description="Hiring Team" Placeholder='"$hiringTeam"'
ShowForSubject="Boolean.TRUE" ShowForContent="Boolean.TRUE"/>
ShowForSubject="Boolean.TRUE" ShowForContent="Boolean.TRUE" IsLink="Boolean.FALSE"/>
<VALUE name="JOB_TITLE" value="JOB_TITLE" description="Job Title" Placeholder='"$jobTitle"'
ShowForSubject="Boolean.TRUE" ShowForContent="Boolean.TRUE"/>
ShowForSubject="Boolean.TRUE" ShowForContent="Boolean.TRUE" IsLink="Boolean.FALSE"/>
<VALUE name="JOB_REFERENCE" value="JOB_REFERENCE" description="Job Reference" Placeholder='"$jobReference"'
ShowForSubject="Boolean.TRUE" ShowForContent="Boolean.TRUE"/>
ShowForSubject="Boolean.TRUE" ShowForContent="Boolean.TRUE" IsLink="Boolean.FALSE"/>
<VALUE name="JOB_LINK" value="JOB_LINK" description="Job Link" Placeholder='"$jobLink"'
ShowForSubject="Boolean.FALSE" ShowForContent="Boolean.TRUE"/>
ShowForSubject="Boolean.FALSE" ShowForContent="Boolean.TRUE" IsLink="Boolean.TRUE"/>
<VALUE name="WITHDRAW_LINK" value="WITHDRAW_LINK" description="Withdraw Link" Placeholder='"$withdrawLink"'
ShowForSubject="Boolean.FALSE" ShowForContent="Boolean.TRUE"/>
ShowForSubject="Boolean.FALSE" ShowForContent="Boolean.TRUE" IsLink="Boolean.TRUE"/>
<VALUE name="JOB_OWNER_FIRST_NAME" value="JOB_OWNER_FIRST_NAME" description="Job Owner - First Name" Placeholder='"$jobOwnerFirstName"'
ShowForSubject="Boolean.TRUE" ShowForContent="Boolean.TRUE"/>
ShowForSubject="Boolean.TRUE" ShowForContent="Boolean.TRUE" IsLink="Boolean.FALSE"/>
<VALUE name="JOB_OWNER_LAST_NAME" value="JOB_OWNER_LAST_NAME" description="Job Owner - Last Name" Placeholder='"$jobOwnerLastName"'
ShowForSubject="Boolean.TRUE" ShowForContent="Boolean.TRUE"/>
ShowForSubject="Boolean.TRUE" ShowForContent="Boolean.TRUE" IsLink="Boolean.FALSE"/>
</CONSTANT>
</ROOT>
\ No newline at end of file
......@@ -21,25 +21,9 @@ public class StageType extends AbstractEnumerated
public static final EnumeratedFactory FACTORY_StageType = new StageTypeFactory();
public static final StageType POST_INGEST = new StageType ("POST_INGEST", "POST_INGEST", "Post Ingest", false);
public static final StageType INITIAL = new StageType ("INITIAL", "INITIAL", "Initial", false);
public static final StageType INCOMPLETE = new StageType ("INCOMPLETE", "INCOMPLETE", "Incomplete", false);
public static final StageType REFERENCE_CHECK = new StageType ("REFERENCE_CHECK", "REFERENCE_CHECK", "Reference Check", false);
public static final StageType SCREENING_CHECK = new StageType ("SCREENING_CHECK", "SCREENING_CHECK", "Screening Check", false);
public static final StageType VIDEO_INTERVIEW = new StageType ("VIDEO_INTERVIEW", "VIDEO_INTERVIEW", "Video Interview", false);
public static final StageType INTERVIEW = new StageType ("INTERVIEW", "INTERVIEW", "Interview", false);
public static final StageType REQUIREMENT_FIT = new StageType ("REQUIREMENT_FIT", "REQUIREMENT_FIT", "Requirement Fit", false);
public static final StageType CULTURE_FIT = new StageType ("CULTURE_FIT", "CULTURE_FIT", "Culture Fit", false);
public static final StageType ROLE_FIT = new StageType ("ROLE_FIT", "ROLE_FIT", "Role Fit", false);
public static final StageType DIVERSITY = new StageType ("DIVERSITY", "DIVERSITY", "Diversity", false);
public static final StageType GENERIC = new StageType ("GENERIC", "GENERIC", "Generic", false);
public static final StageType SUCCESSFUL = new StageType ("SUCCESSFUL", "SUCCESSFUL", "Successful", false);
......@@ -48,7 +32,7 @@ public class StageType extends AbstractEnumerated
public static final StageType WITHDREW = new StageType ("WITHDREW", "WITHDREW", "Withdrew", false);
private static final StageType[] allStageTypes =
new StageType[] { POST_INGEST,INCOMPLETE,REFERENCE_CHECK,SCREENING_CHECK,VIDEO_INTERVIEW,INTERVIEW,REQUIREMENT_FIT,CULTURE_FIT,ROLE_FIT,DIVERSITY,SUCCESSFUL,UNSUITABLE,WITHDREW};
new StageType[] { INITIAL,GENERIC,SUCCESSFUL,UNSUITABLE,WITHDREW};
private static StageType[] getAllStageTypes ()
......@@ -142,26 +126,10 @@ public class StageType extends AbstractEnumerated
public static void defineAdditionalData ()
{
POST_INGEST.IsPreStage = Boolean.TRUE;
POST_INGEST.IsPostStage = Boolean.FALSE;
INCOMPLETE.IsPreStage = Boolean.TRUE;
INCOMPLETE.IsPostStage = Boolean.FALSE;
REFERENCE_CHECK.IsPreStage = Boolean.FALSE;
REFERENCE_CHECK.IsPostStage = Boolean.FALSE;
SCREENING_CHECK.IsPreStage = Boolean.FALSE;
SCREENING_CHECK.IsPostStage = Boolean.FALSE;
VIDEO_INTERVIEW.IsPreStage = Boolean.FALSE;
VIDEO_INTERVIEW.IsPostStage = Boolean.FALSE;
INTERVIEW.IsPreStage = Boolean.FALSE;
INTERVIEW.IsPostStage = Boolean.FALSE;
REQUIREMENT_FIT.IsPreStage = Boolean.FALSE;
REQUIREMENT_FIT.IsPostStage = Boolean.FALSE;
CULTURE_FIT.IsPreStage = Boolean.FALSE;
CULTURE_FIT.IsPostStage = Boolean.FALSE;
ROLE_FIT.IsPreStage = Boolean.FALSE;
ROLE_FIT.IsPostStage = Boolean.FALSE;
DIVERSITY.IsPreStage = Boolean.FALSE;
DIVERSITY.IsPostStage = Boolean.FALSE;
INITIAL.IsPreStage = Boolean.TRUE;
INITIAL.IsPostStage = Boolean.FALSE;
GENERIC.IsPreStage = Boolean.FALSE;
GENERIC.IsPostStage = Boolean.FALSE;
SUCCESSFUL.IsPreStage = Boolean.FALSE;
SUCCESSFUL.IsPostStage = Boolean.TRUE;
UNSUITABLE.IsPreStage = Boolean.FALSE;
......
......@@ -6,16 +6,8 @@
<DATA name="IsPreStage" type="Boolean"/>
<DATA name="IsPostStage" type="Boolean"/>
<VALUE name="POST_INGEST" description="Post Ingest" IsPreStage="Boolean.TRUE" IsPostStage="Boolean.FALSE"/>
<VALUE name="INCOMPLETE" description="Incomplete" IsPreStage="Boolean.TRUE" IsPostStage="Boolean.FALSE"/>
<VALUE name="REFERENCE_CHECK" description="Reference Check" IsPreStage="Boolean.FALSE" IsPostStage="Boolean.FALSE"/>
<VALUE name="SCREENING_CHECK" description="Screening Check" IsPreStage="Boolean.FALSE" IsPostStage="Boolean.FALSE"/>
<VALUE name="VIDEO_INTERVIEW" description="Video Interview" IsPreStage="Boolean.FALSE" IsPostStage="Boolean.FALSE"/>
<VALUE name="INTERVIEW" description="Interview" IsPreStage="Boolean.FALSE" IsPostStage="Boolean.FALSE"/>
<VALUE name="REQUIREMENT_FIT" description="Requirement Fit" IsPreStage="Boolean.FALSE" IsPostStage="Boolean.FALSE"/>
<VALUE name="CULTURE_FIT" description="Culture Fit" IsPreStage="Boolean.FALSE" IsPostStage="Boolean.FALSE"/>
<VALUE name="ROLE_FIT" description="Role Fit" IsPreStage="Boolean.FALSE" IsPostStage="Boolean.FALSE"/>
<VALUE name="DIVERSITY" description="Diversity" IsPreStage="Boolean.FALSE" IsPostStage="Boolean.FALSE"/>
<VALUE name="INITIAL" description="Initial" IsPreStage="Boolean.TRUE" IsPostStage="Boolean.FALSE"/>
<VALUE name="GENERIC" description="Generic" IsPreStage="Boolean.FALSE" IsPostStage="Boolean.FALSE"/>
<VALUE name="SUCCESSFUL" description="Successful" IsPreStage="Boolean.FALSE" IsPostStage="Boolean.TRUE"/>
<VALUE name="UNSUITABLE" description="Unsuitable" IsPreStage="Boolean.FALSE" IsPostStage="Boolean.TRUE"/>
<VALUE name="WITHDREW" description="Withdrew" IsPreStage="Boolean.FALSE" IsPostStage="Boolean.TRUE"/>
......
package performa.orm.types;
import java.util.*;
import oneit.utils.*;
import oneit.utils.transform.*;
/**
* This class was generated using constGen.bat.
* DO NOT MODIFY THIS CODE.
* Edit the associated .xml file, and regenerate this file
* constGen (directory) (file minus extension)
* e.g. constGen C:\...\sql FieldType
*/
public class StepType extends AbstractEnumerated
{
public static final EnumeratedFactory FACTORY_StepType = new StepTypeFactory();
public static final StepType REQUIREMENT_FIT = new StepType ("REQUIREMENT_FIT", "REQUIREMENT_FIT", "Requirement Fit", false);
public static final StepType CULTURE_FIT = new StepType ("CULTURE_FIT", "CULTURE_FIT", "Culture Fit", false);
public static final StepType ROLE_FIT = new StepType ("ROLE_FIT", "ROLE_FIT", "Role Fit", false);
public static final StepType DIVERSITY = new StepType ("DIVERSITY", "DIVERSITY", "Diversity", false);
private static final StepType[] allStepTypes =
new StepType[] { REQUIREMENT_FIT,CULTURE_FIT,ROLE_FIT,DIVERSITY};
private static StepType[] getAllStepTypes ()
{
return allStepTypes;
}
private StepType (String name, String value, String description, boolean disabled)
{
super (name, value, description, disabled);
}
public static final Comparator COMPARE_BY_POSITION = new CompareEnumByPosition (allStepTypes);
static
{
defineAdditionalData ();
}
public boolean isEqual (StepType other)
{
return this.name.equals (other.name);
}
public Enumeration getAllInstances ()
{
return StepType.getAll ();
}
private Object readResolve() throws java.io.ObjectStreamException
{
return StepType.forName (this.name);
}
public EnumeratedFactory getFactory ()
{
return FACTORY_StepType;
}
public static StepType forName (String name)
{
if (name == null) { return null; }
StepType[] all = getAllStepTypes();
int enumIndex = AbstractEnumerated.getIndexForName (all, name);
return all[enumIndex];
}
public static StepType forValue (String value)
{
if (value == null) { return null; }
StepType[] all = getAllStepTypes();
int enumIndex = AbstractEnumerated.getIndexForValue (getAllStepTypes (), value);
return all[enumIndex];
}
public static java.util.Enumeration getAll ()
{
return AbstractEnumerated.getAll (getAllStepTypes());
}
public static StepType[] getStepTypeArray ()
{
return (StepType[])getAllStepTypes().clone ();
}
public static void defineAdditionalData ()
{
}
static class StepTypeFactory implements EnumeratedFactory
{
public AbstractEnumerated getForName (String name)
{
return StepType.forName (name);
}
public AbstractEnumerated getForValue (String name)
{
return StepType.forValue (name);
}
public Enumeration getAll ()
{
return StepType.getAll ();
}
}
public Map getAdditionalAttributes ()
{
Map attribs = new HashMap ();
return attribs;
}
public static class StepTypePipeLineFactory<From, Me extends StepType> extends AbstractEnumerated.EnumPipeLine<From, Me>
{
public <Prev> StepTypePipeLineFactory (PipeLine<From, Prev> pipeLine, Pipe<Prev, Me> nextPipe)
{
super (pipeLine, nextPipe);
}
public StepTypePipeLineFactory (From seed)
{
super(seed);
}
public StepTypePipeLineFactory (Collection<From> seed)
{
super(seed);
}
public PipeLine<From, ? extends Object> to(String name)
{
return super.to(name);
}
}
}
<?xml version="1.0" encoding="UTF-8"?>
<ROOT>
<CONSTANT package="performa.orm.types" name="StepType">
<VALUE name="REQUIREMENT_FIT" description="Requirement Fit" />
<VALUE name="CULTURE_FIT" description="Culture Fit" />
<VALUE name="ROLE_FIT" description="Role Fit" />
<VALUE name="DIVERSITY" description="Diversity" />
</CONSTANT>
</ROOT>
\ No newline at end of file
......@@ -2,6 +2,7 @@ package performa.search;
import oneit.objstore.*;
import oneit.objstore.rdbms.filters.*;
import oneit.security.SecUser;
import performa.orm.*;
public class SearchMessageTemplate extends BaseSearchMessageTemplate
......@@ -18,12 +19,14 @@ public class SearchMessageTemplate extends BaseSearchMessageTemplate
public BaseBusinessClass[] doSearch()
{
BaseMessageTemplate.SearchAll searchByAll = MessageTemplate.SearchByAll();
SecUser secUser = SecUser.getTXUser(getTransaction());
CompanyUser companyUser = secUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
if (isTrue(getOnlyGlobalTemplate()))
{
return searchByAll.andIsGlobalTemplate(new EqualsFilter<>(Boolean.TRUE)).search(getTransaction());
return searchByAll.andHiringTeam(new IsNullFilter<>()).andRelatedToJob(new EqualsFilter<>(Boolean.FALSE)).search(getTransaction());
}
return searchByAll.andIsGlobalTemplate(new IsNotNullFilter<>()).search(getTransaction());
return searchByAll.andHiringTeam(new EqualsFilter<>(companyUser.getSelectedTeam())).andRelatedToJob(new EqualsFilter<>(Boolean.FALSE)).search(getTransaction());
}
}
\ No newline at end of file
......@@ -25,11 +25,11 @@ public class SearchWorkFlowTemplate extends BaseSearchWorkFlowTemplate
if (isTrue(getOnlyGlobalTemplates()))
{
return searchByAll.andIsGlobalTemplate(new EqualsFilter<>(Boolean.TRUE)).search(getTransaction());
return searchByAll.andHiringTeam(new IsNullFilter<>()).andRelatedToJob(new EqualsFilter<>(Boolean.FALSE)).search(getTransaction());
}
return searchByAll.andIsGlobalTemplate(new IsNotNullFilter<>())
.andHiringTeam(new EqualsFilter<>(companyUser.getSelectedTeam()))
return searchByAll.andHiringTeam(new EqualsFilter<>(companyUser.getSelectedTeam()))
.andRelatedToJob(new EqualsFilter<>(Boolean.FALSE))
.search(getTransaction());
}
}
\ No newline at end of file
......@@ -19,6 +19,7 @@ import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import performa.orm.*;
import performa.orm.types.ApplicantSource;
import performa.orm.types.StageType;
......@@ -407,7 +408,8 @@ public class PerformaEmailFetcher implements Runnable, InitialisationParticipant
JobApplication jobApplication = JobApplication.createNewApplication(candidate, job);
jobApplication.setWorkFlowStage(job.getWorkFlowByStageType(StageType.POST_INGEST));
jobApplication.setWorkFlowStage(job.getWorkFlowByStageType(StageType.INITIAL));
jobApplication.setApplicantSource(ApplicantSource.INGEST);
jobApplication.setIsEmailIngest(true);
if(contents.size() > 0)
......@@ -481,7 +483,8 @@ public class PerformaEmailFetcher implements Runnable, InitialisationParticipant
JobApplication jobApplication = JobApplication.createNewApplication(candidate, job);
jobApplication.setWorkFlowStage(job.getWorkFlowByStageType(StageType.POST_INGEST));
jobApplication.setWorkFlowStage(job.getWorkFlowByStageType(StageType.INITIAL));
jobApplication.setApplicantSource(ApplicantSource.INGEST);
jobApplication.setIsEmailIngest(true);
if(contents.size() > 0 )
......
......@@ -793,11 +793,10 @@ public class Utils
SecUser secUser = SecUser.getTXUser(objTran);
CompanyUser companyUser = secUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
WorkFlowTemplate[] hiringTeamTemplates = WorkFlowTemplate.SearchByAll().andIsGlobalTemplate(new IsNotNullFilter<>())
.andHiringTeam(new EqualsFilter<>(companyUser.getSelectedTeam()))
WorkFlowTemplate[] hiringTeamTemplates = WorkFlowTemplate.SearchByAll().andHiringTeam(new EqualsFilter<>(companyUser.getSelectedTeam()))
.search(objTran);
WorkFlowTemplate[] globalTemplates = WorkFlowTemplate.SearchByAll().andIsGlobalTemplate(new EqualsFilter<>(Boolean.TRUE))
WorkFlowTemplate[] globalTemplates = WorkFlowTemplate.SearchByAll().andHiringTeam(new IsNullFilter<>())
.search(objTran);
return CollectionUtils.addTo(globalTemplates, hiringTeamTemplates);
......
package performa.utils;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
import oneit.objstore.ObjectTransaction;
import oneit.objstore.StorageException;
import oneit.objstore.rdbms.filters.EqualsFilter;
......@@ -9,7 +9,6 @@ import oneit.objstore.rdbms.filters.IsNullFilter;
import oneit.objstore.services.TransactionServices;
import oneit.objstore.services.TransactionTask;
import oneit.utils.NestedException;
import oneit.utils.filter.CollectionFilter;
import oneit.utils.parsers.FieldException;
import performa.orm.ILOJobTitle;
import performa.orm.Job;
......@@ -18,9 +17,12 @@ import performa.orm.MessageTemplate;
import performa.orm.WorkFlow;
import performa.orm.WorkFlowMessage;
import performa.orm.WorkFlowStage;
import performa.orm.WorkFlowStep;
import performa.orm.WorkFlowTemplate;
import performa.orm.types.ApplicantSource;
import performa.orm.types.ApplicationStatus;
import performa.orm.types.StageType;
import performa.orm.types.StepType;
public class WorkflowDataMigration
......@@ -34,8 +36,6 @@ public class WorkflowDataMigration
try
{
Job[] jobs = Job.SearchByAll().andWorkFlowTemplate(new IsNullFilter<>()).search(objTran);
MessageTemplate[] incomplete = MessageTemplate.SearchByAll().andApplicationStatus(new EqualsFilter<>(ApplicationStatus.DRAFT)).andIsSystemGenerated(new EqualsFilter<>(Boolean.TRUE)).search(objTran);
MessageTemplate[] postIngest = MessageTemplate.SearchByAll().andApplicationStatus(new EqualsFilter<>(ApplicationStatus.POST_INGEST)).andIsSystemGenerated(new EqualsFilter<>(Boolean.TRUE)).search(objTran);
for(Job job : jobs)
{
......@@ -59,46 +59,40 @@ public class WorkflowDataMigration
wfTemplate.setTemplateName(job.getJobTitle());
wfTemplate.setIsSystemGenerated(Boolean.TRUE);
wfTemplate.setHiringTeam(job.getHiringTeam());
wfTemplate.addToJobs(job);
wfTemplate.setRelatedToJob(Boolean.TRUE);
job.setWorkFlowTemplate(wfTemplate);
int sortOrder = 0;
int stepSortOrder = 0;
WorkFlowStage postIngestStage = createWorkFlowStage(objTran, wfTemplate, "Post Ingest", StageType.POST_INGEST, sortOrder++);
for(MessageTemplate mTemplate : (Collection<MessageTemplate>)CollectionFilter.filter(Arrays.asList(postIngest), MessageTemplate.SearchByAll().andMessageID(new EqualsFilter<>(job.getHiringTeam().getMessageID()))))
{
createWorkFlowMessage(objTran, postIngestStage, mTemplate);
}
WorkFlowStage incompleteStage = createWorkFlowStage(objTran, wfTemplate, "Incomplete", StageType.INCOMPLETE, sortOrder++);
for(MessageTemplate mTemplate : (Collection<MessageTemplate>)CollectionFilter.filter(Arrays.asList(incomplete), MessageTemplate.SearchByAll().andMessageID(new EqualsFilter<>(job.getHiringTeam().getMessageID()))))
{
createWorkFlowMessage(objTran, incompleteStage, mTemplate);
}
MessageTemplate[] messageTemplates = MessageTemplate.SearchByAll().andMessageID(new EqualsFilter<>(job.getHiringTeam().getMessageID())).andIsSystemGenerated(new EqualsFilter<>(Boolean.TRUE)).search(objTran);
WorkFlowStage initialStage = createWorkFlowStage(objTran, wfTemplate, "Initial", StageType.INITIAL, sortOrder++);
if(job.getDiversityIncluded())
{
createWorkFlowStage(objTran, wfTemplate, "Diversity", StageType.DIVERSITY, sortOrder++);
createWorkFlowStep(objTran, initialStage, StepType.DIVERSITY, stepSortOrder++);
}
if(job.getIncludeAssessmentCriteria())
{
createWorkFlowStage(objTran, wfTemplate, "Requirements", StageType.REQUIREMENT_FIT, sortOrder++);
createWorkFlowStep(objTran, initialStage, StepType.REQUIREMENT_FIT, stepSortOrder++);
}
if(job.getIncludeCulture())
{
createWorkFlowStage(objTran, wfTemplate, "Culture Fit", StageType.CULTURE_FIT, sortOrder++);
createWorkFlowStep(objTran, initialStage, StepType.CULTURE_FIT, stepSortOrder++);
}
createWorkFlowStage(objTran, wfTemplate, "Role Fit", StageType.ROLE_FIT, sortOrder++);
createWorkFlowStep(objTran, initialStage, StepType.ROLE_FIT, stepSortOrder++);
createWorkFlowStage(objTran, wfTemplate, "Submitted", StageType.REFERENCE_CHECK, sortOrder++);
for(MessageTemplate mTemplate : messageTemplates)
{
createWorkFlowMessage(objTran, initialStage, mTemplate);
}
for(WorkFlow workFlow : job.getWorkFlowsSet())
{
if(workFlow.getApplicationStatus() == ApplicationStatus.DRAFT || workFlow.getApplicationStatus() == ApplicationStatus.UNSUITABLE || workFlow.getApplicationStatus() == ApplicationStatus.SUBMITTED)
if(workFlow.getApplicationStatus() == ApplicationStatus.POST_INGEST || workFlow.getApplicationStatus() == ApplicationStatus.DRAFT || workFlow.getApplicationStatus() == ApplicationStatus.UNSUITABLE)
{
continue;
}
......@@ -114,6 +108,7 @@ public class WorkflowDataMigration
for(JobApplication jobApplication : job.getJobApplicationsSet())
{
jobApplication.setApplicantSource(jobApplication.getIsEmailIngest() ? ApplicantSource.INGEST : ApplicantSource.APPLY_URL);
jobApplication.setWorkFlowStage(getWFStageByStatus(wfTemplate, jobApplication.getApplicationStatus()));
}
}
......@@ -129,8 +124,12 @@ public class WorkflowDataMigration
private static void createWorkFlowMessage(ObjectTransaction objTran, WorkFlowStage stage, MessageTemplate mTemplate) throws StorageException, FieldException
{
WorkFlowMessage wfMessage = WorkFlowMessage.createWorkFlowMessage(objTran);
Set<ApplicantSource> sources = new HashSet();
sources.add(mTemplate.getApplicationStatus() == ApplicationStatus.DRAFT ? ApplicantSource.APPLY_URL : ApplicantSource.INGEST);
wfMessage.setWorkFlowStage(stage);
wfMessage.setApplicantSources(sources);
wfMessage.setBusinessHoursOnly(mTemplate.getBusinessHoursOnly());
wfMessage.setMessageTemplate(mTemplate);
wfMessage.setDelay(getDelay(mTemplate));
......@@ -149,6 +148,17 @@ public class WorkflowDataMigration
return wfStage;
}
private static WorkFlowStep createWorkFlowStep(ObjectTransaction objTran, WorkFlowStage wfStage, StepType stepType, int sortOrder) throws FieldException, StorageException
{
WorkFlowStep wfStep = WorkFlowStep.createWorkFlowStep(objTran);
wfStep.setWorkFlowStage(wfStage);
wfStep.setStepType(stepType);
wfStep.setSortOrder(sortOrder);
return wfStep;
}
private static String getDelay(MessageTemplate mTemplate)
{
StringBuilder sb = new StringBuilder();
......@@ -162,39 +172,30 @@ public class WorkflowDataMigration
public static StageType getStageTypeByStatus(ApplicationStatus status)
{
if(status == ApplicationStatus.POST_INGEST)
if(status == ApplicationStatus.POST_INGEST || status == ApplicationStatus.DRAFT)
{
return StageType.POST_INGEST;
}
else if(status == ApplicationStatus.DRAFT)
{
return StageType.INCOMPLETE;
return StageType.INITIAL;
}
else if(status == ApplicationStatus.UNSUITABLE)
{
return StageType.UNSUITABLE;
}
// TODO: map other statuses
return StageType.INTERVIEW;
return StageType.GENERIC;
}
public static WorkFlowStage getWFStageByStatus(WorkFlowTemplate template , ApplicationStatus status)
{
if(status == ApplicationStatus.POST_INGEST)
{
return getWFStage(template, StageType.POST_INGEST);
}
else if(status == ApplicationStatus.DRAFT)
if(status == ApplicationStatus.POST_INGEST || status == ApplicationStatus.DRAFT)
{
return getWFStage(template, StageType.INCOMPLETE);
return getWFStage(template, StageType.INITIAL);
}
else if(status == ApplicationStatus.UNSUITABLE)
{
return getWFStage(template, StageType.UNSUITABLE);
}
// TODO: map other statuses
return getWFStage(template, StageType.INTERVIEW);
return getWFStage(template, StageType.GENERIC);
}
private static WorkFlowStage getWFStage(WorkFlowTemplate template, StageType stageType)
......
......@@ -30,8 +30,6 @@ public class SaveMessageAsCopy extends ORMUpdateJSONService
{
MessageTemplate cloanedTemplate = revertAttributesAndClone(messageTemplate);
cloanedTemplate.setIsGlobalTemplate(Boolean.FALSE);
SecUser secUser = SecUser.getTXUser(objTran);
if(secUser != null && secUser.getExtension(CompanyUser.REFERENCE_CompanyUser) != null)
......@@ -42,7 +40,7 @@ public class SaveMessageAsCopy extends ORMUpdateJSONService
}
}
super.processForm(request, objTran, result, exceptions, createdBBCs, updatedBBCs); //To change body of generated methods, choose Tools | Templates.
super.processForm(request, objTran, result, exceptions, createdBBCs, updatedBBCs);
}
private MessageTemplate revertAttributesAndClone(MessageTemplate messageTemplate)
......
......@@ -30,8 +30,6 @@ public class SaveWorkflowAsCopy extends ORMUpdateJSONService
{
WorkFlowTemplate cloanedTemplate = revertAttributesAndClone(workFlowTemplate);
cloanedTemplate.setIsGlobalTemplate(Boolean.FALSE);
SecUser secUser = SecUser.getTXUser(objTran);
if(secUser != null && secUser.getExtension(CompanyUser.REFERENCE_CompanyUser) != null)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment