Commit 319e57c2 by nilu

data migration to support new workflow ORM changes

parent d0bc44ea
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
<column name="message_content" type="CLOB" nullable="false"/> <column name="message_content" type="CLOB" nullable="false"/>
<column name="template_type" type="String" nullable="true" length="200"/> <column name="template_type" type="String" nullable="true" length="200"/>
<column name="is_global_template" type="Boolean" nullable="true"/> <column name="is_global_template" type="Boolean" nullable="true"/>
<column name="is_system_generated" type="Boolean" nullable="true"/>
<column name="hiring_team_id" type="Long" length="11" nullable="true"/> <column name="hiring_team_id" type="Long" length="11" nullable="true"/>
</NODE> </NODE>
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
<column name="thank_you_secondary_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="job_outline_button_text" type="CLOB" nullable="true"/>
<column name="is_global_template" type="Boolean" nullable="true"/> <column name="is_global_template" 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="withdrawal_message_id" type="Long" length="11" nullable="true"/>
<column name="hiring_team_id" type="Long" length="11" nullable="true"/> <column name="hiring_team_id" type="Long" length="11" nullable="true"/>
</NODE> </NODE>
......
...@@ -19,6 +19,7 @@ CREATE TABLE tl_message_template ( ...@@ -19,6 +19,7 @@ CREATE TABLE tl_message_template (
message_content text NOT NULL, message_content text NOT NULL,
template_type varchar(200) NULL, template_type varchar(200) NULL,
is_global_template char(1) NULL, is_global_template char(1) NULL,
is_system_generated char(1) NULL,
hiring_team_id numeric(12) NULL hiring_team_id numeric(12) NULL
); );
......
...@@ -21,6 +21,7 @@ CREATE TABLE tl_work_flow_template ( ...@@ -21,6 +21,7 @@ CREATE TABLE tl_work_flow_template (
thank_you_secondary_text text NULL, thank_you_secondary_text text NULL,
job_outline_button_text text NULL, job_outline_button_text text NULL,
is_global_template char(1) NULL, is_global_template char(1) NULL,
is_system_generated char(1) NULL,
withdrawal_message_id numeric(12) NULL, withdrawal_message_id numeric(12) NULL,
hiring_team_id numeric(12) NULL hiring_team_id numeric(12) NULL
); );
......
...@@ -20,6 +20,7 @@ CREATE TABLE tl_message_template ( ...@@ -20,6 +20,7 @@ CREATE TABLE tl_message_template (
message_content clob NOT NULL, message_content clob NOT NULL,
template_type varchar2(200) NULL, template_type varchar2(200) NULL,
is_global_template char(1) NULL, is_global_template char(1) NULL,
is_system_generated char(1) NULL,
hiring_team_id number(12) NULL hiring_team_id number(12) NULL
); );
......
...@@ -22,6 +22,7 @@ CREATE TABLE tl_work_flow_template ( ...@@ -22,6 +22,7 @@ CREATE TABLE tl_work_flow_template (
thank_you_secondary_text clob NULL, thank_you_secondary_text clob NULL,
job_outline_button_text clob NULL, job_outline_button_text clob NULL,
is_global_template char(1) NULL, is_global_template char(1) NULL,
is_system_generated char(1) NULL,
withdrawal_message_id number(12) NULL, withdrawal_message_id number(12) NULL,
hiring_team_id number(12) NULL hiring_team_id number(12) NULL
); );
......
...@@ -20,6 +20,7 @@ CREATE TABLE tl_message_template ( ...@@ -20,6 +20,7 @@ CREATE TABLE tl_message_template (
message_content text NOT NULL, message_content text NOT NULL,
template_type varchar(200) NULL, template_type varchar(200) NULL,
is_global_template char(1) NULL, is_global_template char(1) NULL,
is_system_generated char(1) NULL,
hiring_team_id numeric(12) NULL hiring_team_id numeric(12) NULL
); );
......
...@@ -22,6 +22,7 @@ CREATE TABLE tl_work_flow_template ( ...@@ -22,6 +22,7 @@ CREATE TABLE tl_work_flow_template (
thank_you_secondary_text text NULL, thank_you_secondary_text text NULL,
job_outline_button_text text NULL, job_outline_button_text text NULL,
is_global_template char(1) NULL, is_global_template char(1) NULL,
is_system_generated char(1) NULL,
withdrawal_message_id numeric(12) NULL, withdrawal_message_id numeric(12) NULL,
hiring_team_id numeric(12) NULL hiring_team_id numeric(12) NULL
); );
......
...@@ -47,6 +47,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass ...@@ -47,6 +47,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
public static final String FIELD_MessageContent = "MessageContent"; public static final String FIELD_MessageContent = "MessageContent";
public static final String FIELD_TemplateType = "TemplateType"; public static final String FIELD_TemplateType = "TemplateType";
public static final String FIELD_IsGlobalTemplate = "IsGlobalTemplate"; public static final String FIELD_IsGlobalTemplate = "IsGlobalTemplate";
public static final String FIELD_IsSystemGenerated = "IsSystemGenerated";
public static final String SINGLEREFERENCE_HiringTeam = "HiringTeam"; public static final String SINGLEREFERENCE_HiringTeam = "HiringTeam";
public static final String BACKREF_HiringTeam = ""; public static final String BACKREF_HiringTeam = "";
...@@ -66,6 +67,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass ...@@ -66,6 +67,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
private static final DefaultAttributeHelper<MessageTemplate> HELPER_MessageContent = 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 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_IsGlobalTemplate = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<MessageTemplate> HELPER_IsSystemGenerated = DefaultAttributeHelper.INSTANCE;
// Private attributes corresponding to business object data // Private attributes corresponding to business object data
...@@ -80,6 +82,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass ...@@ -80,6 +82,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
private String _MessageContent; private String _MessageContent;
private TemplateType _TemplateType; private TemplateType _TemplateType;
private Boolean _IsGlobalTemplate; private Boolean _IsGlobalTemplate;
private Boolean _IsSystemGenerated;
// Private attributes corresponding to single references // Private attributes corresponding to single references
...@@ -104,6 +107,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass ...@@ -104,6 +107,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
private static final AttributeValidator[] FIELD_MessageContent_Validators; private static final AttributeValidator[] FIELD_MessageContent_Validators;
private static final AttributeValidator[] FIELD_TemplateType_Validators; private static final AttributeValidator[] FIELD_TemplateType_Validators;
private static final AttributeValidator[] FIELD_IsGlobalTemplate_Validators; private static final AttributeValidator[] FIELD_IsGlobalTemplate_Validators;
private static final AttributeValidator[] FIELD_IsSystemGenerated_Validators;
// Arrays of AttributeDecorators for each attribute // Arrays of AttributeDecorators for each attribute
...@@ -118,6 +122,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass ...@@ -118,6 +122,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
private static final AttributeDecorator<MessageTemplate, String>[] FIELD_MessageContent_Decorators; private static final AttributeDecorator<MessageTemplate, String>[] FIELD_MessageContent_Decorators;
private static final AttributeDecorator<MessageTemplate, TemplateType>[] FIELD_TemplateType_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_IsGlobalTemplate_Decorators;
private static final AttributeDecorator<MessageTemplate, Boolean>[] FIELD_IsSystemGenerated_Decorators;
// Arrays of SingleAssocDecorators for each attribute // Arrays of SingleAssocDecorators for each attribute
...@@ -151,6 +156,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass ...@@ -151,6 +156,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
FIELD_MessageContent_Validators = (AttributeValidator[])setupAttribMetaData_MessageContent(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_TemplateType_Validators = (AttributeValidator[])setupAttribMetaData_TemplateType(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_IsGlobalTemplate_Validators = (AttributeValidator[])setupAttribMetaData_IsGlobalTemplate(validatorMapping).toArray (new AttributeValidator[0]); FIELD_IsGlobalTemplate_Validators = (AttributeValidator[])setupAttribMetaData_IsGlobalTemplate(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_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]); FIELD_TemplateName_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_MessageTemplate, FIELD_TemplateName).toArray (new AttributeDecorator[0]);
FIELD_Subject_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_MessageTemplate, FIELD_Subject).toArray (new AttributeDecorator[0]); FIELD_Subject_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_MessageTemplate, FIELD_Subject).toArray (new AttributeDecorator[0]);
...@@ -162,6 +168,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass ...@@ -162,6 +168,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
FIELD_MessageContent_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_MessageTemplate, FIELD_MessageContent).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_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_IsGlobalTemplate_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_MessageTemplate, FIELD_IsGlobalTemplate).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]); SINGLEREFERENCE_HiringTeam_Decorators = (SingleAssocDecorator[])AttributeDecoratorUtils.getSingleAssocDecorators(REFERENCE_MessageTemplate, SINGLEREFERENCE_HiringTeam).toArray (new SingleAssocDecorator[0]);
...@@ -400,6 +407,25 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass ...@@ -400,6 +407,25 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
return validators; return validators;
} }
private static List setupAttribMetaData_IsSystemGenerated(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "is_system_generated");
metaInfo.put ("defaultValue", "Boolean.FALSE");
metaInfo.put ("mandatory", "false");
metaInfo.put ("name", "IsSystemGenerated");
metaInfo.put ("type", "Boolean");
metaInfo.put (METADATA_DB_TABLENAME, "tl_message_template");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for MessageTemplate.IsSystemGenerated:", metaInfo);
ATTRIBUTES_METADATA_MessageTemplate.put (FIELD_IsSystemGenerated, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(MessageTemplate.class, "IsSystemGenerated", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for MessageTemplate.IsSystemGenerated:", validators);
return validators;
}
// END OF STATIC METADATA DEFINITION // END OF STATIC METADATA DEFINITION
...@@ -434,6 +460,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass ...@@ -434,6 +460,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
_MessageContent = (String)(HELPER_MessageContent.initialise (_MessageContent)); _MessageContent = (String)(HELPER_MessageContent.initialise (_MessageContent));
_TemplateType = (TemplateType)(HELPER_TemplateType.initialise (_TemplateType)); _TemplateType = (TemplateType)(HELPER_TemplateType.initialise (_TemplateType));
_IsGlobalTemplate = (Boolean)(HELPER_IsGlobalTemplate.initialise (_IsGlobalTemplate)); _IsGlobalTemplate = (Boolean)(HELPER_IsGlobalTemplate.initialise (_IsGlobalTemplate));
_IsSystemGenerated = (Boolean)(Boolean.FALSE);
} }
...@@ -1562,6 +1589,106 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass ...@@ -1562,6 +1589,106 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
} }
} }
/**
* Attribute IsSystemGenerated
*/
public Boolean getIsSystemGenerated ()
{
assertValid();
Boolean valToReturn = AttributeDecoratorUtils.getValue (FIELD_IsSystemGenerated_Decorators, (MessageTemplate)this, FIELD_IsSystemGenerated, _IsSystemGenerated);
for (MessageTemplateBehaviourDecorator bhd : MessageTemplate_BehaviourDecorators)
{
valToReturn = bhd.getIsSystemGenerated ((MessageTemplate)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 preIsSystemGeneratedChange (Boolean newIsSystemGenerated) 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 postIsSystemGeneratedChange () throws FieldException
{
}
public FieldWriteability getWriteability_IsSystemGenerated ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute IsSystemGenerated. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setIsSystemGenerated (Boolean newIsSystemGenerated) throws FieldException
{
newIsSystemGenerated = AttributeDecoratorUtils.setValue (FIELD_IsSystemGenerated_Decorators, (MessageTemplate)this, FIELD_IsSystemGenerated, newIsSystemGenerated);
boolean oldAndNewIdentical = HELPER_IsSystemGenerated.compare (_IsSystemGenerated, newIsSystemGenerated);
try
{
for (MessageTemplateBehaviourDecorator bhd : MessageTemplate_BehaviourDecorators)
{
newIsSystemGenerated = bhd.setIsSystemGenerated ((MessageTemplate)this, newIsSystemGenerated);
oldAndNewIdentical = HELPER_IsSystemGenerated.compare (_IsSystemGenerated, newIsSystemGenerated);
}
if (FIELD_IsSystemGenerated_Validators.length > 0)
{
Object newIsSystemGeneratedObj = HELPER_IsSystemGenerated.toObject (newIsSystemGenerated);
if (newIsSystemGeneratedObj != null)
{
int loopMax = FIELD_IsSystemGenerated_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_MessageTemplate.get (FIELD_IsSystemGenerated);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_IsSystemGenerated_Validators[v].checkAttribute (this, FIELD_IsSystemGenerated, metadata, newIsSystemGeneratedObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (AttributeDecoratorUtils.getWriteability (FIELD_IsSystemGenerated_Decorators, (MessageTemplate)this, FIELD_IsSystemGenerated ,getWriteability_IsSystemGenerated ()) != FieldWriteability.FALSE, "Field IsSystemGenerated is not writeable");
preIsSystemGeneratedChange (newIsSystemGenerated);
markFieldChange (FIELD_IsSystemGenerated);
_IsSystemGenerated = newIsSystemGenerated;
postFieldChange (FIELD_IsSystemGenerated);
postIsSystemGeneratedChange ();
}
}
/** /**
...@@ -1954,6 +2081,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass ...@@ -1954,6 +2081,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
tl_message_templatePSet.setAttrib (FIELD_MessageContent, HELPER_MessageContent.toObject (_MessageContent)); // 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_TemplateType, HELPER_TemplateType.toObject (_TemplateType)); //
tl_message_templatePSet.setAttrib (FIELD_IsGlobalTemplate, HELPER_IsGlobalTemplate.toObject (_IsGlobalTemplate)); // tl_message_templatePSet.setAttrib (FIELD_IsGlobalTemplate, HELPER_IsGlobalTemplate.toObject (_IsGlobalTemplate)); //
tl_message_templatePSet.setAttrib (FIELD_IsSystemGenerated, HELPER_IsSystemGenerated.toObject (_IsSystemGenerated)); //
_HiringTeam.getPersistentSets (allSets); _HiringTeam.getPersistentSets (allSets);
} }
...@@ -1979,6 +2107,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass ...@@ -1979,6 +2107,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
_MessageContent = (String)(HELPER_MessageContent.fromObject (_MessageContent, tl_message_templatePSet.getAttrib (FIELD_MessageContent))); // _MessageContent = (String)(HELPER_MessageContent.fromObject (_MessageContent, tl_message_templatePSet.getAttrib (FIELD_MessageContent))); //
_TemplateType = (TemplateType)(HELPER_TemplateType.fromObject (_TemplateType, tl_message_templatePSet.getAttrib (FIELD_TemplateType))); // _TemplateType = (TemplateType)(HELPER_TemplateType.fromObject (_TemplateType, tl_message_templatePSet.getAttrib (FIELD_TemplateType))); //
_IsGlobalTemplate = (Boolean)(HELPER_IsGlobalTemplate.fromObject (_IsGlobalTemplate, tl_message_templatePSet.getAttrib (FIELD_IsGlobalTemplate))); // _IsGlobalTemplate = (Boolean)(HELPER_IsGlobalTemplate.fromObject (_IsGlobalTemplate, tl_message_templatePSet.getAttrib (FIELD_IsGlobalTemplate))); //
_IsSystemGenerated = (Boolean)(HELPER_IsSystemGenerated.fromObject (_IsSystemGenerated, tl_message_templatePSet.getAttrib (FIELD_IsSystemGenerated))); //
_HiringTeam.setFromPersistentSets (objectID, allSets); _HiringTeam.setFromPersistentSets (objectID, allSets);
} }
...@@ -2091,6 +2220,15 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass ...@@ -2091,6 +2220,15 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
{ {
e.addException (ex); e.addException (ex);
} }
try
{
setIsSystemGenerated (otherMessageTemplate.getIsSystemGenerated ());
}
catch (FieldException ex)
{
e.addException (ex);
}
} }
} }
...@@ -2117,6 +2255,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass ...@@ -2117,6 +2255,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
_MessageContent = sourceMessageTemplate._MessageContent; _MessageContent = sourceMessageTemplate._MessageContent;
_TemplateType = sourceMessageTemplate._TemplateType; _TemplateType = sourceMessageTemplate._TemplateType;
_IsGlobalTemplate = sourceMessageTemplate._IsGlobalTemplate; _IsGlobalTemplate = sourceMessageTemplate._IsGlobalTemplate;
_IsSystemGenerated = sourceMessageTemplate._IsSystemGenerated;
} }
} }
...@@ -2181,6 +2320,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass ...@@ -2181,6 +2320,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
_MessageContent = (String)(HELPER_MessageContent.readExternal (_MessageContent, vals.get(FIELD_MessageContent))); // _MessageContent = (String)(HELPER_MessageContent.readExternal (_MessageContent, vals.get(FIELD_MessageContent))); //
_TemplateType = (TemplateType)(HELPER_TemplateType.readExternal (_TemplateType, vals.get(FIELD_TemplateType))); // _TemplateType = (TemplateType)(HELPER_TemplateType.readExternal (_TemplateType, vals.get(FIELD_TemplateType))); //
_IsGlobalTemplate = (Boolean)(HELPER_IsGlobalTemplate.readExternal (_IsGlobalTemplate, vals.get(FIELD_IsGlobalTemplate))); // _IsGlobalTemplate = (Boolean)(HELPER_IsGlobalTemplate.readExternal (_IsGlobalTemplate, vals.get(FIELD_IsGlobalTemplate))); //
_IsSystemGenerated = (Boolean)(HELPER_IsSystemGenerated.readExternal (_IsSystemGenerated, vals.get(FIELD_IsSystemGenerated))); //
_HiringTeam.readExternalData(vals.get(SINGLEREFERENCE_HiringTeam)); _HiringTeam.readExternalData(vals.get(SINGLEREFERENCE_HiringTeam));
} }
...@@ -2204,6 +2344,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass ...@@ -2204,6 +2344,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
vals.put (FIELD_MessageContent, HELPER_MessageContent.writeExternal (_MessageContent)); vals.put (FIELD_MessageContent, HELPER_MessageContent.writeExternal (_MessageContent));
vals.put (FIELD_TemplateType, HELPER_TemplateType.writeExternal (_TemplateType)); vals.put (FIELD_TemplateType, HELPER_TemplateType.writeExternal (_TemplateType));
vals.put (FIELD_IsGlobalTemplate, HELPER_IsGlobalTemplate.writeExternal (_IsGlobalTemplate)); vals.put (FIELD_IsGlobalTemplate, HELPER_IsGlobalTemplate.writeExternal (_IsGlobalTemplate));
vals.put (FIELD_IsSystemGenerated, HELPER_IsSystemGenerated.writeExternal (_IsSystemGenerated));
vals.put (SINGLEREFERENCE_HiringTeam, _HiringTeam.writeExternalData()); vals.put (SINGLEREFERENCE_HiringTeam, _HiringTeam.writeExternalData());
} }
...@@ -2262,6 +2403,10 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass ...@@ -2262,6 +2403,10 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
{ {
listener.notifyFieldChange(this, other, FIELD_IsGlobalTemplate, HELPER_IsGlobalTemplate.toObject(this._IsGlobalTemplate), HELPER_IsGlobalTemplate.toObject(otherMessageTemplate._IsGlobalTemplate)); listener.notifyFieldChange(this, other, FIELD_IsGlobalTemplate, HELPER_IsGlobalTemplate.toObject(this._IsGlobalTemplate), HELPER_IsGlobalTemplate.toObject(otherMessageTemplate._IsGlobalTemplate));
} }
if (!HELPER_IsSystemGenerated.compare(this._IsSystemGenerated, otherMessageTemplate._IsSystemGenerated))
{
listener.notifyFieldChange(this, other, FIELD_IsSystemGenerated, HELPER_IsSystemGenerated.toObject(this._IsSystemGenerated), HELPER_IsSystemGenerated.toObject(otherMessageTemplate._IsSystemGenerated));
}
// Compare single assocs // Compare single assocs
_HiringTeam.compare (otherMessageTemplate._HiringTeam, listener); _HiringTeam.compare (otherMessageTemplate._HiringTeam, listener);
...@@ -2296,6 +2441,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass ...@@ -2296,6 +2441,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
visitor.visitField(this, FIELD_MessageContent, HELPER_MessageContent.toObject(getMessageContent())); visitor.visitField(this, FIELD_MessageContent, HELPER_MessageContent.toObject(getMessageContent()));
visitor.visitField(this, FIELD_TemplateType, HELPER_TemplateType.toObject(getTemplateType())); visitor.visitField(this, FIELD_TemplateType, HELPER_TemplateType.toObject(getTemplateType()));
visitor.visitField(this, FIELD_IsGlobalTemplate, HELPER_IsGlobalTemplate.toObject(getIsGlobalTemplate())); visitor.visitField(this, FIELD_IsGlobalTemplate, HELPER_IsGlobalTemplate.toObject(getIsGlobalTemplate()));
visitor.visitField(this, FIELD_IsSystemGenerated, HELPER_IsSystemGenerated.toObject(getIsSystemGenerated()));
visitor.visitAssociation (_HiringTeam); visitor.visitAssociation (_HiringTeam);
} }
...@@ -2378,6 +2524,10 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass ...@@ -2378,6 +2524,10 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
{ {
return filter.matches (getIsGlobalTemplate ()); return filter.matches (getIsGlobalTemplate ());
} }
else if (attribName.equals (FIELD_IsSystemGenerated))
{
return filter.matches (getIsSystemGenerated ());
}
else if (attribName.equals (SINGLEREFERENCE_HiringTeam)) else if (attribName.equals (SINGLEREFERENCE_HiringTeam))
{ {
return filter.matches (getHiringTeam ()); return filter.matches (getHiringTeam ());
...@@ -2478,6 +2628,12 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass ...@@ -2478,6 +2628,12 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
return this; return this;
} }
public SearchAll andIsSystemGenerated (QueryFilter<Boolean> filter)
{
filter.addFilter (context, "tl_message_template.is_system_generated", "IsSystemGenerated");
return this;
}
public SearchAll andHiringTeam (QueryFilter<HiringTeam> filter) public SearchAll andHiringTeam (QueryFilter<HiringTeam> filter)
{ {
filter.addFilter (context, "tl_message_template.hiring_team_id", "HiringTeam"); filter.addFilter (context, "tl_message_template.hiring_team_id", "HiringTeam");
...@@ -2560,6 +2716,10 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass ...@@ -2560,6 +2716,10 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
{ {
return HELPER_IsGlobalTemplate.toObject (getIsGlobalTemplate ()); return HELPER_IsGlobalTemplate.toObject (getIsGlobalTemplate ());
} }
else if (attribName.equals (FIELD_IsSystemGenerated))
{
return HELPER_IsSystemGenerated.toObject (getIsSystemGenerated ());
}
else else
{ {
return super.getAttribute (attribName); return super.getAttribute (attribName);
...@@ -2617,6 +2777,10 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass ...@@ -2617,6 +2777,10 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
{ {
return HELPER_IsGlobalTemplate; return HELPER_IsGlobalTemplate;
} }
else if (attribName.equals (FIELD_IsSystemGenerated))
{
return HELPER_IsSystemGenerated;
}
else else
{ {
return super.getAttributeHelper (attribName); return super.getAttributeHelper (attribName);
...@@ -2674,6 +2838,10 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass ...@@ -2674,6 +2838,10 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
{ {
setIsGlobalTemplate ((Boolean)(HELPER_IsGlobalTemplate.fromObject (_IsGlobalTemplate, attribValue))); setIsGlobalTemplate ((Boolean)(HELPER_IsGlobalTemplate.fromObject (_IsGlobalTemplate, attribValue)));
} }
else if (attribName.equals (FIELD_IsSystemGenerated))
{
setIsSystemGenerated ((Boolean)(HELPER_IsSystemGenerated.fromObject (_IsSystemGenerated, attribValue)));
}
else else
{ {
super.setAttribute (attribName, attribValue); super.setAttribute (attribName, attribValue);
...@@ -2748,6 +2916,10 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass ...@@ -2748,6 +2916,10 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
{ {
return getWriteability_IsGlobalTemplate (); return getWriteability_IsGlobalTemplate ();
} }
else if (fieldName.equals (FIELD_IsSystemGenerated))
{
return getWriteability_IsSystemGenerated ();
}
else if (fieldName.equals (SINGLEREFERENCE_HiringTeam)) else if (fieldName.equals (SINGLEREFERENCE_HiringTeam))
{ {
return getWriteability_HiringTeam (); return getWriteability_HiringTeam ();
...@@ -2816,6 +2988,11 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass ...@@ -2816,6 +2988,11 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
fields.add (FIELD_IsGlobalTemplate); fields.add (FIELD_IsGlobalTemplate);
} }
if (getWriteability_IsSystemGenerated () != FieldWriteability.TRUE)
{
fields.add (FIELD_IsSystemGenerated);
}
super.putUnwriteable (fields); super.putUnwriteable (fields);
} }
...@@ -2847,6 +3024,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass ...@@ -2847,6 +3024,7 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
result.add(HELPER_MessageContent.getAttribObject (getClass (), _MessageContent, true, FIELD_MessageContent)); result.add(HELPER_MessageContent.getAttribObject (getClass (), _MessageContent, true, FIELD_MessageContent));
result.add(HELPER_TemplateType.getAttribObject (getClass (), _TemplateType, false, FIELD_TemplateType)); result.add(HELPER_TemplateType.getAttribObject (getClass (), _TemplateType, false, FIELD_TemplateType));
result.add(HELPER_IsGlobalTemplate.getAttribObject (getClass (), _IsGlobalTemplate, false, FIELD_IsGlobalTemplate)); result.add(HELPER_IsGlobalTemplate.getAttribObject (getClass (), _IsGlobalTemplate, false, FIELD_IsGlobalTemplate));
result.add(HELPER_IsSystemGenerated.getAttribObject (getClass (), _IsSystemGenerated, false, FIELD_IsSystemGenerated));
return result; return result;
} }
...@@ -3102,6 +3280,24 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass ...@@ -3102,6 +3280,24 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
return newIsGlobalTemplate; return newIsGlobalTemplate;
} }
/**
* Get the attribute IsSystemGenerated
*/
public Boolean getIsSystemGenerated (MessageTemplate obj, Boolean original)
{
return original;
}
/**
* Change the value set for attribute IsSystemGenerated.
* May modify the field beforehand
* Occurs before validation.
*/
public Boolean setIsSystemGenerated (MessageTemplate obj, Boolean newIsSystemGenerated) throws FieldException
{
return newIsSystemGenerated;
}
} }
@Override @Override
...@@ -3204,6 +3400,10 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass ...@@ -3204,6 +3400,10 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
{ {
return toIsGlobalTemplate (); return toIsGlobalTemplate ();
} }
if (name.equals ("IsSystemGenerated"))
{
return toIsSystemGenerated ();
}
if (name.equals ("HiringTeam")) if (name.equals ("HiringTeam"))
{ {
return toHiringTeam (); return toHiringTeam ();
...@@ -3242,6 +3442,8 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass ...@@ -3242,6 +3442,8 @@ public abstract class BaseMessageTemplate extends BaseBusinessClass
public PipeLine<From, Boolean> toIsGlobalTemplate () { return pipe(new ORMAttributePipe<Me, Boolean>(FIELD_IsGlobalTemplate)); } public PipeLine<From, Boolean> toIsGlobalTemplate () { return pipe(new ORMAttributePipe<Me, Boolean>(FIELD_IsGlobalTemplate)); }
public PipeLine<From, Boolean> toIsSystemGenerated () { return pipe(new ORMAttributePipe<Me, Boolean>(FIELD_IsSystemGenerated)); }
public HiringTeam.HiringTeamPipeLineFactory<From, HiringTeam> toHiringTeam () { return toHiringTeam (Filter.ALL); } public HiringTeam.HiringTeamPipeLineFactory<From, HiringTeam> toHiringTeam () { return toHiringTeam (Filter.ALL); }
public HiringTeam.HiringTeamPipeLineFactory<From, HiringTeam> toHiringTeam (Filter<HiringTeam> filter) public HiringTeam.HiringTeamPipeLineFactory<From, HiringTeam> toHiringTeam (Filter<HiringTeam> filter)
......
...@@ -202,6 +202,7 @@ public abstract class BaseWorkFlowMessage extends BaseBusinessClass ...@@ -202,6 +202,7 @@ public abstract class BaseWorkFlowMessage extends BaseBusinessClass
Map metaInfo = new HashMap (); Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "business_hours_only"); metaInfo.put ("dbcol", "business_hours_only");
metaInfo.put ("defaultValue", "Boolean.FALSE");
metaInfo.put ("mandatory", "false"); metaInfo.put ("mandatory", "false");
metaInfo.put ("name", "BusinessHoursOnly"); metaInfo.put ("name", "BusinessHoursOnly");
metaInfo.put ("type", "Boolean"); metaInfo.put ("type", "Boolean");
...@@ -258,7 +259,7 @@ public abstract class BaseWorkFlowMessage extends BaseBusinessClass ...@@ -258,7 +259,7 @@ public abstract class BaseWorkFlowMessage extends BaseBusinessClass
_Delay = (String)(HELPER_Delay.initialise (_Delay)); _Delay = (String)(HELPER_Delay.initialise (_Delay));
_Variance = (String)(HELPER_Variance.initialise (_Variance)); _Variance = (String)(HELPER_Variance.initialise (_Variance));
_BusinessHoursOnly = (Boolean)(HELPER_BusinessHoursOnly.initialise (_BusinessHoursOnly)); _BusinessHoursOnly = (Boolean)(Boolean.FALSE);
_IsWithdrawalMessage = (Boolean)(HELPER_IsWithdrawalMessage.initialise (_IsWithdrawalMessage)); _IsWithdrawalMessage = (Boolean)(HELPER_IsWithdrawalMessage.initialise (_IsWithdrawalMessage));
} }
......
...@@ -49,6 +49,7 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass ...@@ -49,6 +49,7 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
public static final String FIELD_ThankYouSecondaryText = "ThankYouSecondaryText"; public static final String FIELD_ThankYouSecondaryText = "ThankYouSecondaryText";
public static final String FIELD_JobOutlineButtonText = "JobOutlineButtonText"; public static final String FIELD_JobOutlineButtonText = "JobOutlineButtonText";
public static final String FIELD_IsGlobalTemplate = "IsGlobalTemplate"; public static final String FIELD_IsGlobalTemplate = "IsGlobalTemplate";
public static final String FIELD_IsSystemGenerated = "IsSystemGenerated";
public static final String SINGLEREFERENCE_WithdrawalMessage = "WithdrawalMessage"; public static final String SINGLEREFERENCE_WithdrawalMessage = "WithdrawalMessage";
public static final String SINGLEREFERENCE_HiringTeam = "HiringTeam"; public static final String SINGLEREFERENCE_HiringTeam = "HiringTeam";
public static final String BACKREF_HiringTeam = ""; public static final String BACKREF_HiringTeam = "";
...@@ -75,6 +76,7 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass ...@@ -75,6 +76,7 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
private static final DefaultAttributeHelper<WorkFlowTemplate> HELPER_ThankYouSecondaryText = 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_JobOutlineButtonText = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<WorkFlowTemplate> HELPER_IsGlobalTemplate = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper<WorkFlowTemplate> HELPER_IsGlobalTemplate = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<WorkFlowTemplate> HELPER_IsSystemGenerated = DefaultAttributeHelper.INSTANCE;
// Private attributes corresponding to business object data // Private attributes corresponding to business object data
...@@ -91,6 +93,7 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass ...@@ -91,6 +93,7 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
private String _ThankYouSecondaryText; private String _ThankYouSecondaryText;
private String _JobOutlineButtonText; private String _JobOutlineButtonText;
private Boolean _IsGlobalTemplate; private Boolean _IsGlobalTemplate;
private Boolean _IsSystemGenerated;
// Private attributes corresponding to single references // Private attributes corresponding to single references
...@@ -120,6 +123,7 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass ...@@ -120,6 +123,7 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
private static final AttributeValidator[] FIELD_ThankYouSecondaryText_Validators; private static final AttributeValidator[] FIELD_ThankYouSecondaryText_Validators;
private static final AttributeValidator[] FIELD_JobOutlineButtonText_Validators; private static final AttributeValidator[] FIELD_JobOutlineButtonText_Validators;
private static final AttributeValidator[] FIELD_IsGlobalTemplate_Validators; private static final AttributeValidator[] FIELD_IsGlobalTemplate_Validators;
private static final AttributeValidator[] FIELD_IsSystemGenerated_Validators;
// Arrays of AttributeDecorators for each attribute // Arrays of AttributeDecorators for each attribute
...@@ -136,6 +140,7 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass ...@@ -136,6 +140,7 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
private static final AttributeDecorator<WorkFlowTemplate, String>[] FIELD_ThankYouSecondaryText_Decorators; private static final AttributeDecorator<WorkFlowTemplate, String>[] FIELD_ThankYouSecondaryText_Decorators;
private static final AttributeDecorator<WorkFlowTemplate, String>[] FIELD_JobOutlineButtonText_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_IsGlobalTemplate_Decorators;
private static final AttributeDecorator<WorkFlowTemplate, Boolean>[] FIELD_IsSystemGenerated_Decorators;
// Arrays of SingleAssocDecorators for each attribute // Arrays of SingleAssocDecorators for each attribute
...@@ -179,6 +184,7 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass ...@@ -179,6 +184,7 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
FIELD_ThankYouSecondaryText_Validators = (AttributeValidator[])setupAttribMetaData_ThankYouSecondaryText(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_JobOutlineButtonText_Validators = (AttributeValidator[])setupAttribMetaData_JobOutlineButtonText(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_IsGlobalTemplate_Validators = (AttributeValidator[])setupAttribMetaData_IsGlobalTemplate(validatorMapping).toArray (new AttributeValidator[0]); FIELD_IsGlobalTemplate_Validators = (AttributeValidator[])setupAttribMetaData_IsGlobalTemplate(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_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]); FIELD_LandingButtonText_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_WorkFlowTemplate, FIELD_LandingButtonText).toArray (new AttributeDecorator[0]);
FIELD_VerificationHeaderText_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_WorkFlowTemplate, FIELD_VerificationHeaderText).toArray (new AttributeDecorator[0]); FIELD_VerificationHeaderText_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_WorkFlowTemplate, FIELD_VerificationHeaderText).toArray (new AttributeDecorator[0]);
...@@ -192,6 +198,7 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass ...@@ -192,6 +198,7 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
FIELD_ThankYouSecondaryText_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_WorkFlowTemplate, FIELD_ThankYouSecondaryText).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_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_IsGlobalTemplate_Decorators = (AttributeDecorator[])AttributeDecoratorUtils.getAttributeDecorators(REFERENCE_WorkFlowTemplate, FIELD_IsGlobalTemplate).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_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]); SINGLEREFERENCE_HiringTeam_Decorators = (SingleAssocDecorator[])AttributeDecoratorUtils.getSingleAssocDecorators(REFERENCE_WorkFlowTemplate, SINGLEREFERENCE_HiringTeam).toArray (new SingleAssocDecorator[0]);
MULTIPLEREFERENCE_WorkFlowStages_Decorators = (MultiAssocDecorator[])AttributeDecoratorUtils.getMultiAssocDecorators(REFERENCE_WorkFlowTemplate, MULTIPLEREFERENCE_WorkFlowStages).toArray (new MultiAssocDecorator[0]); MULTIPLEREFERENCE_WorkFlowStages_Decorators = (MultiAssocDecorator[])AttributeDecoratorUtils.getMultiAssocDecorators(REFERENCE_WorkFlowTemplate, MULTIPLEREFERENCE_WorkFlowStages).toArray (new MultiAssocDecorator[0]);
...@@ -510,6 +517,25 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass ...@@ -510,6 +517,25 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
return validators; return validators;
} }
private static List setupAttribMetaData_IsSystemGenerated(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "is_system_generated");
metaInfo.put ("defaultValue", "Boolean.FALSE");
metaInfo.put ("mandatory", "false");
metaInfo.put ("name", "IsSystemGenerated");
metaInfo.put ("type", "Boolean");
metaInfo.put (METADATA_DB_TABLENAME, "tl_work_flow_template");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for WorkFlowTemplate.IsSystemGenerated:", metaInfo);
ATTRIBUTES_METADATA_WorkFlowTemplate.put (FIELD_IsSystemGenerated, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(WorkFlowTemplate.class, "IsSystemGenerated", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for WorkFlowTemplate.IsSystemGenerated:", validators);
return validators;
}
// END OF STATIC METADATA DEFINITION // END OF STATIC METADATA DEFINITION
...@@ -546,6 +572,7 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass ...@@ -546,6 +572,7 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
_ThankYouSecondaryText = (String)("We will get in touch with you soon"); _ThankYouSecondaryText = (String)("We will get in touch with you soon");
_JobOutlineButtonText = (String)("Continue"); _JobOutlineButtonText = (String)("Continue");
_IsGlobalTemplate = (Boolean)(HELPER_IsGlobalTemplate.initialise (_IsGlobalTemplate)); _IsGlobalTemplate = (Boolean)(HELPER_IsGlobalTemplate.initialise (_IsGlobalTemplate));
_IsSystemGenerated = (Boolean)(Boolean.FALSE);
} }
...@@ -1873,6 +1900,106 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass ...@@ -1873,6 +1900,106 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
} }
} }
/**
* Attribute IsSystemGenerated
*/
public Boolean getIsSystemGenerated ()
{
assertValid();
Boolean valToReturn = AttributeDecoratorUtils.getValue (FIELD_IsSystemGenerated_Decorators, (WorkFlowTemplate)this, FIELD_IsSystemGenerated, _IsSystemGenerated);
for (WorkFlowTemplateBehaviourDecorator bhd : WorkFlowTemplate_BehaviourDecorators)
{
valToReturn = bhd.getIsSystemGenerated ((WorkFlowTemplate)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 preIsSystemGeneratedChange (Boolean newIsSystemGenerated) 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 postIsSystemGeneratedChange () throws FieldException
{
}
public FieldWriteability getWriteability_IsSystemGenerated ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute IsSystemGenerated. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setIsSystemGenerated (Boolean newIsSystemGenerated) throws FieldException
{
newIsSystemGenerated = AttributeDecoratorUtils.setValue (FIELD_IsSystemGenerated_Decorators, (WorkFlowTemplate)this, FIELD_IsSystemGenerated, newIsSystemGenerated);
boolean oldAndNewIdentical = HELPER_IsSystemGenerated.compare (_IsSystemGenerated, newIsSystemGenerated);
try
{
for (WorkFlowTemplateBehaviourDecorator bhd : WorkFlowTemplate_BehaviourDecorators)
{
newIsSystemGenerated = bhd.setIsSystemGenerated ((WorkFlowTemplate)this, newIsSystemGenerated);
oldAndNewIdentical = HELPER_IsSystemGenerated.compare (_IsSystemGenerated, newIsSystemGenerated);
}
if (FIELD_IsSystemGenerated_Validators.length > 0)
{
Object newIsSystemGeneratedObj = HELPER_IsSystemGenerated.toObject (newIsSystemGenerated);
if (newIsSystemGeneratedObj != null)
{
int loopMax = FIELD_IsSystemGenerated_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_WorkFlowTemplate.get (FIELD_IsSystemGenerated);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_IsSystemGenerated_Validators[v].checkAttribute (this, FIELD_IsSystemGenerated, metadata, newIsSystemGeneratedObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (AttributeDecoratorUtils.getWriteability (FIELD_IsSystemGenerated_Decorators, (WorkFlowTemplate)this, FIELD_IsSystemGenerated ,getWriteability_IsSystemGenerated ()) != FieldWriteability.FALSE, "Field IsSystemGenerated is not writeable");
preIsSystemGeneratedChange (newIsSystemGenerated);
markFieldChange (FIELD_IsSystemGenerated);
_IsSystemGenerated = newIsSystemGenerated;
postFieldChange (FIELD_IsSystemGenerated);
postIsSystemGeneratedChange ();
}
}
/** /**
...@@ -2605,6 +2732,7 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass ...@@ -2605,6 +2732,7 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
tl_work_flow_templatePSet.setAttrib (FIELD_ThankYouSecondaryText, HELPER_ThankYouSecondaryText.toObject (_ThankYouSecondaryText)); // 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_JobOutlineButtonText, HELPER_JobOutlineButtonText.toObject (_JobOutlineButtonText)); //
tl_work_flow_templatePSet.setAttrib (FIELD_IsGlobalTemplate, HELPER_IsGlobalTemplate.toObject (_IsGlobalTemplate)); // tl_work_flow_templatePSet.setAttrib (FIELD_IsGlobalTemplate, HELPER_IsGlobalTemplate.toObject (_IsGlobalTemplate)); //
tl_work_flow_templatePSet.setAttrib (FIELD_IsSystemGenerated, HELPER_IsSystemGenerated.toObject (_IsSystemGenerated)); //
_WithdrawalMessage.getPersistentSets (allSets); _WithdrawalMessage.getPersistentSets (allSets);
_HiringTeam.getPersistentSets (allSets); _HiringTeam.getPersistentSets (allSets);
...@@ -2633,6 +2761,7 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass ...@@ -2633,6 +2761,7 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
_ThankYouSecondaryText = (String)(HELPER_ThankYouSecondaryText.fromObject (_ThankYouSecondaryText, tl_work_flow_templatePSet.getAttrib (FIELD_ThankYouSecondaryText))); // _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))); // _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))); // _IsGlobalTemplate = (Boolean)(HELPER_IsGlobalTemplate.fromObject (_IsGlobalTemplate, tl_work_flow_templatePSet.getAttrib (FIELD_IsGlobalTemplate))); //
_IsSystemGenerated = (Boolean)(HELPER_IsSystemGenerated.fromObject (_IsSystemGenerated, tl_work_flow_templatePSet.getAttrib (FIELD_IsSystemGenerated))); //
_WithdrawalMessage.setFromPersistentSets (objectID, allSets); _WithdrawalMessage.setFromPersistentSets (objectID, allSets);
_HiringTeam.setFromPersistentSets (objectID, allSets); _HiringTeam.setFromPersistentSets (objectID, allSets);
...@@ -2764,6 +2893,15 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass ...@@ -2764,6 +2893,15 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
{ {
e.addException (ex); e.addException (ex);
} }
try
{
setIsSystemGenerated (otherWorkFlowTemplate.getIsSystemGenerated ());
}
catch (FieldException ex)
{
e.addException (ex);
}
} }
} }
...@@ -2792,6 +2930,7 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass ...@@ -2792,6 +2930,7 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
_ThankYouSecondaryText = sourceWorkFlowTemplate._ThankYouSecondaryText; _ThankYouSecondaryText = sourceWorkFlowTemplate._ThankYouSecondaryText;
_JobOutlineButtonText = sourceWorkFlowTemplate._JobOutlineButtonText; _JobOutlineButtonText = sourceWorkFlowTemplate._JobOutlineButtonText;
_IsGlobalTemplate = sourceWorkFlowTemplate._IsGlobalTemplate; _IsGlobalTemplate = sourceWorkFlowTemplate._IsGlobalTemplate;
_IsSystemGenerated = sourceWorkFlowTemplate._IsSystemGenerated;
} }
} }
...@@ -2861,6 +3000,7 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass ...@@ -2861,6 +3000,7 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
_ThankYouSecondaryText = (String)(HELPER_ThankYouSecondaryText.readExternal (_ThankYouSecondaryText, vals.get(FIELD_ThankYouSecondaryText))); // _ThankYouSecondaryText = (String)(HELPER_ThankYouSecondaryText.readExternal (_ThankYouSecondaryText, vals.get(FIELD_ThankYouSecondaryText))); //
_JobOutlineButtonText = (String)(HELPER_JobOutlineButtonText.readExternal (_JobOutlineButtonText, vals.get(FIELD_JobOutlineButtonText))); // _JobOutlineButtonText = (String)(HELPER_JobOutlineButtonText.readExternal (_JobOutlineButtonText, vals.get(FIELD_JobOutlineButtonText))); //
_IsGlobalTemplate = (Boolean)(HELPER_IsGlobalTemplate.readExternal (_IsGlobalTemplate, vals.get(FIELD_IsGlobalTemplate))); // _IsGlobalTemplate = (Boolean)(HELPER_IsGlobalTemplate.readExternal (_IsGlobalTemplate, vals.get(FIELD_IsGlobalTemplate))); //
_IsSystemGenerated = (Boolean)(HELPER_IsSystemGenerated.readExternal (_IsSystemGenerated, vals.get(FIELD_IsSystemGenerated))); //
_WithdrawalMessage.readExternalData(vals.get(SINGLEREFERENCE_WithdrawalMessage)); _WithdrawalMessage.readExternalData(vals.get(SINGLEREFERENCE_WithdrawalMessage));
_HiringTeam.readExternalData(vals.get(SINGLEREFERENCE_HiringTeam)); _HiringTeam.readExternalData(vals.get(SINGLEREFERENCE_HiringTeam));
_WorkFlowStages.readExternalData(vals.get(MULTIPLEREFERENCE_WorkFlowStages)); _WorkFlowStages.readExternalData(vals.get(MULTIPLEREFERENCE_WorkFlowStages));
...@@ -2889,6 +3029,7 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass ...@@ -2889,6 +3029,7 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
vals.put (FIELD_ThankYouSecondaryText, HELPER_ThankYouSecondaryText.writeExternal (_ThankYouSecondaryText)); vals.put (FIELD_ThankYouSecondaryText, HELPER_ThankYouSecondaryText.writeExternal (_ThankYouSecondaryText));
vals.put (FIELD_JobOutlineButtonText, HELPER_JobOutlineButtonText.writeExternal (_JobOutlineButtonText)); vals.put (FIELD_JobOutlineButtonText, HELPER_JobOutlineButtonText.writeExternal (_JobOutlineButtonText));
vals.put (FIELD_IsGlobalTemplate, HELPER_IsGlobalTemplate.writeExternal (_IsGlobalTemplate)); vals.put (FIELD_IsGlobalTemplate, HELPER_IsGlobalTemplate.writeExternal (_IsGlobalTemplate));
vals.put (FIELD_IsSystemGenerated, HELPER_IsSystemGenerated.writeExternal (_IsSystemGenerated));
vals.put (SINGLEREFERENCE_WithdrawalMessage, _WithdrawalMessage.writeExternalData()); vals.put (SINGLEREFERENCE_WithdrawalMessage, _WithdrawalMessage.writeExternalData());
vals.put (SINGLEREFERENCE_HiringTeam, _HiringTeam.writeExternalData()); vals.put (SINGLEREFERENCE_HiringTeam, _HiringTeam.writeExternalData());
vals.put (MULTIPLEREFERENCE_WorkFlowStages, _WorkFlowStages.writeExternalData()); vals.put (MULTIPLEREFERENCE_WorkFlowStages, _WorkFlowStages.writeExternalData());
...@@ -2958,6 +3099,10 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass ...@@ -2958,6 +3099,10 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
{ {
listener.notifyFieldChange(this, other, FIELD_IsGlobalTemplate, HELPER_IsGlobalTemplate.toObject(this._IsGlobalTemplate), HELPER_IsGlobalTemplate.toObject(otherWorkFlowTemplate._IsGlobalTemplate)); listener.notifyFieldChange(this, other, FIELD_IsGlobalTemplate, HELPER_IsGlobalTemplate.toObject(this._IsGlobalTemplate), HELPER_IsGlobalTemplate.toObject(otherWorkFlowTemplate._IsGlobalTemplate));
} }
if (!HELPER_IsSystemGenerated.compare(this._IsSystemGenerated, otherWorkFlowTemplate._IsSystemGenerated))
{
listener.notifyFieldChange(this, other, FIELD_IsSystemGenerated, HELPER_IsSystemGenerated.toObject(this._IsSystemGenerated), HELPER_IsSystemGenerated.toObject(otherWorkFlowTemplate._IsSystemGenerated));
}
// Compare single assocs // Compare single assocs
_WithdrawalMessage.compare (otherWorkFlowTemplate._WithdrawalMessage, listener); _WithdrawalMessage.compare (otherWorkFlowTemplate._WithdrawalMessage, listener);
...@@ -2997,6 +3142,7 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass ...@@ -2997,6 +3142,7 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
visitor.visitField(this, FIELD_ThankYouSecondaryText, HELPER_ThankYouSecondaryText.toObject(getThankYouSecondaryText())); visitor.visitField(this, FIELD_ThankYouSecondaryText, HELPER_ThankYouSecondaryText.toObject(getThankYouSecondaryText()));
visitor.visitField(this, FIELD_JobOutlineButtonText, HELPER_JobOutlineButtonText.toObject(getJobOutlineButtonText())); visitor.visitField(this, FIELD_JobOutlineButtonText, HELPER_JobOutlineButtonText.toObject(getJobOutlineButtonText()));
visitor.visitField(this, FIELD_IsGlobalTemplate, HELPER_IsGlobalTemplate.toObject(getIsGlobalTemplate())); visitor.visitField(this, FIELD_IsGlobalTemplate, HELPER_IsGlobalTemplate.toObject(getIsGlobalTemplate()));
visitor.visitField(this, FIELD_IsSystemGenerated, HELPER_IsSystemGenerated.toObject(getIsSystemGenerated()));
visitor.visitAssociation (_WithdrawalMessage); visitor.visitAssociation (_WithdrawalMessage);
visitor.visitAssociation (_HiringTeam); visitor.visitAssociation (_HiringTeam);
visitor.visitAssociation (_WorkFlowStages); visitor.visitAssociation (_WorkFlowStages);
...@@ -3102,6 +3248,10 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass ...@@ -3102,6 +3248,10 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
{ {
return filter.matches (getIsGlobalTemplate ()); return filter.matches (getIsGlobalTemplate ());
} }
else if (attribName.equals (FIELD_IsSystemGenerated))
{
return filter.matches (getIsSystemGenerated ());
}
else if (attribName.equals (SINGLEREFERENCE_WithdrawalMessage)) else if (attribName.equals (SINGLEREFERENCE_WithdrawalMessage))
{ {
return filter.matches (getWithdrawalMessage ()); return filter.matches (getWithdrawalMessage ());
...@@ -3218,6 +3368,12 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass ...@@ -3218,6 +3368,12 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
return this; return this;
} }
public SearchAll andIsSystemGenerated (QueryFilter<Boolean> filter)
{
filter.addFilter (context, "tl_work_flow_template.is_system_generated", "IsSystemGenerated");
return this;
}
public SearchAll andWithdrawalMessage (QueryFilter<WorkFlowMessage> filter) public SearchAll andWithdrawalMessage (QueryFilter<WorkFlowMessage> filter)
{ {
filter.addFilter (context, "tl_work_flow_template.withdrawal_message_id", "WithdrawalMessage"); filter.addFilter (context, "tl_work_flow_template.withdrawal_message_id", "WithdrawalMessage");
...@@ -3314,6 +3470,10 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass ...@@ -3314,6 +3470,10 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
{ {
return HELPER_IsGlobalTemplate.toObject (getIsGlobalTemplate ()); return HELPER_IsGlobalTemplate.toObject (getIsGlobalTemplate ());
} }
else if (attribName.equals (FIELD_IsSystemGenerated))
{
return HELPER_IsSystemGenerated.toObject (getIsSystemGenerated ());
}
else else
{ {
return super.getAttribute (attribName); return super.getAttribute (attribName);
...@@ -3379,6 +3539,10 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass ...@@ -3379,6 +3539,10 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
{ {
return HELPER_IsGlobalTemplate; return HELPER_IsGlobalTemplate;
} }
else if (attribName.equals (FIELD_IsSystemGenerated))
{
return HELPER_IsSystemGenerated;
}
else else
{ {
return super.getAttributeHelper (attribName); return super.getAttributeHelper (attribName);
...@@ -3444,6 +3608,10 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass ...@@ -3444,6 +3608,10 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
{ {
setIsGlobalTemplate ((Boolean)(HELPER_IsGlobalTemplate.fromObject (_IsGlobalTemplate, attribValue))); setIsGlobalTemplate ((Boolean)(HELPER_IsGlobalTemplate.fromObject (_IsGlobalTemplate, attribValue)));
} }
else if (attribName.equals (FIELD_IsSystemGenerated))
{
setIsSystemGenerated ((Boolean)(HELPER_IsSystemGenerated.fromObject (_IsSystemGenerated, attribValue)));
}
else else
{ {
super.setAttribute (attribName, attribValue); super.setAttribute (attribName, attribValue);
...@@ -3526,6 +3694,10 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass ...@@ -3526,6 +3694,10 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
{ {
return getWriteability_IsGlobalTemplate (); return getWriteability_IsGlobalTemplate ();
} }
else if (fieldName.equals (FIELD_IsSystemGenerated))
{
return getWriteability_IsSystemGenerated ();
}
else if (fieldName.equals (MULTIPLEREFERENCE_WorkFlowStages)) else if (fieldName.equals (MULTIPLEREFERENCE_WorkFlowStages))
{ {
return getWriteability_WorkFlowStages (); return getWriteability_WorkFlowStages ();
...@@ -3616,6 +3788,11 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass ...@@ -3616,6 +3788,11 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
fields.add (FIELD_IsGlobalTemplate); fields.add (FIELD_IsGlobalTemplate);
} }
if (getWriteability_IsSystemGenerated () != FieldWriteability.TRUE)
{
fields.add (FIELD_IsSystemGenerated);
}
super.putUnwriteable (fields); super.putUnwriteable (fields);
} }
...@@ -3649,6 +3826,7 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass ...@@ -3649,6 +3826,7 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
result.add(HELPER_ThankYouSecondaryText.getAttribObject (getClass (), _ThankYouSecondaryText, false, FIELD_ThankYouSecondaryText)); result.add(HELPER_ThankYouSecondaryText.getAttribObject (getClass (), _ThankYouSecondaryText, false, FIELD_ThankYouSecondaryText));
result.add(HELPER_JobOutlineButtonText.getAttribObject (getClass (), _JobOutlineButtonText, false, FIELD_JobOutlineButtonText)); result.add(HELPER_JobOutlineButtonText.getAttribObject (getClass (), _JobOutlineButtonText, false, FIELD_JobOutlineButtonText));
result.add(HELPER_IsGlobalTemplate.getAttribObject (getClass (), _IsGlobalTemplate, false, FIELD_IsGlobalTemplate)); result.add(HELPER_IsGlobalTemplate.getAttribObject (getClass (), _IsGlobalTemplate, false, FIELD_IsGlobalTemplate));
result.add(HELPER_IsSystemGenerated.getAttribObject (getClass (), _IsSystemGenerated, false, FIELD_IsSystemGenerated));
return result; return result;
} }
...@@ -3940,6 +4118,24 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass ...@@ -3940,6 +4118,24 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
return newIsGlobalTemplate; return newIsGlobalTemplate;
} }
/**
* Get the attribute IsSystemGenerated
*/
public Boolean getIsSystemGenerated (WorkFlowTemplate obj, Boolean original)
{
return original;
}
/**
* Change the value set for attribute IsSystemGenerated.
* May modify the field beforehand
* Occurs before validation.
*/
public Boolean setIsSystemGenerated (WorkFlowTemplate obj, Boolean newIsSystemGenerated) throws FieldException
{
return newIsSystemGenerated;
}
} }
@Override @Override
...@@ -4058,6 +4254,10 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass ...@@ -4058,6 +4254,10 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
{ {
return toIsGlobalTemplate (); return toIsGlobalTemplate ();
} }
if (name.equals ("IsSystemGenerated"))
{
return toIsSystemGenerated ();
}
if (name.equals ("WithdrawalMessage")) if (name.equals ("WithdrawalMessage"))
{ {
return toWithdrawalMessage (); return toWithdrawalMessage ();
...@@ -4101,6 +4301,8 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass ...@@ -4101,6 +4301,8 @@ public abstract class BaseWorkFlowTemplate extends BaseBusinessClass
public PipeLine<From, Boolean> toIsGlobalTemplate () { return pipe(new ORMAttributePipe<Me, Boolean>(FIELD_IsGlobalTemplate)); } public PipeLine<From, Boolean> toIsGlobalTemplate () { return pipe(new ORMAttributePipe<Me, Boolean>(FIELD_IsGlobalTemplate)); }
public PipeLine<From, Boolean> toIsSystemGenerated () { return pipe(new ORMAttributePipe<Me, Boolean>(FIELD_IsSystemGenerated)); }
public WorkFlowMessage.WorkFlowMessagePipeLineFactory<From, WorkFlowMessage> toWithdrawalMessage () { return toWithdrawalMessage (Filter.ALL); } public WorkFlowMessage.WorkFlowMessagePipeLineFactory<From, WorkFlowMessage> toWithdrawalMessage () { return toWithdrawalMessage (Filter.ALL); }
public WorkFlowMessage.WorkFlowMessagePipeLineFactory<From, WorkFlowMessage> toWithdrawalMessage (Filter<WorkFlowMessage> filter) public WorkFlowMessage.WorkFlowMessagePipeLineFactory<From, WorkFlowMessage> toWithdrawalMessage (Filter<WorkFlowMessage> filter)
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
<ATTRIB name="MessageContent" type="String" dbcol="message_content" mandatory="true" /> <ATTRIB name="MessageContent" type="String" dbcol="message_content" mandatory="true" />
<ATTRIB name="TemplateType" type="TemplateType" dbcol="template_type" attribHelper="EnumeratedAttributeHelper" mandatory="false"/> <ATTRIB name="TemplateType" type="TemplateType" dbcol="template_type" attribHelper="EnumeratedAttributeHelper" mandatory="false"/>
<ATTRIB name="IsGlobalTemplate" type="Boolean" dbcol="is_global_template" mandatory="false"/> <ATTRIB name="IsGlobalTemplate" type="Boolean" dbcol="is_global_template" mandatory="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"/> <SINGLEREFERENCE name="HiringTeam" type="HiringTeam" dbcol="hiring_team_id" backreferenceName="MessageTemplates" mandatory="false"/>
......
...@@ -39,6 +39,7 @@ public class MessageTemplatePersistenceMgr extends ObjectPersistenceMgr ...@@ -39,6 +39,7 @@ public class MessageTemplatePersistenceMgr extends ObjectPersistenceMgr
private String dummyMessageContent; private String dummyMessageContent;
private TemplateType dummyTemplateType; private TemplateType dummyTemplateType;
private Boolean dummyIsGlobalTemplate; private Boolean dummyIsGlobalTemplate;
private Boolean dummyIsSystemGenerated;
// Static constants corresponding to attribute helpers // Static constants corresponding to attribute helpers
...@@ -53,6 +54,7 @@ public class MessageTemplatePersistenceMgr extends ObjectPersistenceMgr ...@@ -53,6 +54,7 @@ public class MessageTemplatePersistenceMgr extends ObjectPersistenceMgr
private static final DefaultAttributeHelper HELPER_MessageContent = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper HELPER_MessageContent = DefaultAttributeHelper.INSTANCE;
private static final EnumeratedAttributeHelper HELPER_TemplateType = new EnumeratedAttributeHelper (TemplateType.FACTORY_TemplateType); private static final EnumeratedAttributeHelper HELPER_TemplateType = new EnumeratedAttributeHelper (TemplateType.FACTORY_TemplateType);
private static final DefaultAttributeHelper HELPER_IsGlobalTemplate = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper HELPER_IsGlobalTemplate = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_IsSystemGenerated = DefaultAttributeHelper.INSTANCE;
...@@ -70,10 +72,11 @@ public class MessageTemplatePersistenceMgr extends ObjectPersistenceMgr ...@@ -70,10 +72,11 @@ public class MessageTemplatePersistenceMgr extends ObjectPersistenceMgr
dummyMessageContent = (String)(HELPER_MessageContent.initialise (dummyMessageContent)); dummyMessageContent = (String)(HELPER_MessageContent.initialise (dummyMessageContent));
dummyTemplateType = (TemplateType)(HELPER_TemplateType.initialise (dummyTemplateType)); dummyTemplateType = (TemplateType)(HELPER_TemplateType.initialise (dummyTemplateType));
dummyIsGlobalTemplate = (Boolean)(HELPER_IsGlobalTemplate.initialise (dummyIsGlobalTemplate)); dummyIsGlobalTemplate = (Boolean)(HELPER_IsGlobalTemplate.initialise (dummyIsGlobalTemplate));
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.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.is_global_template, {PREFIX}tl_message_template.is_system_generated, {PREFIX}tl_message_template.hiring_team_id, 1 AS commasafe ";
private String SELECT_JOINS = ""; private String SELECT_JOINS = "";
public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
...@@ -135,6 +138,7 @@ public class MessageTemplatePersistenceMgr extends ObjectPersistenceMgr ...@@ -135,6 +138,7 @@ public class MessageTemplatePersistenceMgr extends ObjectPersistenceMgr
!tl_message_templatePSet.containsAttrib(MessageTemplate.FIELD_MessageContent)|| !tl_message_templatePSet.containsAttrib(MessageTemplate.FIELD_MessageContent)||
!tl_message_templatePSet.containsAttrib(MessageTemplate.FIELD_TemplateType)|| !tl_message_templatePSet.containsAttrib(MessageTemplate.FIELD_TemplateType)||
!tl_message_templatePSet.containsAttrib(MessageTemplate.FIELD_IsGlobalTemplate)|| !tl_message_templatePSet.containsAttrib(MessageTemplate.FIELD_IsGlobalTemplate)||
!tl_message_templatePSet.containsAttrib(MessageTemplate.FIELD_IsSystemGenerated)||
!tl_message_templatePSet.containsAttrib(MessageTemplate.SINGLEREFERENCE_HiringTeam)) !tl_message_templatePSet.containsAttrib(MessageTemplate.SINGLEREFERENCE_HiringTeam))
{ {
// We will need to retrieve it // We will need to retrieve it
...@@ -215,10 +219,10 @@ public class MessageTemplatePersistenceMgr extends ObjectPersistenceMgr ...@@ -215,10 +219,10 @@ public class MessageTemplatePersistenceMgr extends ObjectPersistenceMgr
{ {
int rowsUpdated = executeStatement (sqlMgr, int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}tl_message_template " + "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 = ?, 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 = ?, is_global_template = ?, 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 ()) + " ", "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 (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_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());
if (rowsUpdated != 1) if (rowsUpdated != 1)
{ {
...@@ -485,6 +489,7 @@ public class MessageTemplatePersistenceMgr extends ObjectPersistenceMgr ...@@ -485,6 +489,7 @@ public class MessageTemplatePersistenceMgr extends ObjectPersistenceMgr
tl_message_templatePSet.setAttrib(MessageTemplate.FIELD_MessageContent, HELPER_MessageContent.getFromRS(dummyMessageContent, r, "message_content")); 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_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_IsGlobalTemplate, HELPER_IsGlobalTemplate.getFromRS(dummyIsGlobalTemplate, r, "is_global_template"));
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")); tl_message_templatePSet.setAttrib(MessageTemplate.SINGLEREFERENCE_HiringTeam, r.getObject ("hiring_team_id"));
...@@ -503,10 +508,10 @@ public class MessageTemplatePersistenceMgr extends ObjectPersistenceMgr ...@@ -503,10 +508,10 @@ public class MessageTemplatePersistenceMgr extends ObjectPersistenceMgr
{ {
executeStatement (sqlMgr, executeStatement (sqlMgr,
"INSERT INTO {PREFIX}tl_message_template " + "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, 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, is_global_template, is_system_generated, hiring_team_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
"VALUES " + "VALUES " +
" (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")", " (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, " + 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 (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_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());
tl_message_templatePSet.setStatus (PersistentSetStatus.PROCESSED); tl_message_templatePSet.setStatus (PersistentSetStatus.PROCESSED);
} }
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<ATTRIB name="Delay" type="String" dbcol="delay" mandatory="false"/> <ATTRIB name="Delay" type="String" dbcol="delay" mandatory="false"/>
<ATTRIB name="Variance" type="String" dbcol="variance" mandatory="false"/> <ATTRIB name="Variance" type="String" dbcol="variance" mandatory="false"/>
<ATTRIB name="BusinessHoursOnly" type="Boolean" dbcol="business_hours_only" 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="IsWithdrawalMessage" type="Boolean" dbcol="is_withdrawal_message" mandatory="false"/>
<SINGLEREFERENCE name="MessageTemplate" type="MessageTemplate" dbcol="message_template_id" /> <SINGLEREFERENCE name="MessageTemplate" type="MessageTemplate" dbcol="message_template_id" />
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
<ATTRIB name="ThankYouSecondaryText" type="String" dbcol="thank_you_secondary_text" mandatory="false" defaultValue='"We will get in touch with you soon"'/> <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="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="IsGlobalTemplate" type="Boolean" dbcol="is_global_template" mandatory="false"/>
<ATTRIB name="IsSystemGenerated" type="Boolean" dbcol="is_system_generated" mandatory="false" defaultValue="Boolean.FALSE"/>
<SINGLEREFERENCE name="WithdrawalMessage" type="WorkFlowMessage" dbcol="withdrawal_message_id" /> <SINGLEREFERENCE name="WithdrawalMessage" type="WorkFlowMessage" dbcol="withdrawal_message_id" />
<SINGLEREFERENCE name="HiringTeam" type="HiringTeam" dbcol="hiring_team_id" backreferenceName="WorkFlowTemplates" mandatory="false"/> <SINGLEREFERENCE name="HiringTeam" type="HiringTeam" dbcol="hiring_team_id" backreferenceName="WorkFlowTemplates" mandatory="false"/>
......
...@@ -40,6 +40,7 @@ public class WorkFlowTemplatePersistenceMgr extends ObjectPersistenceMgr ...@@ -40,6 +40,7 @@ public class WorkFlowTemplatePersistenceMgr extends ObjectPersistenceMgr
private String dummyThankYouSecondaryText; private String dummyThankYouSecondaryText;
private String dummyJobOutlineButtonText; private String dummyJobOutlineButtonText;
private Boolean dummyIsGlobalTemplate; private Boolean dummyIsGlobalTemplate;
private Boolean dummyIsSystemGenerated;
// Static constants corresponding to attribute helpers // Static constants corresponding to attribute helpers
...@@ -56,6 +57,7 @@ public class WorkFlowTemplatePersistenceMgr extends ObjectPersistenceMgr ...@@ -56,6 +57,7 @@ public class WorkFlowTemplatePersistenceMgr extends ObjectPersistenceMgr
private static final DefaultAttributeHelper HELPER_ThankYouSecondaryText = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper HELPER_ThankYouSecondaryText = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_JobOutlineButtonText = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper HELPER_JobOutlineButtonText = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_IsGlobalTemplate = DefaultAttributeHelper.INSTANCE; private static final DefaultAttributeHelper HELPER_IsGlobalTemplate = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_IsSystemGenerated = DefaultAttributeHelper.INSTANCE;
...@@ -75,10 +77,11 @@ public class WorkFlowTemplatePersistenceMgr extends ObjectPersistenceMgr ...@@ -75,10 +77,11 @@ public class WorkFlowTemplatePersistenceMgr extends ObjectPersistenceMgr
dummyThankYouSecondaryText = (String)(HELPER_ThankYouSecondaryText.initialise (dummyThankYouSecondaryText)); dummyThankYouSecondaryText = (String)(HELPER_ThankYouSecondaryText.initialise (dummyThankYouSecondaryText));
dummyJobOutlineButtonText = (String)(HELPER_JobOutlineButtonText.initialise (dummyJobOutlineButtonText)); dummyJobOutlineButtonText = (String)(HELPER_JobOutlineButtonText.initialise (dummyJobOutlineButtonText));
dummyIsGlobalTemplate = (Boolean)(HELPER_IsGlobalTemplate.initialise (dummyIsGlobalTemplate)); dummyIsGlobalTemplate = (Boolean)(HELPER_IsGlobalTemplate.initialise (dummyIsGlobalTemplate));
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.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.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_JOINS = ""; private String SELECT_JOINS = "";
public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
...@@ -142,6 +145,7 @@ public class WorkFlowTemplatePersistenceMgr extends ObjectPersistenceMgr ...@@ -142,6 +145,7 @@ public class WorkFlowTemplatePersistenceMgr extends ObjectPersistenceMgr
!tl_work_flow_templatePSet.containsAttrib(WorkFlowTemplate.FIELD_ThankYouSecondaryText)|| !tl_work_flow_templatePSet.containsAttrib(WorkFlowTemplate.FIELD_ThankYouSecondaryText)||
!tl_work_flow_templatePSet.containsAttrib(WorkFlowTemplate.FIELD_JobOutlineButtonText)|| !tl_work_flow_templatePSet.containsAttrib(WorkFlowTemplate.FIELD_JobOutlineButtonText)||
!tl_work_flow_templatePSet.containsAttrib(WorkFlowTemplate.FIELD_IsGlobalTemplate)|| !tl_work_flow_templatePSet.containsAttrib(WorkFlowTemplate.FIELD_IsGlobalTemplate)||
!tl_work_flow_templatePSet.containsAttrib(WorkFlowTemplate.FIELD_IsSystemGenerated)||
!tl_work_flow_templatePSet.containsAttrib(WorkFlowTemplate.SINGLEREFERENCE_WithdrawalMessage)|| !tl_work_flow_templatePSet.containsAttrib(WorkFlowTemplate.SINGLEREFERENCE_WithdrawalMessage)||
!tl_work_flow_templatePSet.containsAttrib(WorkFlowTemplate.SINGLEREFERENCE_HiringTeam)) !tl_work_flow_templatePSet.containsAttrib(WorkFlowTemplate.SINGLEREFERENCE_HiringTeam))
{ {
...@@ -223,10 +227,10 @@ public class WorkFlowTemplatePersistenceMgr extends ObjectPersistenceMgr ...@@ -223,10 +227,10 @@ public class WorkFlowTemplatePersistenceMgr extends ObjectPersistenceMgr
{ {
int rowsUpdated = executeStatement (sqlMgr, int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}tl_work_flow_template " + "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 = ?, 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 = ?, is_global_template = ?, 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 ()) + " ", "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 (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_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());
if (rowsUpdated != 1) if (rowsUpdated != 1)
{ {
...@@ -495,6 +499,7 @@ public class WorkFlowTemplatePersistenceMgr extends ObjectPersistenceMgr ...@@ -495,6 +499,7 @@ public class WorkFlowTemplatePersistenceMgr extends ObjectPersistenceMgr
tl_work_flow_templatePSet.setAttrib(WorkFlowTemplate.FIELD_ThankYouSecondaryText, HELPER_ThankYouSecondaryText.getFromRS(dummyThankYouSecondaryText, r, "thank_you_secondary_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_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_IsGlobalTemplate, HELPER_IsGlobalTemplate.getFromRS(dummyIsGlobalTemplate, r, "is_global_template"));
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")); tl_work_flow_templatePSet.setAttrib(WorkFlowTemplate.SINGLEREFERENCE_WithdrawalMessage, r.getObject ("withdrawal_message_id"));
tl_work_flow_templatePSet.setAttrib(WorkFlowTemplate.SINGLEREFERENCE_HiringTeam, r.getObject ("hiring_team_id")); tl_work_flow_templatePSet.setAttrib(WorkFlowTemplate.SINGLEREFERENCE_HiringTeam, r.getObject ("hiring_team_id"));
...@@ -514,10 +519,10 @@ public class WorkFlowTemplatePersistenceMgr extends ObjectPersistenceMgr ...@@ -514,10 +519,10 @@ public class WorkFlowTemplatePersistenceMgr extends ObjectPersistenceMgr
{ {
executeStatement (sqlMgr, executeStatement (sqlMgr,
"INSERT INTO {PREFIX}tl_work_flow_template " + "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, 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, is_global_template, is_system_generated, withdrawal_message_id, hiring_team_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
"VALUES " + "VALUES " +
" (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")", " (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, " + 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 (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_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());
tl_work_flow_templatePSet.setStatus (PersistentSetStatus.PROCESSED); tl_work_flow_templatePSet.setStatus (PersistentSetStatus.PROCESSED);
} }
......
...@@ -41,14 +41,14 @@ public class StageType extends AbstractEnumerated ...@@ -41,14 +41,14 @@ public class StageType extends AbstractEnumerated
public static final StageType DIVERSITY = new StageType ("DIVERSITY", "DIVERSITY", "Diversity", false); public static final StageType DIVERSITY = new StageType ("DIVERSITY", "DIVERSITY", "Diversity", false);
public static final StageType SUCCESSFULL = new StageType ("SUCCESSFULL", "SUCCESSFULL", "Successfull", false); public static final StageType SUCCESSFUL = new StageType ("SUCCESSFUL", "SUCCESSFUL", "Successful", false);
public static final StageType UNSUITABLE = new StageType ("UNSUITABLE", "UNSUITABLE", "Unsuitable", false); public static final StageType UNSUITABLE = new StageType ("UNSUITABLE", "UNSUITABLE", "Unsuitable", false);
public static final StageType WITHDREW = new StageType ("WITHDREW", "WITHDREW", "Withdrew", false); public static final StageType WITHDREW = new StageType ("WITHDREW", "WITHDREW", "Withdrew", false);
private static final StageType[] allStageTypes = private static final StageType[] allStageTypes =
new StageType[] { POST_INGEST,INCOMPLETE,REFERENCE_CHECK,SCREENING_CHECK,VIDEO_INTERVIEW,INTERVIEW,REQUIREMENT_FIT,CULTURE_FIT,ROLE_FIT,DIVERSITY,SUCCESSFULL,UNSUITABLE,WITHDREW}; new StageType[] { POST_INGEST,INCOMPLETE,REFERENCE_CHECK,SCREENING_CHECK,VIDEO_INTERVIEW,INTERVIEW,REQUIREMENT_FIT,CULTURE_FIT,ROLE_FIT,DIVERSITY,SUCCESSFUL,UNSUITABLE,WITHDREW};
private static StageType[] getAllStageTypes () private static StageType[] getAllStageTypes ()
...@@ -162,8 +162,8 @@ public class StageType extends AbstractEnumerated ...@@ -162,8 +162,8 @@ public class StageType extends AbstractEnumerated
ROLE_FIT.IsPostStage = Boolean.FALSE; ROLE_FIT.IsPostStage = Boolean.FALSE;
DIVERSITY.IsPreStage = Boolean.FALSE; DIVERSITY.IsPreStage = Boolean.FALSE;
DIVERSITY.IsPostStage = Boolean.FALSE; DIVERSITY.IsPostStage = Boolean.FALSE;
SUCCESSFULL.IsPreStage = Boolean.FALSE; SUCCESSFUL.IsPreStage = Boolean.FALSE;
SUCCESSFULL.IsPostStage = Boolean.TRUE; SUCCESSFUL.IsPostStage = Boolean.TRUE;
UNSUITABLE.IsPreStage = Boolean.FALSE; UNSUITABLE.IsPreStage = Boolean.FALSE;
UNSUITABLE.IsPostStage = Boolean.TRUE; UNSUITABLE.IsPostStage = Boolean.TRUE;
WITHDREW.IsPreStage = Boolean.FALSE; WITHDREW.IsPreStage = Boolean.FALSE;
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<VALUE name="CULTURE_FIT" description="Culture 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="ROLE_FIT" description="Role Fit" IsPreStage="Boolean.FALSE" IsPostStage="Boolean.FALSE"/>
<VALUE name="DIVERSITY" description="Diversity" IsPreStage="Boolean.FALSE" IsPostStage="Boolean.FALSE"/> <VALUE name="DIVERSITY" description="Diversity" IsPreStage="Boolean.FALSE" IsPostStage="Boolean.FALSE"/>
<VALUE name="SUCCESSFULL" description="Successfull" IsPreStage="Boolean.FALSE" IsPostStage="Boolean.TRUE"/> <VALUE name="SUCCESSFUL" description="Successful" IsPreStage="Boolean.FALSE" IsPostStage="Boolean.TRUE"/>
<VALUE name="UNSUITABLE" description="Unsuitable" 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"/> <VALUE name="WITHDREW" description="Withdrew" IsPreStage="Boolean.FALSE" IsPostStage="Boolean.TRUE"/>
......
package performa.utils;
import java.util.Arrays;
import java.util.Collection;
import oneit.objstore.ObjectTransaction;
import oneit.objstore.StorageException;
import oneit.objstore.rdbms.filters.EqualsFilter;
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.Job;
import performa.orm.JobApplication;
import performa.orm.MessageTemplate;
import performa.orm.WorkFlow;
import performa.orm.WorkFlowMessage;
import performa.orm.WorkFlowStage;
import performa.orm.WorkFlowTemplate;
import performa.orm.types.ApplicationStatus;
import performa.orm.types.StageType;
public class WorkflowDataMigration
{
public static void main (final String[] args) throws Exception
{
TransactionServices.run(new TransactionTask() {
@Override
public void run(ObjectTransaction objTran) throws FieldException, StorageException
{
try
{
Job[] jobs = Job.searchAll(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)
{
WorkFlowTemplate wfTemplate = WorkFlowTemplate.createWorkFlowTemplate(objTran);
wfTemplate.setTemplateName(job.getJobTitle());
wfTemplate.setIsSystemGenerated(Boolean.TRUE);
wfTemplate.setHiringTeam(job.getHiringTeam());
wfTemplate.addToJobs(job);
int sortOrder = 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);
}
if(job.getDiversityIncluded())
{
createWorkFlowStage(objTran, wfTemplate, "Diversity", StageType.DIVERSITY, sortOrder++);
}
if(job.getIncludeAssessmentCriteria())
{
createWorkFlowStage(objTran, wfTemplate, "Requirements", StageType.REQUIREMENT_FIT, sortOrder++);
}
if(job.getIncludeCulture())
{
createWorkFlowStage(objTran, wfTemplate, "Culture Fit", StageType.CULTURE_FIT, sortOrder++);
}
createWorkFlowStage(objTran, wfTemplate, "Role Fit", StageType.ROLE_FIT, sortOrder++);
for(WorkFlow workFlow : job.getWorkFlowsSet())
{
if(workFlow.getApplicationStatus() == ApplicationStatus.DRAFT || workFlow.getApplicationStatus() == ApplicationStatus.UNSUITABLE)
{
continue;
}
createWorkFlowStage(objTran, wfTemplate, workFlow.getName(), getStageTypeByStatus(workFlow.getApplicationStatus()), sortOrder++);
}
createWorkFlowStage(objTran, wfTemplate, "Successful", StageType.SUCCESSFUL, sortOrder++);
createWorkFlowStage(objTran, wfTemplate, "Withdrew", StageType.WITHDREW, sortOrder++);
createWorkFlowStage(objTran, wfTemplate, "Unsuitable", StageType.UNSUITABLE, sortOrder++);
// TODO: might have to move to another transaction
for(JobApplication jobApplication : job.getJobApplicationsSet())
{
jobApplication.setWorkFlowStage(getWFStageByStatus(wfTemplate, jobApplication.getApplicationStatus()));
}
}
}
catch (Exception e)
{
throw new NestedException(e);
}
}
private void createWorkFlowMessage(ObjectTransaction objTran, WorkFlowStage stage, MessageTemplate mTemplate) throws StorageException, FieldException
{
WorkFlowMessage wfMessage = WorkFlowMessage.createWorkFlowMessage(objTran);
wfMessage.setWorkFlowStage(stage);
wfMessage.setBusinessHoursOnly(mTemplate.getBusinessHoursOnly());
wfMessage.setMessageTemplate(mTemplate);
wfMessage.setDelay(getDelay(mTemplate));
wfMessage.setVariance(mTemplate.getVariance().toString() + "m");
}
private WorkFlowStage createWorkFlowStage(ObjectTransaction objTran, WorkFlowTemplate wfTemplate, String name, StageType stageType, int sortOrder) throws FieldException, StorageException
{
WorkFlowStage wfStage = WorkFlowStage.createWorkFlowStage(objTran);
wfStage.setWorkFlowTemplate(wfTemplate);
wfStage.setName(name);
wfStage.setStageType(stageType);
return wfStage;
}
});
}
private static String getDelay(MessageTemplate mTemplate)
{
StringBuilder sb = new StringBuilder();
sb.append((int)(mTemplate.getDelayHrs()/24)).append("d:");
sb.append(mTemplate.getDelayHrs()%24).append("h:");
sb.append(mTemplate.getDelayMin()).append("m");
return sb.toString();
}
public static StageType getStageTypeByStatus(ApplicationStatus status)
{
if(status == ApplicationStatus.POST_INGEST)
{
return StageType.POST_INGEST;
}
else if(status == ApplicationStatus.DRAFT)
{
return StageType.INCOMPLETE;
}
else if(status == ApplicationStatus.UNSUITABLE)
{
return StageType.UNSUITABLE;
}
// TODO: map other statuses
return null;
}
public static WorkFlowStage getWFStageByStatus(WorkFlowTemplate template , ApplicationStatus status)
{
if(status == ApplicationStatus.POST_INGEST)
{
return getWFStage(template, StageType.POST_INGEST);
}
else if(status == ApplicationStatus.DRAFT)
{
return getWFStage(template, StageType.INCOMPLETE);
}
else if(status == ApplicationStatus.UNSUITABLE)
{
return getWFStage(template, StageType.UNSUITABLE);
}
// TODO: map other statuses
return null;
}
private static WorkFlowStage getWFStage(WorkFlowTemplate template, StageType stageType)
{
return template.pipelineWorkFlowTemplate().toWorkFlowStages(WorkFlowStage.SearchByAll().andStageType(new EqualsFilter<>(stageType))).val();
}
}
\ No newline at end of file
UPDATE tl_message_template SET is_system_generated = 'Y' WHERE is_system_generated IS NULL;
\ No newline at end of file
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