Commit 09a471883b1dd224ac9063cc6217b92687dcda15
Exists in
master
Merge branch 'tarefa-306.0.0.1' into desenvolvimento
Showing
1 changed file
with
38 additions
and
11 deletions
Show diff stats
cit-ecm-api/src/main/java/br/com/centralit/api/service/impl/AnexarProcessoServiceImpl.java
@@ -16,6 +16,9 @@ import br.com.centralit.api.service.AnexoGedService; | @@ -16,6 +16,9 @@ import br.com.centralit.api.service.AnexoGedService; | ||
16 | import br.com.centralit.api.service.DocumentoGedService; | 16 | import br.com.centralit.api.service.DocumentoGedService; |
17 | import br.com.centralit.api.service.ProcessoService; | 17 | import br.com.centralit.api.service.ProcessoService; |
18 | import br.com.centralit.api.viewHelper.AnexarProcessoVH; | 18 | import br.com.centralit.api.viewHelper.AnexarProcessoVH; |
19 | +import br.com.centralit.framework.esi.enumerated.EventTargetEnum; | ||
20 | +import br.com.centralit.framework.esi.environment.EnvironmentVariable; | ||
21 | +import br.com.centralit.framework.esi.environment.SignalEventInput; | ||
19 | import br.com.centralit.framework.exception.BusinessException; | 22 | import br.com.centralit.framework.exception.BusinessException; |
20 | import br.com.centralit.framework.exception.CodigoErro; | 23 | import br.com.centralit.framework.exception.CodigoErro; |
21 | import br.com.centralit.framework.service.arquitetura.GedFileService; | 24 | import br.com.centralit.framework.service.arquitetura.GedFileService; |
@@ -129,23 +132,20 @@ public class AnexarProcessoServiceImpl extends GenericServiceImpl<AnexoProcesso, | @@ -129,23 +132,20 @@ public class AnexarProcessoServiceImpl extends GenericServiceImpl<AnexoProcesso, | ||
129 | listProcesso.add(processoFilho); | 132 | listProcesso.add(processoFilho); |
130 | } | 133 | } |
131 | 134 | ||
132 | - if (listProcesso.isEmpty()) { | ||
133 | - // Vincula o processo filho ao pai | ||
134 | - this.vincularProcesso(processoPai, processoFilho); | 135 | + if (!listProcesso.isEmpty()) { |
136 | + if (!UtilColecao.isVazio(processoFilho.getDocumentos())) { | ||
137 | + // Vincula o processo filho ao pai | ||
138 | + this.vincularProcesso(processoPai, processoFilho); | ||
135 | 139 | ||
136 | - // Realiza o vinculo inverso, o pai vira filho e o filho vira pai. | ||
137 | - this.vincularProcesso(processoFilho, processoPai); | 140 | + // Realiza o vinculo inverso, o pai vira filho e o filho vira pai. |
141 | + this.vincularProcesso(processoFilho, processoPai); | ||
138 | 142 | ||
139 | - if (!UtilColecao.isVazio(processoFilho.getDocumentos())) { | ||
140 | documentoGedService.anexarDocumento(processoFilho, anexarProcessoVH); | 143 | documentoGedService.anexarDocumento(processoFilho, anexarProcessoVH); |
141 | -// SignalEventInput input = new SignalEventInput(EventTargetEnum.PROCESS_INSTANCE, "FINALIZAR_PROCESSO_SIGAD", "PROGRESSAOCLASSE", null, false); | ||
142 | -// | ||
143 | -// input.setProcessInstanceId(Long.valueOf("61857")); | ||
144 | -// this.signalEvent(input); | ||
145 | - | 144 | + |
146 | } | 145 | } |
147 | } | 146 | } |
148 | 147 | ||
148 | + this.finalizeProcesso("FINALIZAR_PROCESSO_SIGAD", false, processoFilho.getIdProcessInstance()); | ||
149 | this.processoService.atualizarTemporalidadeProcessoAnexado(processoPai, processoFilho); | 149 | this.processoService.atualizarTemporalidadeProcessoAnexado(processoPai, processoFilho); |
150 | 150 | ||
151 | } | 151 | } |
@@ -157,6 +157,33 @@ public class AnexarProcessoServiceImpl extends GenericServiceImpl<AnexoProcesso, | @@ -157,6 +157,33 @@ public class AnexarProcessoServiceImpl extends GenericServiceImpl<AnexoProcesso, | ||
157 | } | 157 | } |
158 | return anexarProcessoVH; | 158 | return anexarProcessoVH; |
159 | } | 159 | } |
160 | + | ||
161 | + | ||
162 | + /** | ||
163 | + * | ||
164 | + * <p><b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a></p> | ||
165 | + * | ||
166 | + * <p><b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a></p> | ||
167 | + * | ||
168 | + * Método responsável por finalizar o processo | ||
169 | + * | ||
170 | + * @author andre.silva | ||
171 | + * | ||
172 | + * @param eventTarget | ||
173 | + * @param eventName | ||
174 | + * @param flowName | ||
175 | + * @param inputVariables | ||
176 | + * @param synchronous | ||
177 | + * @param processId | ||
178 | + */ | ||
179 | + private void finalizeProcesso(String eventName, boolean synchronous, Long processId){ | ||
180 | + this.startNodeWithSignalEvent(eventName, processId, false, null); | ||
181 | +// SignalEventInput input = new SignalEventInput(eventTarget, eventName, flowName, null, false); | ||
182 | +// input.setProcessInstanceId(processId); | ||
183 | +// this.signalEvent(input); | ||
184 | + } | ||
185 | + | ||
186 | + | ||
160 | 187 | ||
161 | /** | 188 | /** |
162 | * <p> | 189 | * <p> |