All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jbpm.sim.event.WorkCompletionEvent Maven / Gradle / Ivy

There is a newer version: 3.2.19.ayg
Show newest version
package org.jbpm.sim.event;

import org.jbpm.sim.entity.ResourceUsingEntity;

import desmoj.core.simulator.Entity;
import desmoj.core.simulator.Event;
import desmoj.core.simulator.Model;

/**
 * This desmoj.core.simulator.Event triggers the completion of some "work",
 * which can be TaskInstances, States, ...
 * 
 * @author bernd.ruecker@camunda.com
 */
public class WorkCompletionEvent extends Event {

  public WorkCompletionEvent(Model owner) {
    super(owner, "WorkCompletionEvent", true);
  }

  public void eventRoutine(Entity who) {
    ResourceUsingEntity entity = (ResourceUsingEntity) who;    
    // just a hint: maybe release resources triggers some other processes!
    // so there can be other processes running "in between" this two instructions
    // but it is still the same model time, so no problem
    entity.releaseResources();    
    entity.end();  
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy