protected void addBcc(Email email, String bcc) { String[] bccs = splitAndTrim(bcc); if (bccs != null) { for (String b : bccs) { try { email.addBcc(b); } catch (EmailException e) { throw LOG.addBccException(b, e); } } } }
protected void addCc(Email email, String cc) { String[] ccs = splitAndTrim(cc); if (ccs != null) { for (String c : ccs) { try { email.addCc(c); } catch (EmailException e) { throw LOG.addCcException(c, e); } } } }
protected void addTo(Email email, String to) { String[] tos = splitAndTrim(to); if (tos != null) { for (String t : tos) { try { email.addTo(t); } catch (EmailException e) { throw LOG.addRecipientException(t, e); } } } else { throw LOG.missingRecipientsException(); } }
if (activatesGateway(execution, activity)) { LOG.activityActivation(activity.getId()); PvmTransition defaultTransition = execution.getActivity().findOutgoingTransition(defaultSequenceFlow); if (defaultTransition == null) { throw LOG.missingDefaultFlowException(execution.getActivity().getId(), defaultSequenceFlow); throw LOG.stuckExecutionException(execution.getActivity().getId()); LOG.noActivityActivation(activity.getId());
public void execute(ActivityExecution execution) throws Exception { // Join PvmActivity activity = execution.getActivity(); List<PvmTransition> outgoingTransitions = execution.getActivity().getOutgoingTransitions(); execution.inactivate(); lockConcurrentRoot(execution); List<ActivityExecution> joinedExecutions = execution.findInactiveConcurrentExecutions(activity); int nbrOfExecutionsToJoin = execution.getActivity().getIncomingTransitions().size(); int nbrOfExecutionsJoined = joinedExecutions.size(); if (nbrOfExecutionsJoined==nbrOfExecutionsToJoin) { // Fork LOG.activityActivation(activity.getId(), nbrOfExecutionsJoined, nbrOfExecutionsToJoin); execution.leaveActivityViaTransitions(outgoingTransitions, joinedExecutions); } else { LOG.noActivityActivation(activity.getId(), nbrOfExecutionsJoined, nbrOfExecutionsToJoin); } }
protected SimpleEmail createTextOnlyEmail(String text) { SimpleEmail email = new SimpleEmail(); try { email.setMsg(text); return email; } catch (EmailException e) { throw LOG.emailCreationException("text-only", e); } }
public static boolean eventSubprocessComplete(ActivityExecution scopeExecution) { boolean performLegacyBehavior = isLegacyBehaviorRequired(scopeExecution); if(performLegacyBehavior) { LOG.completeNonScopeEventSubprocess(); scopeExecution.end(false); } return performLegacyBehavior; }
protected void setFrom(Email email, String from) { String fromAddress = null; if (from != null) { fromAddress = from; } else { // use default configured from address in process engine config fromAddress = Context.getProcessEngineConfiguration().getMailServerDefaultFrom(); } try { email.setFrom(fromAddress); } catch (EmailException e) { throw LOG.addSenderException(from, e); } }
/** * Destroys a concurrent scope Execution. This can only happen if * (a) the process instance has been migrated from a previous version to a 7.3+ version of the process engine * * See: javadoc of this class for note about concurrent scopes. * * @param execution the execution to destroy */ public static void destroyConcurrentScope(PvmExecutionImpl execution) { ensureConcurrentScope(execution); LOG.destroyConcurrentScopeExecution(execution); execution.destroy(); }
/** * Prunes a concurrent scope. This can only happen if * (a) the process instance has been migrated from a previous version to a new version of the process engine * * This is an inverse operation to {@link #createConcurrentScope(PvmExecutionImpl)}. * * See: javadoc of this class for note about concurrent scopes. * * @param execution */ public static void pruneConcurrentScope(PvmExecutionImpl execution) { ensureConcurrentScope(execution); LOG.debugConcurrentScopeIsPruned(execution); execution.setConcurrent(false); }
/** * Cancels an execution which is both concurrent and scope. This can only happen if * (a) the process instance has been migrated from a previous version to a new version of the process engine * * See: javadoc of this class for note about concurrent scopes. * * @param execution the concurrent scope execution to destroy * @param cancelledScopeActivity the activity that cancels the execution; it must hold that * cancellingActivity's event scope is the scope the execution is responsible for */ public static void cancelConcurrentScope(PvmExecutionImpl execution, PvmActivity cancelledScopeActivity) { ensureConcurrentScope(execution); LOG.debugCancelConcurrentScopeExecution(execution); execution.interrupt("Scope "+cancelledScopeActivity+" cancelled."); // <!> HACK set to event scope activity and leave activity instance execution.setActivity(cancelledScopeActivity); execution.leaveActivityInstance(); execution.interrupt("Scope "+cancelledScopeActivity+" cancelled."); execution.destroy(); }
if (activatesGateway(execution, activity)) { LOG.activityActivation(activity.getId()); PvmTransition defaultTransition = execution.getActivity().findOutgoingTransition(defaultSequenceFlow); if (defaultTransition == null) { throw LOG.missingDefaultFlowException(execution.getActivity().getId(), defaultSequenceFlow); throw LOG.stuckExecutionException(execution.getActivity().getId()); LOG.noActivityActivation(activity.getId());
public void execute(ActivityExecution execution) throws Exception { // Join PvmActivity activity = execution.getActivity(); List<PvmTransition> outgoingTransitions = execution.getActivity().getOutgoingTransitions(); execution.inactivate(); lockConcurrentRoot(execution); List<ActivityExecution> joinedExecutions = execution.findInactiveConcurrentExecutions(activity); int nbrOfExecutionsToJoin = execution.getActivity().getIncomingTransitions().size(); int nbrOfExecutionsJoined = joinedExecutions.size(); if (nbrOfExecutionsJoined==nbrOfExecutionsToJoin) { // Fork LOG.activityActivation(activity.getId(), nbrOfExecutionsJoined, nbrOfExecutionsToJoin); execution.leaveActivityViaTransitions(outgoingTransitions, joinedExecutions); } else { LOG.noActivityActivation(activity.getId(), nbrOfExecutionsJoined, nbrOfExecutionsToJoin); } }
protected SimpleEmail createTextOnlyEmail(String text) { SimpleEmail email = new SimpleEmail(); try { email.setMsg(text); return email; } catch (EmailException e) { throw LOG.emailCreationException("text-only", e); } }
public static boolean eventSubprocessComplete(ActivityExecution scopeExecution) { boolean performLegacyBehavior = isLegacyBehaviorRequired(scopeExecution); if(performLegacyBehavior) { LOG.completeNonScopeEventSubprocess(); scopeExecution.end(false); } return performLegacyBehavior; }
protected void setFrom(Email email, String from) { String fromAddress = null; if (from != null) { fromAddress = from; } else { // use default configured from address in process engine config fromAddress = Context.getProcessEngineConfiguration().getMailServerDefaultFrom(); } try { email.setFrom(fromAddress); } catch (EmailException e) { throw LOG.addSenderException(from, e); } }
/** * Destroys a concurrent scope Execution. This can only happen if * (a) the process instance has been migrated from a previous version to a 7.3+ version of the process engine * * See: javadoc of this class for note about concurrent scopes. * * @param execution the execution to destroy */ public static void destroyConcurrentScope(PvmExecutionImpl execution) { ensureConcurrentScope(execution); LOG.destroyConcurrentScopeExecution(execution); execution.destroy(); }
/** * Prunes a concurrent scope. This can only happen if * (a) the process instance has been migrated from a previous version to a new version of the process engine * * This is an inverse operation to {@link #createConcurrentScope(PvmExecutionImpl)}. * * See: javadoc of this class for note about concurrent scopes. * * @param execution */ public static void pruneConcurrentScope(PvmExecutionImpl execution) { ensureConcurrentScope(execution); LOG.debugConcurrentScopeIsPruned(execution); execution.setConcurrent(false); }
/** * Cancels an execution which is both concurrent and scope. This can only happen if * (a) the process instance has been migrated from a previous version to a new version of the process engine * * See: javadoc of this class for note about concurrent scopes. * * @param execution the concurrent scope execution to destroy * @param cancelledScopeActivity the activity that cancels the execution; it must hold that * cancellingActivity's event scope is the scope the execution is responsible for */ public static void cancelConcurrentScope(PvmExecutionImpl execution, PvmActivity cancelledScopeActivity) { ensureConcurrentScope(execution); LOG.debugCancelConcurrentScopeExecution(execution); execution.interrupt("Scope "+cancelledScopeActivity+" cancelled."); // <!> HACK set to event scope activity and leave activity instance execution.setActivity(cancelledScopeActivity); execution.leaveActivityInstance(); execution.interrupt("Scope "+cancelledScopeActivity+" cancelled."); execution.destroy(); }
if (activatesGateway(execution, activity)) { LOG.activityActivation(activity.getId()); PvmTransition defaultTransition = execution.getActivity().findOutgoingTransition(defaultSequenceFlow); if (defaultTransition == null) { throw LOG.missingDefaultFlowException(execution.getActivity().getId(), defaultSequenceFlow); throw LOG.stuckExecutionException(execution.getActivity().getId()); LOG.noActivityActivation(activity.getId());