att
This commit is contained in:
@@ -9,6 +9,501 @@
|
||||
</void>
|
||||
</array>
|
||||
</void>
|
||||
<void method="put">
|
||||
<string>mecanismoGrupo</string>
|
||||
<object class="java.util.ArrayList">
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>Tecnologia e Comunicação</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>TIC</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>Compras Indiretos</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>ComprasIndiretos</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>Obras e manutenção</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>Manutencao</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>Aprovadores Compras Nvl 3</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>AprovadoresComprasNvl3</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>Motoristas</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>Motoristas</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>Requisitantes de Vaga</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>Requisitantesdevaga</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>Recrutamento</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>Recrutamento</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>TODOS-TODOS-DIADMISSAO</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>TODOS-TODOS-DIADMISSAO</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>ResponsavelDesligamento</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>ResponsavelDesligamento</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>GENTE & CULTURA</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>GENTE_CULTURA</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>LOJA AL</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>LOJA_AL</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>CD</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>CD</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>ESPAÇO DO REVENDEDOR AL</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>ESPACO_DO_REVENDEDOR_AL</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>FINANCEIRO</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>FINANCEIRO</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>OPERAÇÕES</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>OPERACOES</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>AMG AL</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>AMG_AL</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>REGIONAL ALAGOAS</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>REGIONAL_ALAGOAS</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>PREVENÇÃO DE PERDA</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>PREVENCAO_DE_PERDA</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>MARKETING, TREINAMENTO</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>MARKETING_TREINAMENTO</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>SECRETARIA EXECUTIVA</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>SECRETARIA_EXECUTIVA</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>DIRETORIA EXECUTIVA</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>DIRETORIA_EXECUTIVA</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>INFRAESTRUTURA</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>INFRAESTRUTURA</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>ESPAÇO DO REVENDEDOR BA</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>ESPACO_DO_REVENDEDOR_BA</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>BUSINESS INTELLIGENCE</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>BUSINESS_INTELLIGENCE</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>DEPARTAMENTO PESSOAL</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>DEPARTAMENTO_PESSOAL</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>LOJA BA</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>LOJA_BA</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>TREINAMENTO</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>TREINAMENTO</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>AMG BA</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>AMG_BA</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>MARKETING</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>MARKETING</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>COMPRAS</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>COMPRAS</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>AMG SE</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>AMG_SE</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>LOJA SE</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>LOJA_SE</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>ESPAÇO DO REVENDEDOR SE</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>ESPACO_DO_REVENDEDOR_SE</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>VENDAS IN COMPANY</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>VENDAS_IN_COMPANY</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>REGIONAL BAHIA</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>REGIONAL_BAHIA</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>CANAL LOJA 01</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>CANAL_LOJA_01</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>AUDITORIA</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>AUDITORIA</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>CANAL LOJA 02</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>CANAL_LOJA_02</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>PLANEJAMENTO DE DEMANDAS</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>PLANEJAMENTO_DE_DEMANDAS</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>PROJETOS</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>PROJETOS</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>COMPLIANCE</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>COMPLIANCE</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>ESCRITÓRIO - MATRIZ</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>ESCRITORIO_MATRIZ</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>ESCRITÓRIO - CONQUISTA</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>ESCRITORIO_CONQUISTA</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>REGIONAL SERGIPE</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>REGIONAL_SERGIPE</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>Transferencia</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>Transferencia</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>Fiscal</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>Fiscal</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>motoristaAL</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>motoristaAL</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>motoristaBA</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>motoristaBA</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="add">
|
||||
<object class="com.totvs.tds.ecm.foundation.ws.GroupDto">
|
||||
<void property="groupDescription">
|
||||
<string>motoristaSE</string>
|
||||
</void>
|
||||
<void property="groupId">
|
||||
<string>motoristaSE</string>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
</object>
|
||||
</void>
|
||||
<void method="put">
|
||||
<string>expediente</string>
|
||||
<array class="java.lang.String" length="4">
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<processDefinitionVersionPK>
|
||||
<companyId>1</companyId>
|
||||
<processId>Recrutamento e seleção</processId>
|
||||
<version>31</version>
|
||||
<version>34</version>
|
||||
</processDefinitionVersionPK>
|
||||
<versionDescription></versionDescription>
|
||||
<formId>823</formId>
|
||||
@@ -629,7 +629,7 @@
|
||||
<companyId>1</companyId>
|
||||
<processId>Recrutamento e seleção</processId>
|
||||
<expressionOrder>1</expressionOrder>
|
||||
<version>31</version>
|
||||
<version>34</version>
|
||||
<sequence>2</sequence>
|
||||
</conditionProcessStatePK>
|
||||
<condition>hAPI.getCardValue("centroCusto") == ""</condition>
|
||||
@@ -643,7 +643,7 @@
|
||||
<companyId>1</companyId>
|
||||
<processId>Recrutamento e seleção</processId>
|
||||
<expressionOrder>2</expressionOrder>
|
||||
<version>31</version>
|
||||
<version>34</version>
|
||||
<sequence>2</sequence>
|
||||
</conditionProcessStatePK>
|
||||
<condition>true</condition>
|
||||
@@ -657,7 +657,7 @@
|
||||
<companyId>1</companyId>
|
||||
<processId>Recrutamento e seleção</processId>
|
||||
<expressionOrder>1</expressionOrder>
|
||||
<version>31</version>
|
||||
<version>34</version>
|
||||
<sequence>46</sequence>
|
||||
</conditionProcessStatePK>
|
||||
<condition>hAPI.getCardValue("validarMotivo") == "substituicao"</condition>
|
||||
@@ -671,7 +671,7 @@
|
||||
<companyId>1</companyId>
|
||||
<processId>Recrutamento e seleção</processId>
|
||||
<expressionOrder>2</expressionOrder>
|
||||
<version>31</version>
|
||||
<version>34</version>
|
||||
<sequence>46</sequence>
|
||||
</conditionProcessStatePK>
|
||||
<condition>hAPI.getCardValue("validarMotivo") == "temporario"</condition>
|
||||
@@ -685,7 +685,7 @@
|
||||
<companyId>1</companyId>
|
||||
<processId>Recrutamento e seleção</processId>
|
||||
<expressionOrder>3</expressionOrder>
|
||||
<version>31</version>
|
||||
<version>34</version>
|
||||
<sequence>46</sequence>
|
||||
</conditionProcessStatePK>
|
||||
<condition>hAPI.getCardValue("validarMotivo") == "aumento"</condition>
|
||||
@@ -699,7 +699,7 @@
|
||||
<companyId>1</companyId>
|
||||
<processId>Recrutamento e seleção</processId>
|
||||
<expressionOrder>1</expressionOrder>
|
||||
<version>31</version>
|
||||
<version>34</version>
|
||||
<sequence>95</sequence>
|
||||
</conditionProcessStatePK>
|
||||
<condition>hAPI.getCardValue("validacaoFunc") == "entregue"</condition>
|
||||
@@ -713,7 +713,7 @@
|
||||
<companyId>1</companyId>
|
||||
<processId>Recrutamento e seleção</processId>
|
||||
<expressionOrder>2</expressionOrder>
|
||||
<version>31</version>
|
||||
<version>34</version>
|
||||
<sequence>95</sequence>
|
||||
</conditionProcessStatePK>
|
||||
<condition>hAPI.getCardValue("validacaoFunc") == "naoEntregue"</condition>
|
||||
@@ -727,7 +727,7 @@
|
||||
<companyId>1</companyId>
|
||||
<processId>Recrutamento e seleção</processId>
|
||||
<expressionOrder>3</expressionOrder>
|
||||
<version>31</version>
|
||||
<version>34</version>
|
||||
<sequence>95</sequence>
|
||||
</conditionProcessStatePK>
|
||||
<condition>hAPI.getCardValue("validacaoFunc") == "incorreto"</condition>
|
||||
@@ -998,7 +998,241 @@
|
||||
</ProcessLink>
|
||||
</list>
|
||||
<list/>
|
||||
<list/>
|
||||
<list>
|
||||
<WorkflowProcessEvent>
|
||||
<workflowProcessEventPK>
|
||||
<companyId>1</companyId>
|
||||
<eventId>beforeTaskSave</eventId>
|
||||
<processId>Recrutamento e seleção</processId>
|
||||
<version>1</version>
|
||||
</workflowProcessEventPK>
|
||||
<eventDescription>function beforeTaskSave(colleagueId, nextSequenceId, userList) {
|
||||
try {
|
||||
var currentState = parseInt(String(getValue("WKNumState") || "0"), 10);
|
||||
var nextState = parseInt(String(nextSequenceId || "0"), 10);
|
||||
var completeTask = String(getValue("WKCompletTask") || "false");
|
||||
log.info("[Recrutamento.beforeTaskSave] currentState=" + currentState + ", nextState=" + nextState + ", completeTask=" + completeTask);
|
||||
|
||||
if (completeTask !== "true") return;
|
||||
|
||||
// Disparo do e-mail inicial da solicitação (atividade inicial = 1).
|
||||
if (currentState === 1) {
|
||||
enviarNotificacaoSolicitacao();
|
||||
return;
|
||||
}
|
||||
|
||||
// Disparo quando a seleção define o início do colaborador.
|
||||
if (currentState === 6 && nextState === 46) {
|
||||
enviarNotificacaoInicioColaborador();
|
||||
}
|
||||
} catch (e) {
|
||||
log.error("[Recrutamento.beforeTaskSave] Erro ao disparar notificação: " + e);
|
||||
}
|
||||
}
|
||||
|
||||
function enviarNotificacaoSolicitacao() {
|
||||
var envio = montarContextoEnvio();
|
||||
if (!envio.ok) return;
|
||||
|
||||
var params = new java.util.HashMap();
|
||||
params.put("WKNumProces", envio.processNumber);
|
||||
params.put("linkSolicitacao", envio.processLink);
|
||||
params.put("link", envio.processLink);
|
||||
params.put("requesterName", valueOrDefault(hAPI.getCardValue("requesterName")));
|
||||
params.put("gestorNome", valueOrDefault(hAPI.getCardValue("gestorNome")));
|
||||
params.put("dataAbertura", valueOrDefault(hAPI.getCardValue("dataAbertura")));
|
||||
params.put("cargo", valueOrDefault(hAPI.getCardValue("funcao")));
|
||||
params.put("kitUtilizado", getKitDescricao(hAPI.getCardValue("itensinicio")));
|
||||
params.put("motivoSolicitacao", getMotivoDescricao(hAPI.getCardValue("validarMotivo")));
|
||||
params.put("justificativa", valueOrDefault(hAPI.getCardValue("justificativa")));
|
||||
|
||||
notifier.notify("admin", "tpl_recrutamento_realizada_dia", params, envio.destinatarios, "text/html");
|
||||
log.info("[Recrutamento.beforeTaskSave] tpl_recrutamento_realizada_dia enviado. processo=" + envio.processNumber + ", destinos=" + envio.destinosLog);
|
||||
}
|
||||
|
||||
function enviarNotificacaoInicioColaborador() {
|
||||
var envio = montarContextoEnvio();
|
||||
if (!envio.ok) return;
|
||||
|
||||
var dataInicio = safeTrim(hAPI.getCardValue("datainiciotrabalho"));
|
||||
if (dataInicio === "") {
|
||||
log.warn("[Recrutamento.beforeTaskSave] Data de início vazia. Notificação de início não enviada.");
|
||||
return;
|
||||
}
|
||||
|
||||
var params = new java.util.HashMap();
|
||||
params.put("WKNumProces", envio.processNumber);
|
||||
params.put("linkSolicitacao", envio.processLink);
|
||||
params.put("link", envio.processLink);
|
||||
params.put("colaboradorNome", valueOrDefault(hAPI.getCardValue("nomedocandidato")));
|
||||
params.put("cargo", valueOrDefault(hAPI.getCardValue("funcao")));
|
||||
params.put("dataInicio", formatDateBr(dataInicio));
|
||||
params.put("kitUtilizado", getKitDescricao(hAPI.getCardValue("itensinicio")));
|
||||
|
||||
notifier.notify("admin", "tpl_recrutamento_realizada", params, envio.destinatarios, "text/html");
|
||||
log.info("[Recrutamento.beforeTaskSave] tpl_recrutamento_realizada enviado. processo=" + envio.processNumber + ", destinos=" + envio.destinosLog);
|
||||
}
|
||||
|
||||
function montarContextoEnvio() {
|
||||
var destinatarios = new java.util.ArrayList();
|
||||
var jaAdicionados = {};
|
||||
|
||||
addEmail(destinatarios, jaAdicionados, "tic@grupoginseng.com.br");
|
||||
|
||||
var requesterId = safeTrim(hAPI.getCardValue("requesterId"));
|
||||
if (requesterId !== "") {
|
||||
addEmail(destinatarios, jaAdicionados, resolveEmailByColleagueId(requesterId));
|
||||
}
|
||||
|
||||
if (destinatarios.isEmpty()) {
|
||||
log.warn("[Recrutamento.beforeTaskSave] Nenhum e-mail válido encontrado para notificação.");
|
||||
return { ok: false };
|
||||
}
|
||||
|
||||
var processNumber = safeTrim(getValue("WKNumProces"));
|
||||
var processLink = buildProcessLink(processNumber);
|
||||
|
||||
return {
|
||||
ok: true,
|
||||
processNumber: processNumber,
|
||||
processLink: processLink,
|
||||
destinatarios: destinatarios,
|
||||
destinosLog: String(destinatarios.toString())
|
||||
};
|
||||
}
|
||||
|
||||
function addEmail(destinatarios, jaAdicionados, email) {
|
||||
var v = safeTrim(email).toLowerCase();
|
||||
if (!isValidEmail(v)) return;
|
||||
if (jaAdicionados[v]) return;
|
||||
|
||||
destinatarios.add(v);
|
||||
jaAdicionados[v] = true;
|
||||
}
|
||||
|
||||
function resolveEmailByColleagueId(colleagueId) {
|
||||
var id = safeTrim(colleagueId);
|
||||
if (id === "") return "";
|
||||
|
||||
try {
|
||||
var cActive = DatasetFactory.createConstraint("active", "true", "true", ConstraintType.MUST);
|
||||
|
||||
var cId = DatasetFactory.createConstraint("colleaguePK.colleagueId", id, id, ConstraintType.MUST);
|
||||
var byId = DatasetFactory.getDataset("colleague", null, [cId, cActive], null);
|
||||
if (byId && byId.rowsCount > 0) {
|
||||
return safeTrim(byId.getValue(0, "mail"));
|
||||
}
|
||||
|
||||
var cLogin = DatasetFactory.createConstraint("login", id, id, ConstraintType.MUST);
|
||||
var byLogin = DatasetFactory.getDataset("colleague", null, [cLogin, cActive], null);
|
||||
if (byLogin && byLogin.rowsCount > 0) {
|
||||
return safeTrim(byLogin.getValue(0, "mail"));
|
||||
}
|
||||
} catch (e) {
|
||||
log.warn("[Recrutamento.beforeTaskSave] Falha ao buscar e-mail por colleagueId: " + e);
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
function buildProcessLink(processNumber) {
|
||||
var baseUrl = safeTrim(getValue("WKServerURL"));
|
||||
var companyId = safeTrim(getValue("WKCompany"));
|
||||
|
||||
if (baseUrl === "" || processNumber === "") return "";
|
||||
if (baseUrl.indexOf("http://") !== 0 && baseUrl.indexOf("https://") !== 0) {
|
||||
baseUrl = "https://" + baseUrl;
|
||||
}
|
||||
if (baseUrl.charAt(baseUrl.length - 1) === "/") {
|
||||
baseUrl = baseUrl.substring(0, baseUrl.length - 1);
|
||||
}
|
||||
if (companyId === "") companyId = "1";
|
||||
|
||||
return baseUrl + "/portal/p/" + companyId + "/pageworkflowview?app_ecm_workflowview_detailsProcessInstanceID=" + processNumber;
|
||||
}
|
||||
|
||||
function getMotivoDescricao(motivo) {
|
||||
var v = safeTrim(motivo).toLowerCase();
|
||||
if (v === "aumento") return "Aumento de quadro";
|
||||
if (v === "substituicao") return "Substituição";
|
||||
if (v === "temporario") return "Temporário";
|
||||
return v === "" ? "Não informado" : v;
|
||||
}
|
||||
|
||||
function getKitDescricao(kit) {
|
||||
var v = safeTrim(kit).toLowerCase();
|
||||
if (v === "backoffice") return "Kit Backoffice (Notebook, mouse, teclado e headset)";
|
||||
if (v === "amg") return "Kit AMG (Notebook, kit mouse e teclado, headset e telefone corporativo)";
|
||||
if (v === "comercial") return "Kit Comercial (Mobshop e Mobpin)";
|
||||
return v === "" ? "Não informado" : v;
|
||||
}
|
||||
|
||||
function formatDateBr(value) {
|
||||
var v = safeTrim(value);
|
||||
if (/^\d{4}-\d{2}-\d{2}$/.test(v)) {
|
||||
return v.substring(8, 10) + "/" + v.substring(5, 7) + "/" + v.substring(0, 4);
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
||||
function valueOrDefault(value) {
|
||||
var v = safeTrim(value);
|
||||
return v === "" ? "Não informado" : v;
|
||||
}
|
||||
|
||||
function isValidEmail(email) {
|
||||
var v = safeTrim(email);
|
||||
if (v === "") return false;
|
||||
if (/\s/.test(v)) return false;
|
||||
|
||||
var at = v.indexOf("@");
|
||||
if (at <= 0 || at !== v.lastIndexOf("@")) return false;
|
||||
|
||||
var dot = v.lastIndexOf(".");
|
||||
return dot > at + 1 && dot < (v.length - 1);
|
||||
}
|
||||
|
||||
function safeTrim(value) {
|
||||
return String(value == null ? "" : value).trim();
|
||||
}
|
||||
</eventDescription>
|
||||
</WorkflowProcessEvent>
|
||||
<WorkflowProcessEvent>
|
||||
<workflowProcessEventPK>
|
||||
<companyId>1</companyId>
|
||||
<eventId>onNotify</eventId>
|
||||
<processId>Recrutamento e seleção</processId>
|
||||
<version>1</version>
|
||||
</workflowProcessEventPK>
|
||||
<eventDescription>function onNotify(subject, receivers, template, params) {
|
||||

|
||||
log.info("===== onNotify GLOBAL ===== Template: " + template);
|
||||

|
||||
var validos = new java.util.ArrayList();
|
||||

|
||||
for (var i = 0; i < receivers.size(); i++) {
|
||||

|
||||
var email = receivers.get(i);
|
||||

|
||||
log.info("Receiver original: [" + email + "]");
|
||||

|
||||
if (email && email.indexOf("@") > 0 && email.indexOf(".") > 0) {
|
||||
validos.add(email);
|
||||
} else {
|
||||
log.warn("REMOVIDO EMAIL INVALIDO: [" + email + "] TEMPLATE: " + template);
|
||||
}
|
||||
}
|
||||

|
||||
receivers.clear();
|
||||

|
||||
for (var j = 0; j < validos.size(); j++) {
|
||||
receivers.add(validos.get(j));
|
||||
}
|
||||

|
||||
log.info("TOTAL FINAL RECEIVERS: " + receivers.size());
|
||||
}</eventDescription>
|
||||
</WorkflowProcessEvent>
|
||||
</list>
|
||||
<list/>
|
||||
<list>
|
||||
<SwimLane>
|
||||
@@ -1089,7 +1323,7 @@
|
||||
<processLinkBendPK>
|
||||
<companyId>1</companyId>
|
||||
<processId>Recrutamento e seleção</processId>
|
||||
<version>31</version>
|
||||
<version>34</version>
|
||||
<linkSequence>5</linkSequence>
|
||||
<bendSequence>1</bendSequence>
|
||||
</processLinkBendPK>
|
||||
@@ -1100,7 +1334,7 @@
|
||||
<processLinkBendPK>
|
||||
<companyId>1</companyId>
|
||||
<processId>Recrutamento e seleção</processId>
|
||||
<version>31</version>
|
||||
<version>34</version>
|
||||
<linkSequence>5</linkSequence>
|
||||
<bendSequence>2</bendSequence>
|
||||
</processLinkBendPK>
|
||||
@@ -1111,7 +1345,7 @@
|
||||
<processLinkBendPK>
|
||||
<companyId>1</companyId>
|
||||
<processId>Recrutamento e seleção</processId>
|
||||
<version>31</version>
|
||||
<version>34</version>
|
||||
<linkSequence>7</linkSequence>
|
||||
<bendSequence>1</bendSequence>
|
||||
</processLinkBendPK>
|
||||
@@ -1122,7 +1356,7 @@
|
||||
<processLinkBendPK>
|
||||
<companyId>1</companyId>
|
||||
<processId>Recrutamento e seleção</processId>
|
||||
<version>31</version>
|
||||
<version>34</version>
|
||||
<linkSequence>110</linkSequence>
|
||||
<bendSequence>1</bendSequence>
|
||||
</processLinkBendPK>
|
||||
@@ -1133,7 +1367,7 @@
|
||||
<processLinkBendPK>
|
||||
<companyId>1</companyId>
|
||||
<processId>Recrutamento e seleção</processId>
|
||||
<version>31</version>
|
||||
<version>34</version>
|
||||
<linkSequence>115</linkSequence>
|
||||
<bendSequence>1</bendSequence>
|
||||
</processLinkBendPK>
|
||||
@@ -1144,7 +1378,7 @@
|
||||
<processLinkBendPK>
|
||||
<companyId>1</companyId>
|
||||
<processId>Recrutamento e seleção</processId>
|
||||
<version>31</version>
|
||||
<version>34</version>
|
||||
<linkSequence>117</linkSequence>
|
||||
<bendSequence>1</bendSequence>
|
||||
</processLinkBendPK>
|
||||
@@ -1155,7 +1389,7 @@
|
||||
<processLinkBendPK>
|
||||
<companyId>1</companyId>
|
||||
<processId>Recrutamento e seleção</processId>
|
||||
<version>31</version>
|
||||
<version>34</version>
|
||||
<linkSequence>120</linkSequence>
|
||||
<bendSequence>1</bendSequence>
|
||||
</processLinkBendPK>
|
||||
@@ -1300,7 +1534,7 @@
|
||||
<id>0</id>
|
||||
<tenantId>0</tenantId>
|
||||
<processId>Recrutamento e seleção</processId>
|
||||
<processVersion>31</processVersion>
|
||||
<processVersion>34</processVersion>
|
||||
<stateSequence>4</stateSequence>
|
||||
<appKey>approval</appKey>
|
||||
<appField>title</appField>
|
||||
@@ -1310,7 +1544,7 @@
|
||||
<id>0</id>
|
||||
<tenantId>0</tenantId>
|
||||
<processId>Recrutamento e seleção</processId>
|
||||
<processVersion>31</processVersion>
|
||||
<processVersion>34</processVersion>
|
||||
<stateSequence>4</stateSequence>
|
||||
<appKey>approval</appKey>
|
||||
<appField>highlight</appField>
|
||||
@@ -1320,7 +1554,7 @@
|
||||
<id>0</id>
|
||||
<tenantId>0</tenantId>
|
||||
<processId>Recrutamento e seleção</processId>
|
||||
<processVersion>31</processVersion>
|
||||
<processVersion>34</processVersion>
|
||||
<stateSequence>4</stateSequence>
|
||||
<appKey>approval</appKey>
|
||||
<appField>approve</appField>
|
||||
@@ -1330,7 +1564,7 @@
|
||||
<id>0</id>
|
||||
<tenantId>0</tenantId>
|
||||
<processId>Recrutamento e seleção</processId>
|
||||
<processVersion>31</processVersion>
|
||||
<processVersion>34</processVersion>
|
||||
<stateSequence>4</stateSequence>
|
||||
<appKey>approval</appKey>
|
||||
<appField>reject</appField>
|
||||
@@ -1340,7 +1574,7 @@
|
||||
<id>0</id>
|
||||
<tenantId>0</tenantId>
|
||||
<processId>Recrutamento e seleção</processId>
|
||||
<processVersion>31</processVersion>
|
||||
<processVersion>34</processVersion>
|
||||
<stateSequence>6</stateSequence>
|
||||
<appKey>approval</appKey>
|
||||
<appField>title</appField>
|
||||
@@ -1350,7 +1584,7 @@
|
||||
<id>0</id>
|
||||
<tenantId>0</tenantId>
|
||||
<processId>Recrutamento e seleção</processId>
|
||||
<processVersion>31</processVersion>
|
||||
<processVersion>34</processVersion>
|
||||
<stateSequence>6</stateSequence>
|
||||
<appKey>approval</appKey>
|
||||
<appField>highlight</appField>
|
||||
@@ -1360,7 +1594,7 @@
|
||||
<id>0</id>
|
||||
<tenantId>0</tenantId>
|
||||
<processId>Recrutamento e seleção</processId>
|
||||
<processVersion>31</processVersion>
|
||||
<processVersion>34</processVersion>
|
||||
<stateSequence>6</stateSequence>
|
||||
<appKey>approval</appKey>
|
||||
<appField>reject</appField>
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 44 KiB |
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
@@ -2969,7 +2969,7 @@
|
||||
<bpmn2:BpmnGateway condition="<list> <org.eclipse.bpmn2.impl.ConditionImpl> <order>1</order> <expression>hAPI.getCardValue(&quot;validarMotivo&quot;) == &quot;substituicao&quot;</expression> <targetTask>task18</targetTask> <mechanism>Campo Formulário</mechanism> <conditionType>0</conditionType> <mecanismoAtribuicaoConfiguracao class="org.eclipse.bpmn2.impl.AssignmentControllerFormField"> <formField>gestor_cc</formField> <mechanismName>Campo Formulário</mechanismName> </mecanismoAtribuicaoConfiguracao> </org.eclipse.bpmn2.impl.ConditionImpl> <org.eclipse.bpmn2.impl.ConditionImpl> <order>2</order> <expression>hAPI.getCardValue(&quot;validarMotivo&quot;) == &quot;temporario&quot;</expression> <targetTask>task18</targetTask> <mechanism>Campo Formulário</mechanism> <conditionType>0</conditionType> <mecanismoAtribuicaoConfiguracao class="org.eclipse.bpmn2.impl.AssignmentControllerFormField"> <formField>gestor_cc</formField> <mechanismName>Campo Formulário</mechanismName> </mecanismoAtribuicaoConfiguracao> </org.eclipse.bpmn2.impl.ConditionImpl> <org.eclipse.bpmn2.impl.ConditionImpl> <order>3</order> <expression>hAPI.getCardValue(&quot;validarMotivo&quot;) == &quot;aumento&quot;</expression> <targetTask>task24</targetTask> <mechanism>Pool Grupo</mechanism> <conditionType>0</conditionType> <mecanismoAtribuicaoConfiguracao class="org.eclipse.bpmn2.impl.AssignmentControllerPoolGroup"> <groupId>TIC</groupId> <mechanismName>Pool Grupo</mechanismName> </mecanismoAtribuicaoConfiguracao> </org.eclipse.bpmn2.impl.ConditionImpl> </list>" extendedFields="<list/>" id="exclusivegateway46" incoming="flow122" name="ValidarEquipamentos" outgoing="flow110 flow120" type="120"/>
|
||||
<bpmn2:BpmnEndEvent extendedFields="<list/>" id="endcancel55" incoming="flow117" name="Cancelado" notificaRequisitante="true" signalId="0" type="65"/>
|
||||
<bpmn2:BpmnTask authNotify="true" esforcoCalculo="0" executionAttempts="0" expediente="" extendedFields="<list/>" frequency="0" id="task57" incoming="flow118" loopType="0" managerAssignmentControllerString="<org.eclipse.bpmn2.impl.AssignmentControllerFormField> <formField>gestor_cc</formField> <mechanismName>Campo Formulário</mechanismName> </org.eclipse.bpmn2.impl.AssignmentControllerFormField>" managerMechanism="Campo Formulário" name="Feedback do gestor" outgoing="flow119" prazoConclusao="4320.0" selecionaColaboradores="1" type="80"/>
|
||||
<bpmn2:BpmnProcess author="" cardIndex="823" category="Recrutamento e Seleção" complementsLevel="1" deadlineTime="36000.0" descriptorFields="<list> <org.eclipse.bpmn2.impl.BpmnProcessFormField> <id>centroCusto</id> <label>centroCusto</label> <cardIndex>823 - recrutamento</cardIndex> </org.eclipse.bpmn2.impl.BpmnProcessFormField> <org.eclipse.bpmn2.impl.BpmnProcessFormField> <id>consideracoesCompras</id> <label>consideracoesCompras</label> <cardIndex>823 - recrutamento</cardIndex> </org.eclipse.bpmn2.impl.BpmnProcessFormField> <org.eclipse.bpmn2.impl.BpmnProcessFormField> <id>dataAbertura</id> <label>dataAbertura</label> <cardIndex>823 - recrutamento</cardIndex> </org.eclipse.bpmn2.impl.BpmnProcessFormField> <org.eclipse.bpmn2.impl.BpmnProcessFormField> <id>requesterId</id> <label>requesterId</label> <cardIndex>823 - recrutamento</cardIndex> </org.eclipse.bpmn2.impl.BpmnProcessFormField> <org.eclipse.bpmn2.impl.BpmnProcessFormField> <id>requesterMail</id> <label>requesterMail</label> <cardIndex>823 - recrutamento</cardIndex> </org.eclipse.bpmn2.impl.BpmnProcessFormField> <org.eclipse.bpmn2.impl.BpmnProcessFormField> <id>requesterName</id> <label>requesterName</label> <cardIndex>823 - recrutamento</cardIndex> </org.eclipse.bpmn2.impl.BpmnProcessFormField> <org.eclipse.bpmn2.impl.BpmnProcessFormField> <id>userCotacaoGestor</id> <label>userCotacaoGestor</label> <cardIndex>823 - recrutamento</cardIndex> </org.eclipse.bpmn2.impl.BpmnProcessFormField> <org.eclipse.bpmn2.impl.BpmnProcessFormField> <id>userRealizacaoCompras</id> <label>userRealizacaoCompras</label> <cardIndex>823 - recrutamento</cardIndex> </org.eclipse.bpmn2.impl.BpmnProcessFormField> <org.eclipse.bpmn2.impl.BpmnProcessFormField> <id>userValidacaoCompras</id> <label>userValidacaoCompras</label> <cardIndex>823 - recrutamento</cardIndex> </org.eclipse.bpmn2.impl.BpmnProcessFormField> <org.eclipse.bpmn2.impl.BpmnProcessFormField> <id>userValidacaoGestor</id> <label>userValidacaoGestor</label> <cardIndex>823 - recrutamento</cardIndex> </org.eclipse.bpmn2.impl.BpmnProcessFormField> <org.eclipse.bpmn2.impl.BpmnProcessFormField> <id>userValidacaoItens</id> <label>userValidacaoItens</label> <cardIndex>823 - recrutamento</cardIndex> </org.eclipse.bpmn2.impl.BpmnProcessFormField> <org.eclipse.bpmn2.impl.BpmnProcessFormField> <id>validacaoItens</id> <label>validacaoItens</label> <cardIndex>823 - recrutamento</cardIndex> </org.eclipse.bpmn2.impl.BpmnProcessFormField> <org.eclipse.bpmn2.impl.BpmnProcessFormField> <id>valorTotalsemformat</id> <label>valorTotalsemformat</label> <cardIndex>823 - recrutamento</cardIndex> </org.eclipse.bpmn2.impl.BpmnProcessFormField> <org.eclipse.bpmn2.impl.BpmnProcessFormField> <id>WKNumProces</id> <label>WKNumProces</label> <cardIndex>823 - recrutamento</cardIndex> </org.eclipse.bpmn2.impl.BpmnProcessFormField> </list>" expedient="Expediente BackOffice, Logística e Motorista" extendedFields="<list/>" formSource="server" id="Recrutamento e seleção" instruction="Este flow permite abertura de solicitação de contratação automatizadas, informando qual a função e direcionado para as aprovações corretas." keyWord="" managerAssignmentController="<org.eclipse.bpmn2.impl.AssignmentControllerGroup> <groupId>Recrutamento</groupId> <mechanismName>Grupo</mechanismName> </org.eclipse.bpmn2.impl.AssignmentControllerGroup>" managerMechanism="Grupo" mobileReady="true" name="Recrutamento e seleção" notifyRequisitionerComplements="true" notifyResponsibleComplements="true" serverId="Ginseng Produção" version="31" volume="Default"/>
|
||||
<bpmn2:BpmnProcess author="" cardIndex="823" category="Recrutamento e Seleção" complementsLevel="1" deadlineTime="36000.0" descriptorFields="<list> <org.eclipse.bpmn2.impl.BpmnProcessFormField> <id>centroCusto</id> <label>centroCusto</label> <cardIndex>823 - recrutamento</cardIndex> </org.eclipse.bpmn2.impl.BpmnProcessFormField> <org.eclipse.bpmn2.impl.BpmnProcessFormField> <id>consideracoesCompras</id> <label>consideracoesCompras</label> <cardIndex>823 - recrutamento</cardIndex> </org.eclipse.bpmn2.impl.BpmnProcessFormField> <org.eclipse.bpmn2.impl.BpmnProcessFormField> <id>dataAbertura</id> <label>dataAbertura</label> <cardIndex>823 - recrutamento</cardIndex> </org.eclipse.bpmn2.impl.BpmnProcessFormField> <org.eclipse.bpmn2.impl.BpmnProcessFormField> <id>requesterId</id> <label>requesterId</label> <cardIndex>823 - recrutamento</cardIndex> </org.eclipse.bpmn2.impl.BpmnProcessFormField> <org.eclipse.bpmn2.impl.BpmnProcessFormField> <id>requesterMail</id> <label>requesterMail</label> <cardIndex>823 - recrutamento</cardIndex> </org.eclipse.bpmn2.impl.BpmnProcessFormField> <org.eclipse.bpmn2.impl.BpmnProcessFormField> <id>requesterName</id> <label>requesterName</label> <cardIndex>823 - recrutamento</cardIndex> </org.eclipse.bpmn2.impl.BpmnProcessFormField> <org.eclipse.bpmn2.impl.BpmnProcessFormField> <id>userCotacaoGestor</id> <label>userCotacaoGestor</label> <cardIndex>823 - recrutamento</cardIndex> </org.eclipse.bpmn2.impl.BpmnProcessFormField> <org.eclipse.bpmn2.impl.BpmnProcessFormField> <id>userRealizacaoCompras</id> <label>userRealizacaoCompras</label> <cardIndex>823 - recrutamento</cardIndex> </org.eclipse.bpmn2.impl.BpmnProcessFormField> <org.eclipse.bpmn2.impl.BpmnProcessFormField> <id>userValidacaoCompras</id> <label>userValidacaoCompras</label> <cardIndex>823 - recrutamento</cardIndex> </org.eclipse.bpmn2.impl.BpmnProcessFormField> <org.eclipse.bpmn2.impl.BpmnProcessFormField> <id>userValidacaoGestor</id> <label>userValidacaoGestor</label> <cardIndex>823 - recrutamento</cardIndex> </org.eclipse.bpmn2.impl.BpmnProcessFormField> <org.eclipse.bpmn2.impl.BpmnProcessFormField> <id>userValidacaoItens</id> <label>userValidacaoItens</label> <cardIndex>823 - recrutamento</cardIndex> </org.eclipse.bpmn2.impl.BpmnProcessFormField> <org.eclipse.bpmn2.impl.BpmnProcessFormField> <id>validacaoItens</id> <label>validacaoItens</label> <cardIndex>823 - recrutamento</cardIndex> </org.eclipse.bpmn2.impl.BpmnProcessFormField> <org.eclipse.bpmn2.impl.BpmnProcessFormField> <id>valorTotalsemformat</id> <label>valorTotalsemformat</label> <cardIndex>823 - recrutamento</cardIndex> </org.eclipse.bpmn2.impl.BpmnProcessFormField> <org.eclipse.bpmn2.impl.BpmnProcessFormField> <id>WKNumProces</id> <label>WKNumProces</label> <cardIndex>823 - recrutamento</cardIndex> </org.eclipse.bpmn2.impl.BpmnProcessFormField> </list>" expedient="Expediente BackOffice, Logística e Motorista" extendedFields="<list/>" formSource="server" id="Recrutamento e seleção" instruction="Este flow permite abertura de solicitação de contratação automatizadas, informando qual a função e direcionado para as aprovações corretas." keyWord="" managerAssignmentController="<org.eclipse.bpmn2.impl.AssignmentControllerGroup> <groupId>Recrutamento</groupId> <mechanismName>Grupo</mechanismName> </org.eclipse.bpmn2.impl.AssignmentControllerGroup>" managerMechanism="Grupo" mobileReady="true" name="Recrutamento e seleção" notifyRequisitionerComplements="true" notifyResponsibleComplements="true" serverId="Ginseng Produção" version="34" volume="Default"/>
|
||||
<bpmn2:SequenceFlow atividadeFluxo="" atividadeRetorno="" extendedFields="<list/>" id="flow3" name="" sourceRef="startevent1" targetRef="exclusivegateway2"/>
|
||||
<bpmn2:SequenceFlow atividadeFluxo="" atividadeRetorno="" extendedFields="<list/>" id="flow5" movementAccessLinkDescription="" movementDescription="" movementTitle="" name="Gestor Identificado" sourceRef="exclusivegateway2" targetRef="task4"/>
|
||||
<bpmn2:SequenceFlow atividadeFluxo="" atividadeRetorno="" extendedFields="<list/>" id="flow7" name="Sem Gestor" sourceRef="exclusivegateway2" targetRef="task6"/>
|
||||
|
||||
@@ -0,0 +1,189 @@
|
||||
function beforeTaskSave(colleagueId, nextSequenceId, userList) {
|
||||
try {
|
||||
var currentState = parseInt(String(getValue("WKNumState") || "0"), 10);
|
||||
var nextState = parseInt(String(nextSequenceId || "0"), 10);
|
||||
var completeTask = String(getValue("WKCompletTask") || "false");
|
||||
log.info("[Recrutamento.beforeTaskSave] currentState=" + currentState + ", nextState=" + nextState + ", completeTask=" + completeTask);
|
||||
|
||||
if (completeTask !== "true") return;
|
||||
|
||||
// Disparo do e-mail inicial da solicitação (atividade inicial = 1).
|
||||
if (currentState === 1) {
|
||||
enviarNotificacaoSolicitacao();
|
||||
return;
|
||||
}
|
||||
|
||||
// Disparo quando a seleção define o início do colaborador.
|
||||
if (currentState === 6 && nextState === 46) {
|
||||
enviarNotificacaoInicioColaborador();
|
||||
}
|
||||
} catch (e) {
|
||||
log.error("[Recrutamento.beforeTaskSave] Erro ao disparar notificação: " + e);
|
||||
}
|
||||
}
|
||||
|
||||
function enviarNotificacaoSolicitacao() {
|
||||
var envio = montarContextoEnvio();
|
||||
if (!envio.ok) return;
|
||||
|
||||
var params = new java.util.HashMap();
|
||||
params.put("WKNumProces", envio.processNumber);
|
||||
params.put("linkSolicitacao", envio.processLink);
|
||||
params.put("link", envio.processLink);
|
||||
params.put("requesterName", valueOrDefault(hAPI.getCardValue("requesterName")));
|
||||
params.put("gestorNome", valueOrDefault(hAPI.getCardValue("gestorNome")));
|
||||
params.put("dataAbertura", valueOrDefault(hAPI.getCardValue("dataAbertura")));
|
||||
params.put("cargo", valueOrDefault(hAPI.getCardValue("funcao")));
|
||||
params.put("kitUtilizado", getKitDescricao(hAPI.getCardValue("itensinicio")));
|
||||
params.put("motivoSolicitacao", getMotivoDescricao(hAPI.getCardValue("validarMotivo")));
|
||||
params.put("justificativa", valueOrDefault(hAPI.getCardValue("justificativa")));
|
||||
|
||||
notifier.notify("admin", "tpl_recrutamento_realizada_dia", params, envio.destinatarios, "text/html");
|
||||
log.info("[Recrutamento.beforeTaskSave] tpl_recrutamento_realizada_dia enviado. processo=" + envio.processNumber + ", destinos=" + envio.destinosLog);
|
||||
}
|
||||
|
||||
function enviarNotificacaoInicioColaborador() {
|
||||
var envio = montarContextoEnvio();
|
||||
if (!envio.ok) return;
|
||||
|
||||
var dataInicio = safeTrim(hAPI.getCardValue("datainiciotrabalho"));
|
||||
if (dataInicio === "") {
|
||||
log.warn("[Recrutamento.beforeTaskSave] Data de início vazia. Notificação de início não enviada.");
|
||||
return;
|
||||
}
|
||||
|
||||
var params = new java.util.HashMap();
|
||||
params.put("WKNumProces", envio.processNumber);
|
||||
params.put("linkSolicitacao", envio.processLink);
|
||||
params.put("link", envio.processLink);
|
||||
params.put("colaboradorNome", valueOrDefault(hAPI.getCardValue("nomedocandidato")));
|
||||
params.put("cargo", valueOrDefault(hAPI.getCardValue("funcao")));
|
||||
params.put("dataInicio", formatDateBr(dataInicio));
|
||||
params.put("kitUtilizado", getKitDescricao(hAPI.getCardValue("itensinicio")));
|
||||
|
||||
notifier.notify("admin", "tpl_recrutamento_realizada", params, envio.destinatarios, "text/html");
|
||||
log.info("[Recrutamento.beforeTaskSave] tpl_recrutamento_realizada enviado. processo=" + envio.processNumber + ", destinos=" + envio.destinosLog);
|
||||
}
|
||||
|
||||
function montarContextoEnvio() {
|
||||
var destinatarios = new java.util.ArrayList();
|
||||
var jaAdicionados = {};
|
||||
|
||||
addEmail(destinatarios, jaAdicionados, "tic@grupoginseng.com.br");
|
||||
|
||||
var requesterId = safeTrim(hAPI.getCardValue("requesterId"));
|
||||
if (requesterId !== "") {
|
||||
addEmail(destinatarios, jaAdicionados, resolveEmailByColleagueId(requesterId));
|
||||
}
|
||||
|
||||
if (destinatarios.isEmpty()) {
|
||||
log.warn("[Recrutamento.beforeTaskSave] Nenhum e-mail válido encontrado para notificação.");
|
||||
return { ok: false };
|
||||
}
|
||||
|
||||
var processNumber = safeTrim(getValue("WKNumProces"));
|
||||
var processLink = buildProcessLink(processNumber);
|
||||
|
||||
return {
|
||||
ok: true,
|
||||
processNumber: processNumber,
|
||||
processLink: processLink,
|
||||
destinatarios: destinatarios,
|
||||
destinosLog: String(destinatarios.toString())
|
||||
};
|
||||
}
|
||||
|
||||
function addEmail(destinatarios, jaAdicionados, email) {
|
||||
var v = safeTrim(email).toLowerCase();
|
||||
if (!isValidEmail(v)) return;
|
||||
if (jaAdicionados[v]) return;
|
||||
|
||||
destinatarios.add(v);
|
||||
jaAdicionados[v] = true;
|
||||
}
|
||||
|
||||
function resolveEmailByColleagueId(colleagueId) {
|
||||
var id = safeTrim(colleagueId);
|
||||
if (id === "") return "";
|
||||
|
||||
try {
|
||||
var cActive = DatasetFactory.createConstraint("active", "true", "true", ConstraintType.MUST);
|
||||
|
||||
var cId = DatasetFactory.createConstraint("colleaguePK.colleagueId", id, id, ConstraintType.MUST);
|
||||
var byId = DatasetFactory.getDataset("colleague", null, [cId, cActive], null);
|
||||
if (byId && byId.rowsCount > 0) {
|
||||
return safeTrim(byId.getValue(0, "mail"));
|
||||
}
|
||||
|
||||
var cLogin = DatasetFactory.createConstraint("login", id, id, ConstraintType.MUST);
|
||||
var byLogin = DatasetFactory.getDataset("colleague", null, [cLogin, cActive], null);
|
||||
if (byLogin && byLogin.rowsCount > 0) {
|
||||
return safeTrim(byLogin.getValue(0, "mail"));
|
||||
}
|
||||
} catch (e) {
|
||||
log.warn("[Recrutamento.beforeTaskSave] Falha ao buscar e-mail por colleagueId: " + e);
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
function buildProcessLink(processNumber) {
|
||||
var baseUrl = safeTrim(getValue("WKServerURL"));
|
||||
var companyId = safeTrim(getValue("WKCompany"));
|
||||
|
||||
if (baseUrl === "" || processNumber === "") return "";
|
||||
if (baseUrl.indexOf("http://") !== 0 && baseUrl.indexOf("https://") !== 0) {
|
||||
baseUrl = "https://" + baseUrl;
|
||||
}
|
||||
if (baseUrl.charAt(baseUrl.length - 1) === "/") {
|
||||
baseUrl = baseUrl.substring(0, baseUrl.length - 1);
|
||||
}
|
||||
if (companyId === "") companyId = "1";
|
||||
|
||||
return baseUrl + "/portal/p/" + companyId + "/pageworkflowview?app_ecm_workflowview_detailsProcessInstanceID=" + processNumber;
|
||||
}
|
||||
|
||||
function getMotivoDescricao(motivo) {
|
||||
var v = safeTrim(motivo).toLowerCase();
|
||||
if (v === "aumento") return "Aumento de quadro";
|
||||
if (v === "substituicao") return "Substituição";
|
||||
if (v === "temporario") return "Temporário";
|
||||
return v === "" ? "Não informado" : v;
|
||||
}
|
||||
|
||||
function getKitDescricao(kit) {
|
||||
var v = safeTrim(kit).toLowerCase();
|
||||
if (v === "backoffice") return "Kit Backoffice (Notebook, mouse, teclado e headset)";
|
||||
if (v === "amg") return "Kit AMG (Notebook, kit mouse e teclado, headset e telefone corporativo)";
|
||||
if (v === "comercial") return "Kit Comercial (Mobshop e Mobpin)";
|
||||
return v === "" ? "Não informado" : v;
|
||||
}
|
||||
|
||||
function formatDateBr(value) {
|
||||
var v = safeTrim(value);
|
||||
if (/^\d{4}-\d{2}-\d{2}$/.test(v)) {
|
||||
return v.substring(8, 10) + "/" + v.substring(5, 7) + "/" + v.substring(0, 4);
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
||||
function valueOrDefault(value) {
|
||||
var v = safeTrim(value);
|
||||
return v === "" ? "Não informado" : v;
|
||||
}
|
||||
|
||||
function isValidEmail(email) {
|
||||
var v = safeTrim(email);
|
||||
if (v === "") return false;
|
||||
if (/\s/.test(v)) return false;
|
||||
|
||||
var at = v.indexOf("@");
|
||||
if (at <= 0 || at !== v.lastIndexOf("@")) return false;
|
||||
|
||||
var dot = v.lastIndexOf(".");
|
||||
return dot > at + 1 && dot < (v.length - 1);
|
||||
}
|
||||
|
||||
function safeTrim(value) {
|
||||
return String(value == null ? "" : value).trim();
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
function onNotify(subject, receivers, template, params) {
|
||||
|
||||
log.info("===== onNotify GLOBAL ===== Template: " + template);
|
||||
|
||||
var validos = new java.util.ArrayList();
|
||||
|
||||
for (var i = 0; i < receivers.size(); i++) {
|
||||
|
||||
var email = receivers.get(i);
|
||||
|
||||
log.info("Receiver original: [" + email + "]");
|
||||
|
||||
if (email && email.indexOf("@") > 0 && email.indexOf(".") > 0) {
|
||||
validos.add(email);
|
||||
} else {
|
||||
log.warn("REMOVIDO EMAIL INVALIDO: [" + email + "] TEMPLATE: " + template);
|
||||
}
|
||||
}
|
||||
|
||||
receivers.clear();
|
||||
|
||||
for (var j = 0; j < validos.size(); j++) {
|
||||
receivers.add(validos.get(j));
|
||||
}
|
||||
|
||||
log.info("TOTAL FINAL RECEIVERS: " + receivers.size());
|
||||
}
|
||||
Reference in New Issue
Block a user