Regra por Processo 807 - Ação sobre a Solicitação de Abertura de Vaga

É executada após executar uma das ações (Encaminhar, Cancelar, Aprovar, Rejeitar ou Solicitar alteração) sobre a solicitação de abertura de vaga.

Recursos utilizados: Estará disponível somente para consulta o registro da tabela R126SVA.

Comando Cancel: Através dessa regra é possível cancelar o processo usando Cancel(1) ou mensagem (Erro, “mensagem”).

Exemplo 1:

<div class="Code"><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;">Definir Alfa aTexto;</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;">Definir Alfa aQuebra;</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;">Definir Alfa aEmaPar;</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;">Definir Alfa aEmaCom;</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;">Definir Alfa aAssunto;</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;">Definir Alfa aCodSva;</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;"></p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;">IntParaAlfa(R126SVA.CodSva, aCodSva);</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;"></p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;">@ Busca o colaborador associado ao usuário responsável pela solicitação @</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;">RetColabPorCodUsu(R126SVA.UsuRes, xNumEmp, xTipCol, xNumCad);</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;">@ Busca e-mail do responsável pela solicitacao @</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;">BusEmailFunc(xNumEmp, xTipCol, xNumCad, aEmaPar, aEmaCom);</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;"></p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;">@ Avisa responsável quando Solicitação de vaga é Aprovada, Rejeitada, Cancelada ou aprovador Solicita alteração @</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;">Se ((R126SVA.SitSva = 3) ou (R126SVA.SitSva = 4) ou (R126SVA.SitSva = 5) ou (R126SVA.SitSva = 6))</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;">Inicio</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;margin-left: 30px;">Se (R126SVA.SitSva = 3)</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;margin-left: 30px;">Inicio</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;margin-left: 60px;">aAssunto = "Solicitação de Alteração de Solicitação de Vaga";</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;margin-left: 60px;">aTexto = "Você tem pendente alteração da solicitação de vaga número " + aCodSva + ".";</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;margin-left: 30px;">Fim</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;margin-left: 30px;">Senao</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;margin-left: 30px;">Se (R126SVA.SitSva = 4)</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;margin-left: 30px;">Inicio</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;margin-left: 60px;">aAssunto = "Solicitação de Vaga aprovada";</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;margin-left: 60px;">aTexto = "A solicitação de vaga número " + aCodSva + " foi Aprovada.";</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;margin-left: 30px;">Fim</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;margin-left: 30px;">Senao</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;margin-left: 30px;">Se (R126SVA.SitSva = 5)</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;margin-left: 30px;">Inicio</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;margin-left: 60px;">aAssunto = "Solicitação de Vaga Rejeitada";</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;margin-left: 60px;">aTexto = "A solicitação de vaga número " + aCodSva + " foi Rejeitada.";</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;margin-left: 30px;">Fim</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;margin-left: 30px;">Senao</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;margin-left: 30px;">Se (R126SVA.SitSva = 6)</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;margin-left: 30px;">Inicio</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;margin-left: 60px;">aAssunto = "Solicitação de Vaga Cancelada";</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;margin-left: 60px;">aTexto = "A solicitação de vaga número " + aCodSva + " foi Cancelada.";</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;margin-left: 30px;">Fim;</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;margin-left: 30px;"></p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;margin-left: 30px;">EnviaEmail("remetente@senior.com.br", aEmaCom, "", "", aAssunto, aTexto, "", 0);</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;">Fim</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;">Senao</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;">@ Avisa aprovador quando Solicitação de vaga é Encaminhada ou Aprovada e ainda existem aprovadores @</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;">Se (R126SVA.SitSva = 2)</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;">Inicio</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;margin-left: 30px;">xCodSva = R126SVA.CodSva;</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;margin-left: 30px;"></p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;margin-left: 30px;">Definir Cursor Cur_R126RSV;</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;margin-left: 30px;">Cur_R126RSV.SQL "SELECT NUMCAD FROM R126RSV WHERE CODSVA = :xCodSva AND SITRSV = 1";</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;margin-left: 30px;">Cur_R126RSV.AbrirCursor();</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;margin-left: 30px;">Se (Cur_R126RSV.Achou)</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;margin-left: 30px;">Inicio</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;margin-left: 60px;">aAssunto = "Aprovação de Solicitação de Vaga";</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;margin-left: 60px;">aTexto = "Você tem pendente aprovação da solicitação de vaga número " + aCodSva + ". Favor acessar o Portal, caminho XXXXX. " + aQuebra;</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;margin-left: 60px;">aTexto = aTexto + " " + aQuebra;</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;margin-left: 60px;">aTexto = aTexto + " Desenvolvimento Humano e Organizacional," + aQuebra;</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;margin-left: 60px;">aTexto = aTexto + " Recrutamento &#x26; Seleção" + aQuebra;</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;margin-left: 60px;">EnviaEmail("remetente@senior.com.br", aEmaCom, "", "", aAssunto, aTexto, "", 0);</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;margin-left: 30px;">Fim;</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;margin-left: 30px;">Cur_R126RSV.FecharCursor();</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;">Fim;</p></div>

Exemplo 2:

<div class="Code"><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;">Definir Cursor Cur_R034USU;</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;"></p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;">xCodUsu = 0;</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;">xCodSva = R126SVA.CodSva;</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;">xSitSva = R126SVA.SitSVa;</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;"></p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;">@ Busca o colaborador associado ao usuário responsável pela solicitação @</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;">RetColabPorCodUsu(R126SVA.UsuRes, xNumEmp, xTipCol, xNumCad);</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;"></p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;">Cur_R034USU.SQL "SELECT CODUSU FROM R034USU \</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;margin-left: 180px;">WHERE NUMEMP = :xNumEmp \</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;margin-left: 200px;">AND TIPCOL = :xTipCol \</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;margin-left: 200px;">AND NUMCAD = :xNumCad \</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;margin-left: 200px;">AND CRIUSU &#x3C;> 1 \</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;margin-left: 180px;">ORDER BY CODUSU";</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;">Cur_R034USU.AbrirCursor();</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;">Se (Cur_R034USU.Achou)</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;margin-left: 30px;">xCodUsu = Cur_R034USU.CodUsu;</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;">Cur_R034USU.FecharCursor();</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;"></p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;">se ((xCodUsu &#x3C;> 0) e (xCodUsu &#x3C;> R126SVA.UsuRes))</p><p style="font-family: 'Courier New';margin-bottom: 0;margin-top: 0;margin-left: 30px;">ExecSQL "UPDATE R126SVA SET USURES = :xCodUsu WHERE CODSVA = :xCodSva";</p></div>

Utilização: Rotina de solicitação de vaga.

Disponível para o módulo: RS.

Este artigo ajudou você?