Commit 1dffa8ed by nilu

S51619299 # Client - Incoming Issues #Messaging & Workflow Changes

parent 86c0ff1e
......@@ -16,6 +16,7 @@
<column name="prefer_remote" type="Boolean" nullable="true"/>
<column name="happy_to_relocate" type="Boolean" nullable="true"/>
<column name="is_email_ingest" type="Boolean" nullable="true"/>
<column name="applicant_source" type="String" nullable="true" length="200"/>
<column name="candidate_id" type="Long" length="11" nullable="false"/>
<column name="job_id" type="Long" length="11" nullable="false"/>
<column name="work_flow_stage_id" type="Long" length="11" nullable="true"/>
......
......@@ -18,7 +18,7 @@
<column name="business_hours_only" type="Boolean" nullable="true"/>
<column name="message_content" type="CLOB" nullable="false"/>
<column name="template_type" type="String" nullable="false" length="200"/>
<column name="is_global_template" type="Boolean" nullable="true"/>
<column name="related_to_job" type="Boolean" nullable="true"/>
<column name="is_system_generated" type="Boolean" nullable="true"/>
<column name="hiring_team_id" type="Long" length="11" nullable="true"/>
</NODE>
......
......@@ -12,6 +12,7 @@
<column name="variance" type="CLOB" nullable="true"/>
<column name="business_hours_only" type="Boolean" nullable="true"/>
<column name="is_withdrawal_message" type="Boolean" nullable="true"/>
<column name="applicant_sources" type="CLOB" nullable="true"/>
<column name="message_template_id" type="Long" length="11" nullable="true"/>
<column name="work_flow_stage_id" type="Long" length="11" nullable="true"/>
</NODE>
......
......@@ -12,6 +12,7 @@
<column name="use_messaging" type="Boolean" nullable="true"/>
<column name="stage_type" type="String" nullable="false" length="200"/>
<column name="sort_order" type="Long" nullable="false"/>
<column name="auto_progress" type="Boolean" nullable="true"/>
<column name="withdrawal_message_id" type="Long" length="11" nullable="true"/>
<column name="work_flow_template_id" type="Long" length="11" nullable="false"/>
</NODE>
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- @AutoRun -->
<OBJECTS name="" xmlns:oneit="http://www.1iT.com.au"><NODE name="Script" factory="Vector">
<NODE name="DDL" factory="Participant" class="oneit.sql.transfer.DefineTableOperation">
<tableName factory="String">tl_work_flow_step</tableName>
<column name="object_id" type="Long" nullable="false" length="11"/>
<column name="object_last_updated_date" type="Date" nullable="false" length="22"/>
<column name="object_created_date" type="Date" nullable="false" length="22"/>
<column name="sort_order" type="Long" nullable="false"/>
<column name="step_type" type="String" nullable="false" length="200"/>
<column name="work_flow_stage_id" type="Long" length="11" nullable="false"/>
</NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_work_flow_step" indexName="idx_tl_work_flow_step_work_flow_stage_id" isUnique="false"><column name="work_flow_stage_id"/></NODE>
</NODE></OBJECTS>
\ No newline at end of file
......@@ -20,7 +20,7 @@
<column name="thank_you_header_text" type="CLOB" nullable="true"/>
<column name="thank_you_secondary_text" type="CLOB" nullable="true"/>
<column name="job_outline_button_text" type="CLOB" nullable="true"/>
<column name="is_global_template" type="Boolean" nullable="true"/>
<column name="related_to_job" type="Boolean" nullable="true"/>
<column name="is_system_generated" type="Boolean" nullable="true"/>
<column name="withdrawal_message_id" type="Long" length="11" nullable="true"/>
<column name="hiring_team_id" type="Long" length="11" nullable="true"/>
......
......@@ -16,6 +16,7 @@ CREATE TABLE tl_job_application (
prefer_remote char(1) NULL,
happy_to_relocate char(1) NULL,
is_email_ingest char(1) NULL,
applicant_source varchar(200) NULL,
candidate_id numeric(12) NOT NULL,
job_id numeric(12) NOT NULL,
work_flow_stage_id numeric(12) NULL
......
......@@ -18,7 +18,7 @@ CREATE TABLE tl_message_template (
business_hours_only char(1) NULL,
message_content text NOT NULL,
template_type varchar(200) NOT NULL,
is_global_template char(1) NULL,
related_to_job char(1) NULL,
is_system_generated char(1) NULL,
hiring_team_id numeric(12) NULL
);
......
......@@ -12,6 +12,7 @@ CREATE TABLE tl_work_flow_message (
variance text NULL,
business_hours_only char(1) NULL,
is_withdrawal_message char(1) NULL,
applicant_sources varchar(200) NULL,
message_template_id numeric(12) NULL,
work_flow_stage_id numeric(12) NULL
);
......
......@@ -12,6 +12,7 @@ CREATE TABLE tl_work_flow_stage (
use_messaging char(1) NULL,
stage_type varchar(200) NOT NULL,
sort_order numeric(12) NOT NULL,
auto_progress char(1) NULL,
withdrawal_message_id numeric(12) NULL,
work_flow_template_id numeric(12) NOT NULL
);
......
-- DROP TABLE tl_work_flow_step;
CREATE TABLE tl_work_flow_step (
object_id int NOT NULL ,
object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
object_created_date datetime DEFAULT getdate() NOT NULL
,
sort_order numeric(12) NOT NULL,
step_type varchar(200) NOT NULL,
work_flow_stage_id numeric(12) NOT NULL
);
ALTER TABLE tl_work_flow_step ADD
CONSTRAINT PK_tl_work_flow_step PRIMARY KEY
(
object_id
) ;
CREATE INDEX idx_tl_work_flow_step_work_flow_stage_id
ON tl_work_flow_step (work_flow_stage_id);
......@@ -20,7 +20,7 @@ CREATE TABLE tl_work_flow_template (
thank_you_header_text text NULL,
thank_you_secondary_text text NULL,
job_outline_button_text text NULL,
is_global_template char(1) NULL,
related_to_job char(1) NULL,
is_system_generated char(1) NULL,
withdrawal_message_id numeric(12) NULL,
hiring_team_id numeric(12) NULL
......
......@@ -17,6 +17,7 @@ CREATE TABLE tl_job_application (
prefer_remote char(1) NULL,
happy_to_relocate char(1) NULL,
is_email_ingest char(1) NULL,
applicant_source varchar2(200) NULL,
candidate_id number(12) NOT NULL,
job_id number(12) NOT NULL,
work_flow_stage_id number(12) NULL
......
......@@ -19,7 +19,7 @@ CREATE TABLE tl_message_template (
business_hours_only char(1) NULL,
message_content clob NOT NULL,
template_type varchar2(200) NOT NULL,
is_global_template char(1) NULL,
related_to_job char(1) NULL,
is_system_generated char(1) NULL,
hiring_team_id number(12) NULL
);
......
......@@ -13,6 +13,7 @@ CREATE TABLE tl_work_flow_message (
variance clob NULL,
business_hours_only char(1) NULL,
is_withdrawal_message char(1) NULL,
applicant_sources varchar2(200) NULL,
message_template_id number(12) NULL,
work_flow_stage_id number(12) NULL
);
......
......@@ -13,6 +13,7 @@ CREATE TABLE tl_work_flow_stage (
use_messaging char(1) NULL,
stage_type varchar2(200) NOT NULL,
sort_order number(12) NOT NULL,
auto_progress char(1) NULL,
withdrawal_message_id number(12) NULL,
work_flow_template_id number(12) NOT NULL
);
......
-- DROP TABLE tl_work_flow_step;
CREATE TABLE tl_work_flow_step (
object_id number(12) NOT NULL ,
object_last_updated_date date DEFAULT SYSDATE NOT NULL ,
object_created_date date DEFAULT SYSDATE NOT NULL
,
sort_order number(12) NOT NULL,
step_type varchar2(200) NOT NULL,
work_flow_stage_id number(12) NOT NULL
);
ALTER TABLE tl_work_flow_step ADD
CONSTRAINT PK_tl_work_flow_step PRIMARY KEY
(
object_id
) ;
CREATE INDEX idx_tl_work_flow_step_work_flow_stage_id
ON tl_work_flow_step (work_flow_stage_id);
......@@ -21,7 +21,7 @@ CREATE TABLE tl_work_flow_template (
thank_you_header_text clob NULL,
thank_you_secondary_text clob NULL,
job_outline_button_text clob NULL,
is_global_template char(1) NULL,
related_to_job char(1) NULL,
is_system_generated char(1) NULL,
withdrawal_message_id number(12) NULL,
hiring_team_id number(12) NULL
......
......@@ -17,6 +17,7 @@ CREATE TABLE tl_job_application (
prefer_remote char(1) NULL,
happy_to_relocate char(1) NULL,
is_email_ingest char(1) NULL,
applicant_source varchar(200) NULL,
candidate_id numeric(12) NOT NULL,
job_id numeric(12) NOT NULL,
work_flow_stage_id numeric(12) NULL
......
......@@ -19,7 +19,7 @@ CREATE TABLE tl_message_template (
business_hours_only char(1) NULL,
message_content text NOT NULL,
template_type varchar(200) NOT NULL,
is_global_template char(1) NULL,
related_to_job char(1) NULL,
is_system_generated char(1) NULL,
hiring_team_id numeric(12) NULL
);
......
......@@ -13,6 +13,7 @@ CREATE TABLE tl_work_flow_message (
variance text NULL,
business_hours_only char(1) NULL,
is_withdrawal_message char(1) NULL,
applicant_sources varchar(200) NULL,
message_template_id numeric(12) NULL,
work_flow_stage_id numeric(12) NULL
);
......
......@@ -13,6 +13,7 @@ CREATE TABLE tl_work_flow_stage (
use_messaging char(1) NULL,
stage_type varchar(200) NOT NULL,
sort_order numeric(12) NOT NULL,
auto_progress char(1) NULL,
withdrawal_message_id numeric(12) NULL,
work_flow_template_id numeric(12) NOT NULL
);
......
-- @AutoRun
-- drop table tl_work_flow_step;
CREATE TABLE tl_work_flow_step (
object_id numeric(12) NOT NULL ,
object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
object_created_date timestamp DEFAULT NOW() NOT NULL
,
sort_order numeric(12) NOT NULL,
step_type varchar(200) NOT NULL,
work_flow_stage_id numeric(12) NOT NULL
);
ALTER TABLE tl_work_flow_step ADD
CONSTRAINT pk_tl_work_flow_step PRIMARY KEY
(
object_id
) ;
CREATE INDEX idx_tl_work_flow_step_work_flow_stage_id
ON tl_work_flow_step (work_flow_stage_id);
......@@ -21,7 +21,7 @@ CREATE TABLE tl_work_flow_template (
thank_you_header_text text NULL,
thank_you_secondary_text text NULL,
job_outline_button_text text NULL,
is_global_template char(1) NULL,
related_to_job char(1) NULL,
is_system_generated char(1) NULL,
withdrawal_message_id numeric(12) NULL,
hiring_team_id numeric(12) NULL
......
......@@ -28,15 +28,15 @@ public class BulkUpdateFP extends SaveFP
LogMgr.log(JobApplication.LOG, LogLevel.PROCESSING1,"In BulkUpdateFP selected application count : ", applications != null ? applications.size() : 0 , " of job ", job);
if(job.getAppWorkFlowStage()!= null && job.getAppWorkFlowStage().getStageType()== StageType.SUCCESSFUL
&& job.getNoOfCandidatesApplied() > job.getMaxShortlistApplicants() && applications != null)
{
Filter<JobApplication> filter = JobApplication.SearchByStageType().byStageTypesIn(CollectionUtils.createSet(StageType.INTERVIEW));
Collection alreadyShortlisted = CollectionFilter.filter(applications, filter);
int totalShortlisted = applications.size() - alreadyShortlisted.size() + job.getNoOfCandidatesFor(job.getWorkFlowByStageType(StageType.SUCCESSFUL));
BusinessObjectParser.assertFieldCondition(totalShortlisted <= job.getMaxShortlistApplicants() , job , Job.MULTIPLEREFERENCE_JobApplications, "exceedMaxShortlisted");
}
// if(job.getAppWorkFlowStage()!= null && job.getAppWorkFlowStage().getStageType()== StageType.SUCCESSFUL
// && job.getNoOfCandidatesApplied() > job.getMaxShortlistApplicants() && applications != null)
// {
// Filter<JobApplication> filter = JobApplication.SearchByStageType().byStageTypesIn(CollectionUtils.createSet(StageType.INTERVIEW));
// Collection alreadyShortlisted = CollectionFilter.filter(applications, filter);
// int totalShortlisted = applications.size() - alreadyShortlisted.size() + job.getNoOfCandidatesFor(job.getWorkFlowByStageType(StageType.SUCCESSFUL));
//
// BusinessObjectParser.assertFieldCondition(totalShortlisted <= job.getMaxShortlistApplicants() , job , Job.MULTIPLEREFERENCE_JobApplications, "exceedMaxShortlisted");
// }
if(job.getAppWorkFlowStage() != null)
{
......
......@@ -28,7 +28,7 @@ public class AssessmentCriteriaTemplate extends BaseAssessmentCriteriaTemplate
public List<WorkFlowStage> getSortedMiddleWorkFlowStages()
{
Filter<WorkFlowStage> filter = WorkFlowStage.SearchByAll().andStageType(new NotInFilter<>(StageType.POST_INGEST, StageType.INCOMPLETE, StageType.UNSUITABLE, StageType.WITHDREW));
Filter<WorkFlowStage> filter = WorkFlowStage.SearchByAll().andStageType(new NotInFilter<>(StageType.INITIAL, StageType.UNSUITABLE, StageType.WITHDREW));
return ObjstoreUtils.sort(pipesAssessmentCriteriaTemplate().toWorkFlowTemplate().toWorkFlowStages(filter).uniqueVals(),
new ObjectTransform[]{WorkFlowStage.pipesWorkFlowStage().toSortOrder()},
......
......@@ -231,7 +231,7 @@ public class Job extends BaseJob
public int getNoOfCandidatesApplied()
{
Filter<JobApplication> filter = JobApplication.SearchByAll().andWorkFlowStage(new NotInFilter<>(pipelineJob().toWorkFlowTemplate().toWorkFlowStages(WorkFlowStage.SearchByAll().andStageType(new InFilter<>(StageType.INCOMPLETE, StageType.POST_INGEST))).uniqueVals()));
Filter<JobApplication> filter = JobApplication.SearchByAll().andWorkFlowStage(new NotInFilter<>(pipelineJob().toWorkFlowTemplate().toWorkFlowStages(WorkFlowStage.SearchByAll().andStageType(new InFilter<>(StageType.INITIAL))).uniqueVals()));
return pipelineJob().toJobApplications(filter).toCandidate().vals().size();
}
......@@ -247,7 +247,7 @@ public class Job extends BaseJob
public Collection<JobApplication> getSubmittedApplications()
{
Filter<JobApplication> filter = JobApplication.SearchByStageType().byStageTypesNotIn(CollectionUtils.createSet(StageType.INCOMPLETE, StageType.POST_INGEST));
Filter<JobApplication> filter = JobApplication.SearchByStageType().byStageTypesNotIn(CollectionUtils.createSet(StageType.INITIAL));
return CollectionFilter.filter(getJobApplicationsSet(), filter);
}
......@@ -622,7 +622,7 @@ public class Job extends BaseJob
public List<WorkFlowStage> getSortedMiddleStages()
{
Filter<WorkFlowStage> filter = WorkFlowStage.SearchByAll().andStageType(new NotInFilter<>(StageType.POST_INGEST, StageType.INCOMPLETE, StageType.UNSUITABLE, StageType.WITHDREW));
Filter<WorkFlowStage> filter = WorkFlowStage.SearchByAll().andStageType(new NotInFilter<>(StageType.INITIAL, StageType.UNSUITABLE, StageType.WITHDREW));
return ObjstoreUtils.sort(pipelineJob().toWorkFlowTemplate().toWorkFlowStages(filter).uniqueVals(),
new ObjectTransform[]{WorkFlowStage.pipesWorkFlowStage().toSortOrder()},
......@@ -645,13 +645,13 @@ public class Job extends BaseJob
public Set<WorkFlowStage> getIncompleteApplicantStages()
{
Filter<WorkFlowStage> filter = WorkFlowStage.SearchByAll().andStageType(new InFilter<>(StageType.INCOMPLETE, StageType.POST_INGEST, StageType.UNSUITABLE));
Filter<WorkFlowStage> filter = WorkFlowStage.SearchByAll().andStageType(new InFilter<>(StageType.INITIAL, StageType.UNSUITABLE));
return pipelineJob().toWorkFlowTemplate().toWorkFlowStages(filter).uniqueVals();
}
public Set<WorkFlowStage> getApplicantStages()
{
Filter<WorkFlowStage> filter = WorkFlowStage.SearchByAll().andStageType(new NotInFilter<>(StageType.INCOMPLETE, StageType.POST_INGEST));
Filter<WorkFlowStage> filter = WorkFlowStage.SearchByAll().andStageType(new NotInFilter<>(StageType.INITIAL));
return pipelineJob().toWorkFlowTemplate().toWorkFlowStages(filter).uniqueVals();
}
......
......@@ -30,6 +30,7 @@
<ATTRIB name="PreferRemote" type="Boolean" dbcol="prefer_remote" defaultValue="Boolean.FALSE"/>
<ATTRIB name="HappyToRelocate" type="Boolean" dbcol="happy_to_relocate"/>
<ATTRIB name="IsEmailIngest" type="Boolean" dbcol="is_email_ingest" defaultValue="Boolean.FALSE"/>
<ATTRIB name="ApplicantSource" type="ApplicantSource" dbcol="applicant_source" defaultValue="ApplicantSource.APPLY_URL" mandatory="false" attribHelper="EnumeratedAttributeHelper"/>
<SINGLEREFERENCE name="Candidate" type="Candidate" dbcol="candidate_id" backreferenceName="JobApplications" mandatory="true"/>
<SINGLEREFERENCE name="Job" type="Job" dbcol="job_id" backreferenceName="JobApplications" mandatory="true"/>
......
......@@ -16,7 +16,7 @@
<ATTRIB name="BusinessHoursOnly" type="Boolean" dbcol="business_hours_only" mandatory="false" defaultValue="Boolean.FALSE"/>
<ATTRIB name="MessageContent" type="String" dbcol="message_content" mandatory="true" />
<ATTRIB name="TemplateType" type="TemplateType" dbcol="template_type" attribHelper="EnumeratedAttributeHelper" mandatory="true" defaultValue="TemplateType.EMAIL"/>
<ATTRIB name="IsGlobalTemplate" type="Boolean" dbcol="is_global_template" mandatory="false"/>
<ATTRIB name="RelatedToJob" type="Boolean" dbcol="related_to_job" mandatory="false" defaultValue="Boolean.FALSE"/>
<ATTRIB name="IsSystemGenerated" type="Boolean" dbcol="is_system_generated" mandatory="false" defaultValue="Boolean.FALSE"/>
<SINGLEREFERENCE name="HiringTeam" type="HiringTeam" dbcol="hiring_team_id" backreferenceName="MessageTemplates" mandatory="false"/>
......
......@@ -11,6 +11,7 @@
<ATTRIB name="Variance" type="String" dbcol="variance" mandatory="false"/>
<ATTRIB name="BusinessHoursOnly" type="Boolean" dbcol="business_hours_only" mandatory="false" defaultValue="Boolean.FALSE"/>
<ATTRIB name="IsWithdrawalMessage" type="Boolean" dbcol="is_withdrawal_message" mandatory="false"/>
<ATTRIB name="ApplicantSources" type="Set&lt;ApplicantSource&gt;" dbcol="applicant_sources" mandatory="false" attribHelper="DelimitedEnumsAttributeHelper" attribHelperInstance="new DelimitedEnumsAttributeHelper (ApplicantSource.FACTORY_ApplicantSource)"/>
<SINGLEREFERENCE name="MessageTemplate" type="MessageTemplate" dbcol="message_template_id" />
<SINGLEREFERENCE name="WorkFlowStage" type="WorkFlowStage" dbcol="work_flow_stage_id" backreferenceName="WorkFlowMessages" mandatory="false"/>
......
......@@ -6,6 +6,7 @@
<IMPORT value="performa.orm.types.*"/>
<MULTIPLEREFERENCE name="WorkFlowMessages" type="WorkFlowMessage" backreferenceName="WorkFlowStage" />
<MULTIPLEREFERENCE name="Steps" type="WorkFlowStep" backreferenceName="WorkFlowStage" />
<TABLE name="tl_work_flow_stage" tablePrefix="object" polymorphic="FALSE">
......@@ -13,6 +14,7 @@
<ATTRIB name="UseMessaging" type="Boolean" dbcol="use_messaging" mandatory="false" defaultValue="Boolean.FALSE"/>
<ATTRIB name="StageType" type="StageType" dbcol="stage_type" attribHelper="EnumeratedAttributeHelper" mandatory="true"/>
<ATTRIB name="SortOrder" type="Integer" dbcol="sort_order" mandatory="true"/>
<ATTRIB name="AutoProgress" type="Boolean" dbcol="auto_progress" mandatory="false" defaultValue="Boolean.FALSE"/>
<SINGLEREFERENCE name="WithdrawalMessage" type="WorkFlowMessage" dbcol="withdrawal_message_id" />
<SINGLEREFERENCE name="WorkFlowTemplate" type="WorkFlowTemplate" dbcol="work_flow_template_id" backreferenceName="WorkFlowStages" mandatory="true"/>
......
package performa.orm;
import java.io.*;
import java.util.*;
import oneit.appservices.config.*;
import oneit.logging.*;
import oneit.objstore.*;
import oneit.utils.*;
import performa.orm.types.*;
public class WorkFlowStep extends BaseWorkFlowStep
{
private static final long serialVersionUID = 0L;
// This constructor should not be called
public WorkFlowStep ()
{
// Do not add any code to this, always put it in initialiseNewObject
}
}
<?xml version="1.0" encoding="UTF-8"?>
<ROOT xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='http://www.oneit.com.au/schemas/5.2/BusinessObject.xsd'>
<BUSINESSCLASS name="WorkFlowStep" package="performa.orm">
<IMPORT value="performa.orm.types.*"/>
<TABLE name="tl_work_flow_step" tablePrefix="object" polymorphic="FALSE">
<ATTRIB name="SortOrder" type="Integer" dbcol="sort_order" mandatory="true"/>
<ATTRIB name="StepType" type="StepType" dbcol="step_type" mandatory="true" attribHelper="EnumeratedAttributeHelper"/>
<SINGLEREFERENCE name="WorkFlowStage" type="WorkFlowStage" dbcol="work_flow_stage_id" backreferenceName="Steps" mandatory="true"/>
</TABLE>
<SEARCH type="All" paramFilter="tl_work_flow_step.object_id is not null" orderBy="tl_work_flow_step.object_id" />
</BUSINESSCLASS>
</ROOT>
\ No newline at end of file
......@@ -22,7 +22,7 @@
<ATTRIB name="ThankYouHeaderText" type="String" dbcol="thank_you_header_text" mandatory="false" defaultValue='"Thank You for your application to&#58;"'/>
<ATTRIB name="ThankYouSecondaryText" type="String" dbcol="thank_you_secondary_text" mandatory="false" defaultValue='"We will get in touch with you soon"'/>
<ATTRIB name="JobOutlineButtonText" type="String" dbcol="job_outline_button_text" mandatory="false" defaultValue='"Continue"'/>
<ATTRIB name="IsGlobalTemplate" type="Boolean" dbcol="is_global_template" mandatory="false"/>
<ATTRIB name="RelatedToJob" type="Boolean" dbcol="related_to_job" mandatory="false" defaultValue="Boolean.FALSE"/>
<ATTRIB name="IsSystemGenerated" type="Boolean" dbcol="is_system_generated" mandatory="false" defaultValue="Boolean.FALSE"/>
<SINGLEREFERENCE name="WithdrawalMessage" type="WorkFlowMessage" dbcol="withdrawal_message_id" />
......
package performa.orm.types;
import java.util.*;
import oneit.utils.*;
import oneit.utils.transform.*;
/**
* This class was generated using constGen.bat.
* DO NOT MODIFY THIS CODE.
* Edit the associated .xml file, and regenerate this file
* constGen (directory) (file minus extension)
* e.g. constGen C:\...\sql FieldType
*/
public class ApplicantSource extends AbstractEnumerated
{
public static final EnumeratedFactory FACTORY_ApplicantSource = new ApplicantSourceFactory();
public static final ApplicantSource INGEST = new ApplicantSource ("INGEST", "INGEST", "Ingest", false);
public static final ApplicantSource ATS = new ApplicantSource ("ATS", "ATS", "ATS", false);
public static final ApplicantSource APPLY_URL = new ApplicantSource ("APPLY_URL", "APPLY_URL", "Apply URL", false);
private static final ApplicantSource[] allApplicantSources =
new ApplicantSource[] { INGEST,ATS,APPLY_URL};
private static ApplicantSource[] getAllApplicantSources ()
{
return allApplicantSources;
}
private ApplicantSource (String name, String value, String description, boolean disabled)
{
super (name, value, description, disabled);
}
public static final Comparator COMPARE_BY_POSITION = new CompareEnumByPosition (allApplicantSources);
static
{
defineAdditionalData ();
}
public boolean isEqual (ApplicantSource other)
{
return this.name.equals (other.name);
}
public Enumeration getAllInstances ()
{
return ApplicantSource.getAll ();
}
private Object readResolve() throws java.io.ObjectStreamException
{
return ApplicantSource.forName (this.name);
}
public EnumeratedFactory getFactory ()
{
return FACTORY_ApplicantSource;
}
public static ApplicantSource forName (String name)
{
if (name == null) { return null; }
ApplicantSource[] all = getAllApplicantSources();
int enumIndex = AbstractEnumerated.getIndexForName (all, name);
return all[enumIndex];
}
public static ApplicantSource forValue (String value)
{
if (value == null) { return null; }
ApplicantSource[] all = getAllApplicantSources();
int enumIndex = AbstractEnumerated.getIndexForValue (getAllApplicantSources (), value);
return all[enumIndex];
}
public static java.util.Enumeration getAll ()
{
return AbstractEnumerated.getAll (getAllApplicantSources());
}
public static ApplicantSource[] getApplicantSourceArray ()
{
return (ApplicantSource[])getAllApplicantSources().clone ();
}
public static void defineAdditionalData ()
{
}
static class ApplicantSourceFactory implements EnumeratedFactory
{
public AbstractEnumerated getForName (String name)
{
return ApplicantSource.forName (name);
}
public AbstractEnumerated getForValue (String name)
{
return ApplicantSource.forValue (name);
}
public Enumeration getAll ()
{
return ApplicantSource.getAll ();
}
}
public Map getAdditionalAttributes ()
{
Map attribs = new HashMap ();
return attribs;
}
public static class ApplicantSourcePipeLineFactory<From, Me extends ApplicantSource> extends AbstractEnumerated.EnumPipeLine<From, Me>
{
public <Prev> ApplicantSourcePipeLineFactory (PipeLine<From, Prev> pipeLine, Pipe<Prev, Me> nextPipe)
{
super (pipeLine, nextPipe);
}
public ApplicantSourcePipeLineFactory (From seed)
{
super(seed);
}
public ApplicantSourcePipeLineFactory (Collection<From> seed)
{
super(seed);
}
public PipeLine<From, ? extends Object> to(String name)
{
return super.to(name);
}
}
}
<?xml version="1.0" encoding="UTF-8"?>
<ROOT>
<CONSTANT package="performa.orm.types" name="ApplicantSource">
<VALUE name="INGEST" description="Ingest" />
<VALUE name="ATS" description="ATS" />
<VALUE name="APPLY_URL" description="Apply URL" />
</CONSTANT>
</ROOT>
\ No newline at end of file
......@@ -58,6 +58,8 @@ public class PlaceholderOptions extends AbstractEnumerated
private transient Boolean ShowForContent;
private transient Boolean IsLink;
private PlaceholderOptions (String name, String value, String description, boolean disabled)
{
super (name, value, description, disabled);
......@@ -78,6 +80,11 @@ public class PlaceholderOptions extends AbstractEnumerated
return ShowForContent;
}
public Boolean getIsLink()
{
return IsLink;
}
public static final Comparator COMPARE_BY_POSITION = new CompareEnumByPosition (allPlaceholderOptionss);
......@@ -148,36 +155,47 @@ public class PlaceholderOptions extends AbstractEnumerated
FIRST_NAME.Placeholder = "$firstName";
FIRST_NAME.ShowForSubject = Boolean.TRUE;
FIRST_NAME.ShowForContent = Boolean.TRUE;
FIRST_NAME.IsLink = Boolean.FALSE;
SURNAME.Placeholder = "$surname";
SURNAME.ShowForSubject = Boolean.TRUE;
SURNAME.ShowForContent = Boolean.TRUE;
SURNAME.IsLink = Boolean.FALSE;
EMAIL_ADDRESS.Placeholder = "$emailAddress";
EMAIL_ADDRESS.ShowForSubject = Boolean.TRUE;
EMAIL_ADDRESS.ShowForContent = Boolean.TRUE;
EMAIL_ADDRESS.IsLink = Boolean.FALSE;
LOCATION.Placeholder = "$location";
LOCATION.ShowForSubject = Boolean.TRUE;
LOCATION.ShowForContent = Boolean.TRUE;
LOCATION.IsLink = Boolean.FALSE;
HIRING_TEAM.Placeholder = "$hiringTeam";
HIRING_TEAM.ShowForSubject = Boolean.TRUE;
HIRING_TEAM.ShowForContent = Boolean.TRUE;
HIRING_TEAM.IsLink = Boolean.FALSE;
JOB_TITLE.Placeholder = "$jobTitle";
JOB_TITLE.ShowForSubject = Boolean.TRUE;
JOB_TITLE.ShowForContent = Boolean.TRUE;
JOB_TITLE.IsLink = Boolean.FALSE;
JOB_REFERENCE.Placeholder = "$jobReference";
JOB_REFERENCE.ShowForSubject = Boolean.TRUE;
JOB_REFERENCE.ShowForContent = Boolean.TRUE;
JOB_REFERENCE.IsLink = Boolean.FALSE;
JOB_LINK.Placeholder = "$jobLink";
JOB_LINK.ShowForSubject = Boolean.FALSE;
JOB_LINK.ShowForContent = Boolean.TRUE;
JOB_LINK.IsLink = Boolean.TRUE;
WITHDRAW_LINK.Placeholder = "$withdrawLink";
WITHDRAW_LINK.ShowForSubject = Boolean.FALSE;
WITHDRAW_LINK.ShowForContent = Boolean.TRUE;
WITHDRAW_LINK.IsLink = Boolean.TRUE;
JOB_OWNER_FIRST_NAME.Placeholder = "$jobOwnerFirstName";
JOB_OWNER_FIRST_NAME.ShowForSubject = Boolean.TRUE;
JOB_OWNER_FIRST_NAME.ShowForContent = Boolean.TRUE;
JOB_OWNER_FIRST_NAME.IsLink = Boolean.FALSE;
JOB_OWNER_LAST_NAME.Placeholder = "$jobOwnerLastName";
JOB_OWNER_LAST_NAME.ShowForSubject = Boolean.TRUE;
JOB_OWNER_LAST_NAME.ShowForContent = Boolean.TRUE;
JOB_OWNER_LAST_NAME.IsLink = Boolean.FALSE;
}
......@@ -208,6 +226,7 @@ public class PlaceholderOptions extends AbstractEnumerated
attribs.put ("Placeholder", ArrayFormatter.toObject(getPlaceholder()));
attribs.put ("ShowForSubject", ArrayFormatter.toObject(getShowForSubject()));
attribs.put ("ShowForContent", ArrayFormatter.toObject(getShowForContent()));
attribs.put ("IsLink", ArrayFormatter.toObject(getIsLink()));
return attribs;
}
......@@ -243,6 +262,10 @@ public class PlaceholderOptions extends AbstractEnumerated
{
return toShowForContent ();
}
if (name.equals ("IsLink"))
{
return toIsLink ();
}
return super.to(name);
}
......@@ -253,6 +276,8 @@ public class PlaceholderOptions extends AbstractEnumerated
public PipeLine<From, Boolean> toShowForSubject () { return pipe(new EnumAttributePipe<Me, Boolean>("ShowForSubject")); }
public PipeLine<From, Boolean> toShowForContent () { return pipe(new EnumAttributePipe<Me, Boolean>("ShowForContent")); }
public PipeLine<From, Boolean> toIsLink () { return pipe(new EnumAttributePipe<Me, Boolean>("IsLink")); }
}
}
......@@ -6,29 +6,30 @@
<DATA name="Placeholder" type="String"/>
<DATA name="ShowForSubject" type="Boolean"/>
<DATA name="ShowForContent" type="Boolean"/>
<DATA name="IsLink" type="Boolean"/>
<VALUE name="FIRST_NAME" value="FIRST_NAME" description="First Name" Placeholder='"$firstName"'
ShowForSubject="Boolean.TRUE" ShowForContent="Boolean.TRUE"/>
ShowForSubject="Boolean.TRUE" ShowForContent="Boolean.TRUE" IsLink="Boolean.FALSE"/>
<VALUE name="SURNAME" value="SURNAME" description="Surname" Placeholder='"$surname"'
ShowForSubject="Boolean.TRUE" ShowForContent="Boolean.TRUE"/>
ShowForSubject="Boolean.TRUE" ShowForContent="Boolean.TRUE" IsLink="Boolean.FALSE"/>
<VALUE name="EMAIL_ADDRESS" value="EMAIL_ADDRESS" description="Email Address" Placeholder='"$emailAddress"'
ShowForSubject="Boolean.TRUE" ShowForContent="Boolean.TRUE"/>
ShowForSubject="Boolean.TRUE" ShowForContent="Boolean.TRUE" IsLink="Boolean.FALSE"/>
<VALUE name="LOCATION" value="LOCATION" description="Location" Placeholder='"$location"'
ShowForSubject="Boolean.TRUE" ShowForContent="Boolean.TRUE"/>
ShowForSubject="Boolean.TRUE" ShowForContent="Boolean.TRUE" IsLink="Boolean.FALSE"/>
<VALUE name="HIRING_TEAM" value="HIRING_TEAM" description="Hiring Team" Placeholder='"$hiringTeam"'
ShowForSubject="Boolean.TRUE" ShowForContent="Boolean.TRUE"/>
ShowForSubject="Boolean.TRUE" ShowForContent="Boolean.TRUE" IsLink="Boolean.FALSE"/>
<VALUE name="JOB_TITLE" value="JOB_TITLE" description="Job Title" Placeholder='"$jobTitle"'
ShowForSubject="Boolean.TRUE" ShowForContent="Boolean.TRUE"/>
ShowForSubject="Boolean.TRUE" ShowForContent="Boolean.TRUE" IsLink="Boolean.FALSE"/>
<VALUE name="JOB_REFERENCE" value="JOB_REFERENCE" description="Job Reference" Placeholder='"$jobReference"'
ShowForSubject="Boolean.TRUE" ShowForContent="Boolean.TRUE"/>
ShowForSubject="Boolean.TRUE" ShowForContent="Boolean.TRUE" IsLink="Boolean.FALSE"/>
<VALUE name="JOB_LINK" value="JOB_LINK" description="Job Link" Placeholder='"$jobLink"'
ShowForSubject="Boolean.FALSE" ShowForContent="Boolean.TRUE"/>
ShowForSubject="Boolean.FALSE" ShowForContent="Boolean.TRUE" IsLink="Boolean.TRUE"/>
<VALUE name="WITHDRAW_LINK" value="WITHDRAW_LINK" description="Withdraw Link" Placeholder='"$withdrawLink"'
ShowForSubject="Boolean.FALSE" ShowForContent="Boolean.TRUE"/>
ShowForSubject="Boolean.FALSE" ShowForContent="Boolean.TRUE" IsLink="Boolean.TRUE"/>
<VALUE name="JOB_OWNER_FIRST_NAME" value="JOB_OWNER_FIRST_NAME" description="Job Owner - First Name" Placeholder='"$jobOwnerFirstName"'
ShowForSubject="Boolean.TRUE" ShowForContent="Boolean.TRUE"/>
ShowForSubject="Boolean.TRUE" ShowForContent="Boolean.TRUE" IsLink="Boolean.FALSE"/>
<VALUE name="JOB_OWNER_LAST_NAME" value="JOB_OWNER_LAST_NAME" description="Job Owner - Last Name" Placeholder='"$jobOwnerLastName"'
ShowForSubject="Boolean.TRUE" ShowForContent="Boolean.TRUE"/>
ShowForSubject="Boolean.TRUE" ShowForContent="Boolean.TRUE" IsLink="Boolean.FALSE"/>
</CONSTANT>
</ROOT>
\ No newline at end of file
......@@ -21,25 +21,9 @@ public class StageType extends AbstractEnumerated
public static final EnumeratedFactory FACTORY_StageType = new StageTypeFactory();
public static final StageType POST_INGEST = new StageType ("POST_INGEST", "POST_INGEST", "Post Ingest", false);
public static final StageType INITIAL = new StageType ("INITIAL", "INITIAL", "Initial", false);
public static final StageType INCOMPLETE = new StageType ("INCOMPLETE", "INCOMPLETE", "Incomplete", false);
public static final StageType REFERENCE_CHECK = new StageType ("REFERENCE_CHECK", "REFERENCE_CHECK", "Reference Check", false);
public static final StageType SCREENING_CHECK = new StageType ("SCREENING_CHECK", "SCREENING_CHECK", "Screening Check", false);
public static final StageType VIDEO_INTERVIEW = new StageType ("VIDEO_INTERVIEW", "VIDEO_INTERVIEW", "Video Interview", false);
public static final StageType INTERVIEW = new StageType ("INTERVIEW", "INTERVIEW", "Interview", false);
public static final StageType REQUIREMENT_FIT = new StageType ("REQUIREMENT_FIT", "REQUIREMENT_FIT", "Requirement Fit", false);
public static final StageType CULTURE_FIT = new StageType ("CULTURE_FIT", "CULTURE_FIT", "Culture Fit", false);
public static final StageType ROLE_FIT = new StageType ("ROLE_FIT", "ROLE_FIT", "Role Fit", false);
public static final StageType DIVERSITY = new StageType ("DIVERSITY", "DIVERSITY", "Diversity", false);
public static final StageType GENERIC = new StageType ("GENERIC", "GENERIC", "Generic", false);
public static final StageType SUCCESSFUL = new StageType ("SUCCESSFUL", "SUCCESSFUL", "Successful", false);
......@@ -48,7 +32,7 @@ public class StageType extends AbstractEnumerated
public static final StageType WITHDREW = new StageType ("WITHDREW", "WITHDREW", "Withdrew", false);
private static final StageType[] allStageTypes =
new StageType[] { POST_INGEST,INCOMPLETE,REFERENCE_CHECK,SCREENING_CHECK,VIDEO_INTERVIEW,INTERVIEW,REQUIREMENT_FIT,CULTURE_FIT,ROLE_FIT,DIVERSITY,SUCCESSFUL,UNSUITABLE,WITHDREW};
new StageType[] { INITIAL,GENERIC,SUCCESSFUL,UNSUITABLE,WITHDREW};
private static StageType[] getAllStageTypes ()
......@@ -142,26 +126,10 @@ public class StageType extends AbstractEnumerated
public static void defineAdditionalData ()
{
POST_INGEST.IsPreStage = Boolean.TRUE;
POST_INGEST.IsPostStage = Boolean.FALSE;
INCOMPLETE.IsPreStage = Boolean.TRUE;
INCOMPLETE.IsPostStage = Boolean.FALSE;
REFERENCE_CHECK.IsPreStage = Boolean.FALSE;
REFERENCE_CHECK.IsPostStage = Boolean.FALSE;
SCREENING_CHECK.IsPreStage = Boolean.FALSE;
SCREENING_CHECK.IsPostStage = Boolean.FALSE;
VIDEO_INTERVIEW.IsPreStage = Boolean.FALSE;
VIDEO_INTERVIEW.IsPostStage = Boolean.FALSE;
INTERVIEW.IsPreStage = Boolean.FALSE;
INTERVIEW.IsPostStage = Boolean.FALSE;
REQUIREMENT_FIT.IsPreStage = Boolean.FALSE;
REQUIREMENT_FIT.IsPostStage = Boolean.FALSE;
CULTURE_FIT.IsPreStage = Boolean.FALSE;
CULTURE_FIT.IsPostStage = Boolean.FALSE;
ROLE_FIT.IsPreStage = Boolean.FALSE;
ROLE_FIT.IsPostStage = Boolean.FALSE;
DIVERSITY.IsPreStage = Boolean.FALSE;
DIVERSITY.IsPostStage = Boolean.FALSE;
INITIAL.IsPreStage = Boolean.TRUE;
INITIAL.IsPostStage = Boolean.FALSE;
GENERIC.IsPreStage = Boolean.FALSE;
GENERIC.IsPostStage = Boolean.FALSE;
SUCCESSFUL.IsPreStage = Boolean.FALSE;
SUCCESSFUL.IsPostStage = Boolean.TRUE;
UNSUITABLE.IsPreStage = Boolean.FALSE;
......
......@@ -6,16 +6,8 @@
<DATA name="IsPreStage" type="Boolean"/>
<DATA name="IsPostStage" type="Boolean"/>
<VALUE name="POST_INGEST" description="Post Ingest" IsPreStage="Boolean.TRUE" IsPostStage="Boolean.FALSE"/>
<VALUE name="INCOMPLETE" description="Incomplete" IsPreStage="Boolean.TRUE" IsPostStage="Boolean.FALSE"/>
<VALUE name="REFERENCE_CHECK" description="Reference Check" IsPreStage="Boolean.FALSE" IsPostStage="Boolean.FALSE"/>
<VALUE name="SCREENING_CHECK" description="Screening Check" IsPreStage="Boolean.FALSE" IsPostStage="Boolean.FALSE"/>
<VALUE name="VIDEO_INTERVIEW" description="Video Interview" IsPreStage="Boolean.FALSE" IsPostStage="Boolean.FALSE"/>
<VALUE name="INTERVIEW" description="Interview" IsPreStage="Boolean.FALSE" IsPostStage="Boolean.FALSE"/>
<VALUE name="REQUIREMENT_FIT" description="Requirement Fit" IsPreStage="Boolean.FALSE" IsPostStage="Boolean.FALSE"/>
<VALUE name="CULTURE_FIT" description="Culture Fit" IsPreStage="Boolean.FALSE" IsPostStage="Boolean.FALSE"/>
<VALUE name="ROLE_FIT" description="Role Fit" IsPreStage="Boolean.FALSE" IsPostStage="Boolean.FALSE"/>
<VALUE name="DIVERSITY" description="Diversity" IsPreStage="Boolean.FALSE" IsPostStage="Boolean.FALSE"/>
<VALUE name="INITIAL" description="Initial" IsPreStage="Boolean.TRUE" IsPostStage="Boolean.FALSE"/>
<VALUE name="GENERIC" description="Generic" IsPreStage="Boolean.FALSE" IsPostStage="Boolean.FALSE"/>
<VALUE name="SUCCESSFUL" description="Successful" IsPreStage="Boolean.FALSE" IsPostStage="Boolean.TRUE"/>
<VALUE name="UNSUITABLE" description="Unsuitable" IsPreStage="Boolean.FALSE" IsPostStage="Boolean.TRUE"/>
<VALUE name="WITHDREW" description="Withdrew" IsPreStage="Boolean.FALSE" IsPostStage="Boolean.TRUE"/>
......
package performa.orm.types;
import java.util.*;
import oneit.utils.*;
import oneit.utils.transform.*;
/**
* This class was generated using constGen.bat.
* DO NOT MODIFY THIS CODE.
* Edit the associated .xml file, and regenerate this file
* constGen (directory) (file minus extension)
* e.g. constGen C:\...\sql FieldType
*/
public class StepType extends AbstractEnumerated
{
public static final EnumeratedFactory FACTORY_StepType = new StepTypeFactory();
public static final StepType REQUIREMENT_FIT = new StepType ("REQUIREMENT_FIT", "REQUIREMENT_FIT", "Requirement Fit", false);
public static final StepType CULTURE_FIT = new StepType ("CULTURE_FIT", "CULTURE_FIT", "Culture Fit", false);
public static final StepType ROLE_FIT = new StepType ("ROLE_FIT", "ROLE_FIT", "Role Fit", false);
public static final StepType DIVERSITY = new StepType ("DIVERSITY", "DIVERSITY", "Diversity", false);
private static final StepType[] allStepTypes =
new StepType[] { REQUIREMENT_FIT,CULTURE_FIT,ROLE_FIT,DIVERSITY};
private static StepType[] getAllStepTypes ()
{
return allStepTypes;
}
private StepType (String name, String value, String description, boolean disabled)
{
super (name, value, description, disabled);
}
public static final Comparator COMPARE_BY_POSITION = new CompareEnumByPosition (allStepTypes);
static
{
defineAdditionalData ();
}
public boolean isEqual (StepType other)
{
return this.name.equals (other.name);
}
public Enumeration getAllInstances ()
{
return StepType.getAll ();
}
private Object readResolve() throws java.io.ObjectStreamException
{
return StepType.forName (this.name);
}
public EnumeratedFactory getFactory ()
{
return FACTORY_StepType;
}
public static StepType forName (String name)
{
if (name == null) { return null; }
StepType[] all = getAllStepTypes();
int enumIndex = AbstractEnumerated.getIndexForName (all, name);
return all[enumIndex];
}
public static StepType forValue (String value)
{
if (value == null) { return null; }
StepType[] all = getAllStepTypes();
int enumIndex = AbstractEnumerated.getIndexForValue (getAllStepTypes (), value);
return all[enumIndex];
}
public static java.util.Enumeration getAll ()
{
return AbstractEnumerated.getAll (getAllStepTypes());
}
public static StepType[] getStepTypeArray ()
{
return (StepType[])getAllStepTypes().clone ();
}
public static void defineAdditionalData ()
{
}
static class StepTypeFactory implements EnumeratedFactory
{
public AbstractEnumerated getForName (String name)
{
return StepType.forName (name);
}
public AbstractEnumerated getForValue (String name)
{
return StepType.forValue (name);
}
public Enumeration getAll ()
{
return StepType.getAll ();
}
}
public Map getAdditionalAttributes ()
{
Map attribs = new HashMap ();
return attribs;
}
public static class StepTypePipeLineFactory<From, Me extends StepType> extends AbstractEnumerated.EnumPipeLine<From, Me>
{
public <Prev> StepTypePipeLineFactory (PipeLine<From, Prev> pipeLine, Pipe<Prev, Me> nextPipe)
{
super (pipeLine, nextPipe);
}
public StepTypePipeLineFactory (From seed)
{
super(seed);
}
public StepTypePipeLineFactory (Collection<From> seed)
{
super(seed);
}
public PipeLine<From, ? extends Object> to(String name)
{
return super.to(name);
}
}
}
<?xml version="1.0" encoding="UTF-8"?>
<ROOT>
<CONSTANT package="performa.orm.types" name="StepType">
<VALUE name="REQUIREMENT_FIT" description="Requirement Fit" />
<VALUE name="CULTURE_FIT" description="Culture Fit" />
<VALUE name="ROLE_FIT" description="Role Fit" />
<VALUE name="DIVERSITY" description="Diversity" />
</CONSTANT>
</ROOT>
\ No newline at end of file
......@@ -2,6 +2,7 @@ package performa.search;
import oneit.objstore.*;
import oneit.objstore.rdbms.filters.*;
import oneit.security.SecUser;
import performa.orm.*;
public class SearchMessageTemplate extends BaseSearchMessageTemplate
......@@ -18,12 +19,14 @@ public class SearchMessageTemplate extends BaseSearchMessageTemplate
public BaseBusinessClass[] doSearch()
{
BaseMessageTemplate.SearchAll searchByAll = MessageTemplate.SearchByAll();
SecUser secUser = SecUser.getTXUser(getTransaction());
CompanyUser companyUser = secUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
if (isTrue(getOnlyGlobalTemplate()))
{
return searchByAll.andIsGlobalTemplate(new EqualsFilter<>(Boolean.TRUE)).search(getTransaction());
return searchByAll.andHiringTeam(new IsNullFilter<>()).andRelatedToJob(new EqualsFilter<>(Boolean.FALSE)).search(getTransaction());
}
return searchByAll.andIsGlobalTemplate(new IsNotNullFilter<>()).search(getTransaction());
return searchByAll.andHiringTeam(new EqualsFilter<>(companyUser.getSelectedTeam())).andRelatedToJob(new EqualsFilter<>(Boolean.FALSE)).search(getTransaction());
}
}
\ No newline at end of file
......@@ -25,11 +25,11 @@ public class SearchWorkFlowTemplate extends BaseSearchWorkFlowTemplate
if (isTrue(getOnlyGlobalTemplates()))
{
return searchByAll.andIsGlobalTemplate(new EqualsFilter<>(Boolean.TRUE)).search(getTransaction());
return searchByAll.andHiringTeam(new IsNullFilter<>()).andRelatedToJob(new EqualsFilter<>(Boolean.FALSE)).search(getTransaction());
}
return searchByAll.andIsGlobalTemplate(new IsNotNullFilter<>())
.andHiringTeam(new EqualsFilter<>(companyUser.getSelectedTeam()))
return searchByAll.andHiringTeam(new EqualsFilter<>(companyUser.getSelectedTeam()))
.andRelatedToJob(new EqualsFilter<>(Boolean.FALSE))
.search(getTransaction());
}
}
\ No newline at end of file
......@@ -19,6 +19,7 @@ import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import performa.orm.*;
import performa.orm.types.ApplicantSource;
import performa.orm.types.StageType;
......@@ -407,7 +408,8 @@ public class PerformaEmailFetcher implements Runnable, InitialisationParticipant
JobApplication jobApplication = JobApplication.createNewApplication(candidate, job);
jobApplication.setWorkFlowStage(job.getWorkFlowByStageType(StageType.POST_INGEST));
jobApplication.setWorkFlowStage(job.getWorkFlowByStageType(StageType.INITIAL));
jobApplication.setApplicantSource(ApplicantSource.INGEST);
jobApplication.setIsEmailIngest(true);
if(contents.size() > 0)
......@@ -481,7 +483,8 @@ public class PerformaEmailFetcher implements Runnable, InitialisationParticipant
JobApplication jobApplication = JobApplication.createNewApplication(candidate, job);
jobApplication.setWorkFlowStage(job.getWorkFlowByStageType(StageType.POST_INGEST));
jobApplication.setWorkFlowStage(job.getWorkFlowByStageType(StageType.INITIAL));
jobApplication.setApplicantSource(ApplicantSource.INGEST);
jobApplication.setIsEmailIngest(true);
if(contents.size() > 0 )
......
......@@ -793,11 +793,10 @@ public class Utils
SecUser secUser = SecUser.getTXUser(objTran);
CompanyUser companyUser = secUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
WorkFlowTemplate[] hiringTeamTemplates = WorkFlowTemplate.SearchByAll().andIsGlobalTemplate(new IsNotNullFilter<>())
.andHiringTeam(new EqualsFilter<>(companyUser.getSelectedTeam()))
WorkFlowTemplate[] hiringTeamTemplates = WorkFlowTemplate.SearchByAll().andHiringTeam(new EqualsFilter<>(companyUser.getSelectedTeam()))
.search(objTran);
WorkFlowTemplate[] globalTemplates = WorkFlowTemplate.SearchByAll().andIsGlobalTemplate(new EqualsFilter<>(Boolean.TRUE))
WorkFlowTemplate[] globalTemplates = WorkFlowTemplate.SearchByAll().andHiringTeam(new IsNullFilter<>())
.search(objTran);
return CollectionUtils.addTo(globalTemplates, hiringTeamTemplates);
......
package performa.utils;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
import oneit.objstore.ObjectTransaction;
import oneit.objstore.StorageException;
import oneit.objstore.rdbms.filters.EqualsFilter;
......@@ -9,7 +9,6 @@ import oneit.objstore.rdbms.filters.IsNullFilter;
import oneit.objstore.services.TransactionServices;
import oneit.objstore.services.TransactionTask;
import oneit.utils.NestedException;
import oneit.utils.filter.CollectionFilter;
import oneit.utils.parsers.FieldException;
import performa.orm.ILOJobTitle;
import performa.orm.Job;
......@@ -18,9 +17,12 @@ import performa.orm.MessageTemplate;
import performa.orm.WorkFlow;
import performa.orm.WorkFlowMessage;
import performa.orm.WorkFlowStage;
import performa.orm.WorkFlowStep;
import performa.orm.WorkFlowTemplate;
import performa.orm.types.ApplicantSource;
import performa.orm.types.ApplicationStatus;
import performa.orm.types.StageType;
import performa.orm.types.StepType;
public class WorkflowDataMigration
......@@ -34,8 +36,6 @@ public class WorkflowDataMigration
try
{
Job[] jobs = Job.SearchByAll().andWorkFlowTemplate(new IsNullFilter<>()).search(objTran);
MessageTemplate[] incomplete = MessageTemplate.SearchByAll().andApplicationStatus(new EqualsFilter<>(ApplicationStatus.DRAFT)).andIsSystemGenerated(new EqualsFilter<>(Boolean.TRUE)).search(objTran);
MessageTemplate[] postIngest = MessageTemplate.SearchByAll().andApplicationStatus(new EqualsFilter<>(ApplicationStatus.POST_INGEST)).andIsSystemGenerated(new EqualsFilter<>(Boolean.TRUE)).search(objTran);
for(Job job : jobs)
{
......@@ -59,46 +59,40 @@ public class WorkflowDataMigration
wfTemplate.setTemplateName(job.getJobTitle());
wfTemplate.setIsSystemGenerated(Boolean.TRUE);
wfTemplate.setHiringTeam(job.getHiringTeam());
wfTemplate.addToJobs(job);
wfTemplate.setRelatedToJob(Boolean.TRUE);
job.setWorkFlowTemplate(wfTemplate);
int sortOrder = 0;
int stepSortOrder = 0;
WorkFlowStage postIngestStage = createWorkFlowStage(objTran, wfTemplate, "Post Ingest", StageType.POST_INGEST, sortOrder++);
for(MessageTemplate mTemplate : (Collection<MessageTemplate>)CollectionFilter.filter(Arrays.asList(postIngest), MessageTemplate.SearchByAll().andMessageID(new EqualsFilter<>(job.getHiringTeam().getMessageID()))))
{
createWorkFlowMessage(objTran, postIngestStage, mTemplate);
}
WorkFlowStage incompleteStage = createWorkFlowStage(objTran, wfTemplate, "Incomplete", StageType.INCOMPLETE, sortOrder++);
for(MessageTemplate mTemplate : (Collection<MessageTemplate>)CollectionFilter.filter(Arrays.asList(incomplete), MessageTemplate.SearchByAll().andMessageID(new EqualsFilter<>(job.getHiringTeam().getMessageID()))))
{
createWorkFlowMessage(objTran, incompleteStage, mTemplate);
}
MessageTemplate[] messageTemplates = MessageTemplate.SearchByAll().andMessageID(new EqualsFilter<>(job.getHiringTeam().getMessageID())).andIsSystemGenerated(new EqualsFilter<>(Boolean.TRUE)).search(objTran);
WorkFlowStage initialStage = createWorkFlowStage(objTran, wfTemplate, "Initial", StageType.INITIAL, sortOrder++);
if(job.getDiversityIncluded())
{
createWorkFlowStage(objTran, wfTemplate, "Diversity", StageType.DIVERSITY, sortOrder++);
createWorkFlowStep(objTran, initialStage, StepType.DIVERSITY, stepSortOrder++);
}
if(job.getIncludeAssessmentCriteria())
{
createWorkFlowStage(objTran, wfTemplate, "Requirements", StageType.REQUIREMENT_FIT, sortOrder++);
createWorkFlowStep(objTran, initialStage, StepType.REQUIREMENT_FIT, stepSortOrder++);
}
if(job.getIncludeCulture())
{
createWorkFlowStage(objTran, wfTemplate, "Culture Fit", StageType.CULTURE_FIT, sortOrder++);
createWorkFlowStep(objTran, initialStage, StepType.CULTURE_FIT, stepSortOrder++);
}
createWorkFlowStage(objTran, wfTemplate, "Role Fit", StageType.ROLE_FIT, sortOrder++);
createWorkFlowStep(objTran, initialStage, StepType.ROLE_FIT, stepSortOrder++);
createWorkFlowStage(objTran, wfTemplate, "Submitted", StageType.REFERENCE_CHECK, sortOrder++);
for(MessageTemplate mTemplate : messageTemplates)
{
createWorkFlowMessage(objTran, initialStage, mTemplate);
}
for(WorkFlow workFlow : job.getWorkFlowsSet())
{
if(workFlow.getApplicationStatus() == ApplicationStatus.DRAFT || workFlow.getApplicationStatus() == ApplicationStatus.UNSUITABLE || workFlow.getApplicationStatus() == ApplicationStatus.SUBMITTED)
if(workFlow.getApplicationStatus() == ApplicationStatus.POST_INGEST || workFlow.getApplicationStatus() == ApplicationStatus.DRAFT || workFlow.getApplicationStatus() == ApplicationStatus.UNSUITABLE)
{
continue;
}
......@@ -114,6 +108,7 @@ public class WorkflowDataMigration
for(JobApplication jobApplication : job.getJobApplicationsSet())
{
jobApplication.setApplicantSource(jobApplication.getIsEmailIngest() ? ApplicantSource.INGEST : ApplicantSource.APPLY_URL);
jobApplication.setWorkFlowStage(getWFStageByStatus(wfTemplate, jobApplication.getApplicationStatus()));
}
}
......@@ -129,8 +124,12 @@ public class WorkflowDataMigration
private static void createWorkFlowMessage(ObjectTransaction objTran, WorkFlowStage stage, MessageTemplate mTemplate) throws StorageException, FieldException
{
WorkFlowMessage wfMessage = WorkFlowMessage.createWorkFlowMessage(objTran);
Set<ApplicantSource> sources = new HashSet();
sources.add(mTemplate.getApplicationStatus() == ApplicationStatus.DRAFT ? ApplicantSource.APPLY_URL : ApplicantSource.INGEST);
wfMessage.setWorkFlowStage(stage);
wfMessage.setApplicantSources(sources);
wfMessage.setBusinessHoursOnly(mTemplate.getBusinessHoursOnly());
wfMessage.setMessageTemplate(mTemplate);
wfMessage.setDelay(getDelay(mTemplate));
......@@ -149,6 +148,17 @@ public class WorkflowDataMigration
return wfStage;
}
private static WorkFlowStep createWorkFlowStep(ObjectTransaction objTran, WorkFlowStage wfStage, StepType stepType, int sortOrder) throws FieldException, StorageException
{
WorkFlowStep wfStep = WorkFlowStep.createWorkFlowStep(objTran);
wfStep.setWorkFlowStage(wfStage);
wfStep.setStepType(stepType);
wfStep.setSortOrder(sortOrder);
return wfStep;
}
private static String getDelay(MessageTemplate mTemplate)
{
StringBuilder sb = new StringBuilder();
......@@ -162,39 +172,30 @@ public class WorkflowDataMigration
public static StageType getStageTypeByStatus(ApplicationStatus status)
{
if(status == ApplicationStatus.POST_INGEST)
if(status == ApplicationStatus.POST_INGEST || status == ApplicationStatus.DRAFT)
{
return StageType.POST_INGEST;
}
else if(status == ApplicationStatus.DRAFT)
{
return StageType.INCOMPLETE;
return StageType.INITIAL;
}
else if(status == ApplicationStatus.UNSUITABLE)
{
return StageType.UNSUITABLE;
}
// TODO: map other statuses
return StageType.INTERVIEW;
return StageType.GENERIC;
}
public static WorkFlowStage getWFStageByStatus(WorkFlowTemplate template , ApplicationStatus status)
{
if(status == ApplicationStatus.POST_INGEST)
{
return getWFStage(template, StageType.POST_INGEST);
}
else if(status == ApplicationStatus.DRAFT)
if(status == ApplicationStatus.POST_INGEST || status == ApplicationStatus.DRAFT)
{
return getWFStage(template, StageType.INCOMPLETE);
return getWFStage(template, StageType.INITIAL);
}
else if(status == ApplicationStatus.UNSUITABLE)
{
return getWFStage(template, StageType.UNSUITABLE);
}
// TODO: map other statuses
return getWFStage(template, StageType.INTERVIEW);
return getWFStage(template, StageType.GENERIC);
}
private static WorkFlowStage getWFStage(WorkFlowTemplate template, StageType stageType)
......
......@@ -30,8 +30,6 @@ public class SaveMessageAsCopy extends ORMUpdateJSONService
{
MessageTemplate cloanedTemplate = revertAttributesAndClone(messageTemplate);
cloanedTemplate.setIsGlobalTemplate(Boolean.FALSE);
SecUser secUser = SecUser.getTXUser(objTran);
if(secUser != null && secUser.getExtension(CompanyUser.REFERENCE_CompanyUser) != null)
......@@ -42,7 +40,7 @@ public class SaveMessageAsCopy extends ORMUpdateJSONService
}
}
super.processForm(request, objTran, result, exceptions, createdBBCs, updatedBBCs); //To change body of generated methods, choose Tools | Templates.
super.processForm(request, objTran, result, exceptions, createdBBCs, updatedBBCs);
}
private MessageTemplate revertAttributesAndClone(MessageTemplate messageTemplate)
......
......@@ -30,8 +30,6 @@ public class SaveWorkflowAsCopy extends ORMUpdateJSONService
{
WorkFlowTemplate cloanedTemplate = revertAttributesAndClone(workFlowTemplate);
cloanedTemplate.setIsGlobalTemplate(Boolean.FALSE);
SecUser secUser = SecUser.getTXUser(objTran);
if(secUser != null && secUser.getExtension(CompanyUser.REFERENCE_CompanyUser) != null)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment