protected void prepareScope(ActivityExecution scopeExecution, int totalNumberOfInstances) { setLoopVariable(scopeExecution, NUMBER_OF_INSTANCES, totalNumberOfInstances); setLoopVariable(scopeExecution, NUMBER_OF_COMPLETED_INSTANCES, 0); }
protected void prepareScope(ActivityExecution scopeExecution, int totalNumberOfInstances) { setLoopVariable(scopeExecution, NUMBER_OF_INSTANCES, totalNumberOfInstances); setLoopVariable(scopeExecution, NUMBER_OF_COMPLETED_INSTANCES, 0); }
public List<ActivityExecution> initializeScope(ActivityExecution scopeExecution, int nrOfInstances) { if (nrOfInstances > 1) { LOG.unsupportedConcurrencyException(scopeExecution.toString(), this.getClass().getSimpleName()); } List<ActivityExecution> executions = new ArrayList<ActivityExecution>(); prepareScope(scopeExecution, nrOfInstances); setLoopVariable(scopeExecution, NUMBER_OF_ACTIVE_INSTANCES, nrOfInstances); if (nrOfInstances > 0) { setLoopVariable(scopeExecution, LOOP_COUNTER, 0); executions.add(scopeExecution); } return executions; }
public List<ActivityExecution> initializeScope(ActivityExecution scopeExecution, int nrOfInstances) { if (nrOfInstances > 1) { LOG.unsupportedConcurrencyException(scopeExecution.toString(), this.getClass().getSimpleName()); } List<ActivityExecution> executions = new ArrayList<ActivityExecution>(); prepareScope(scopeExecution, nrOfInstances); setLoopVariable(scopeExecution, NUMBER_OF_ACTIVE_INSTANCES, nrOfInstances); if (nrOfInstances > 0) { setLoopVariable(scopeExecution, LOOP_COUNTER, 0); executions.add(scopeExecution); } return executions; }
@Override public ActivityExecution createInnerInstance(ActivityExecution scopeExecution) { if (hasLoopVariable(scopeExecution, NUMBER_OF_ACTIVE_INSTANCES) && getLoopVariable(scopeExecution, NUMBER_OF_ACTIVE_INSTANCES) > 0) { throw LOG.unsupportedConcurrencyException(scopeExecution.toString(), this.getClass().getSimpleName()); } else { int nrOfInstances = getLoopVariable(scopeExecution, NUMBER_OF_INSTANCES); setLoopVariable(scopeExecution, LOOP_COUNTER, nrOfInstances); setLoopVariable(scopeExecution, NUMBER_OF_INSTANCES, nrOfInstances + 1); setLoopVariable(scopeExecution, NUMBER_OF_ACTIVE_INSTANCES, 1); } return scopeExecution; }
@Override public ActivityExecution createInnerInstance(ActivityExecution scopeExecution) { if (hasLoopVariable(scopeExecution, NUMBER_OF_ACTIVE_INSTANCES) && getLoopVariable(scopeExecution, NUMBER_OF_ACTIVE_INSTANCES) > 0) { throw LOG.unsupportedConcurrencyException(scopeExecution.toString(), this.getClass().getSimpleName()); } else { int nrOfInstances = getLoopVariable(scopeExecution, NUMBER_OF_INSTANCES); setLoopVariable(scopeExecution, LOOP_COUNTER, nrOfInstances); setLoopVariable(scopeExecution, NUMBER_OF_INSTANCES, nrOfInstances + 1); setLoopVariable(scopeExecution, NUMBER_OF_ACTIVE_INSTANCES, 1); } return scopeExecution; }
@Override public void destroyInnerInstance(ActivityExecution scopeExecution) { removeLoopVariable(scopeExecution, LOOP_COUNTER); int nrOfActiveInstances = getLoopVariable(scopeExecution, NUMBER_OF_ACTIVE_INSTANCES); setLoopVariable(scopeExecution, NUMBER_OF_ACTIVE_INSTANCES, nrOfActiveInstances - 1); }
@Override public void destroyInnerInstance(ActivityExecution scopeExecution) { removeLoopVariable(scopeExecution, LOOP_COUNTER); int nrOfActiveInstances = getLoopVariable(scopeExecution, NUMBER_OF_ACTIVE_INSTANCES); setLoopVariable(scopeExecution, NUMBER_OF_ACTIVE_INSTANCES, nrOfActiveInstances - 1); }
@Override protected void createInstances(ActivityExecution execution, int nrOfInstances) throws Exception { prepareScope(execution, nrOfInstances); setLoopVariable(execution, NUMBER_OF_ACTIVE_INSTANCES, 1); ActivityImpl innerActivity = getInnerActivity(execution.getActivity()); performInstance(execution, innerActivity, 0); }
@Override protected void createInstances(ActivityExecution execution, int nrOfInstances) throws Exception { prepareScope(execution, nrOfInstances); setLoopVariable(execution, NUMBER_OF_ACTIVE_INSTANCES, 1); ActivityImpl innerActivity = getInnerActivity(execution.getActivity()); performInstance(execution, innerActivity, 0); }
public void complete(ActivityExecution scopeExecution) { int loopCounter = getLoopVariable(scopeExecution, LOOP_COUNTER) + 1; int nrOfInstances = getLoopVariable(scopeExecution, NUMBER_OF_INSTANCES); int nrOfCompletedInstances = getLoopVariable(scopeExecution, NUMBER_OF_COMPLETED_INSTANCES) + 1; setLoopVariable(scopeExecution, NUMBER_OF_COMPLETED_INSTANCES, nrOfCompletedInstances); if (loopCounter == nrOfInstances || completionConditionSatisfied(scopeExecution)) { leave(scopeExecution); } else { PvmActivity innerActivity = getInnerActivity(scopeExecution.getActivity()); performInstance(scopeExecution, innerActivity, loopCounter); } }
public void complete(ActivityExecution scopeExecution) { int loopCounter = getLoopVariable(scopeExecution, LOOP_COUNTER) + 1; int nrOfInstances = getLoopVariable(scopeExecution, NUMBER_OF_INSTANCES); int nrOfCompletedInstances = getLoopVariable(scopeExecution, NUMBER_OF_COMPLETED_INSTANCES) + 1; setLoopVariable(scopeExecution, NUMBER_OF_COMPLETED_INSTANCES, nrOfCompletedInstances); if (loopCounter == nrOfInstances || completionConditionSatisfied(scopeExecution)) { leave(scopeExecution); } else { PvmActivity innerActivity = getInnerActivity(scopeExecution.getActivity()); performInstance(scopeExecution, innerActivity, loopCounter); } }
protected void prepareScope(ActivityExecution scopeExecution, int totalNumberOfInstances) { setLoopVariable(scopeExecution, NUMBER_OF_INSTANCES, totalNumberOfInstances); setLoopVariable(scopeExecution, NUMBER_OF_COMPLETED_INSTANCES, 0); }
public List<ActivityExecution> initializeScope(ActivityExecution scopeExecution, int nrOfInstances) { if (nrOfInstances > 1) { LOG.unsupportedConcurrencyException(scopeExecution.toString(), this.getClass().getSimpleName()); } List<ActivityExecution> executions = new ArrayList<ActivityExecution>(); prepareScope(scopeExecution, nrOfInstances); setLoopVariable(scopeExecution, NUMBER_OF_ACTIVE_INSTANCES, nrOfInstances); if (nrOfInstances > 0) { setLoopVariable(scopeExecution, LOOP_COUNTER, 0); executions.add(scopeExecution); } return executions; }
@Override public ActivityExecution createInnerInstance(ActivityExecution scopeExecution) { if (hasLoopVariable(scopeExecution, NUMBER_OF_ACTIVE_INSTANCES) && getLoopVariable(scopeExecution, NUMBER_OF_ACTIVE_INSTANCES) > 0) { throw LOG.unsupportedConcurrencyException(scopeExecution.toString(), this.getClass().getSimpleName()); } else { int nrOfInstances = getLoopVariable(scopeExecution, NUMBER_OF_INSTANCES); setLoopVariable(scopeExecution, LOOP_COUNTER, nrOfInstances); setLoopVariable(scopeExecution, NUMBER_OF_INSTANCES, nrOfInstances + 1); setLoopVariable(scopeExecution, NUMBER_OF_ACTIVE_INSTANCES, 1); } return scopeExecution; }
@Override public void destroyInnerInstance(ActivityExecution scopeExecution) { removeLoopVariable(scopeExecution, LOOP_COUNTER); int nrOfActiveInstances = getLoopVariable(scopeExecution, NUMBER_OF_ACTIVE_INSTANCES); setLoopVariable(scopeExecution, NUMBER_OF_ACTIVE_INSTANCES, nrOfActiveInstances - 1); }
@Override protected void createInstances(ActivityExecution execution, int nrOfInstances) throws Exception { prepareScope(execution, nrOfInstances); setLoopVariable(execution, NUMBER_OF_ACTIVE_INSTANCES, 1); ActivityImpl innerActivity = getInnerActivity(execution.getActivity()); performInstance(execution, innerActivity, 0); }
public void complete(ActivityExecution scopeExecution) { int loopCounter = getLoopVariable(scopeExecution, LOOP_COUNTER) + 1; int nrOfInstances = getLoopVariable(scopeExecution, NUMBER_OF_INSTANCES); int nrOfCompletedInstances = getLoopVariable(scopeExecution, NUMBER_OF_COMPLETED_INSTANCES) + 1; setLoopVariable(scopeExecution, NUMBER_OF_COMPLETED_INSTANCES, nrOfCompletedInstances); if (loopCounter == nrOfInstances || completionConditionSatisfied(scopeExecution)) { leave(scopeExecution); } else { PvmActivity innerActivity = getInnerActivity(scopeExecution.getActivity()); performInstance(scopeExecution, innerActivity, loopCounter); } }