View Javadoc
1 package org.smartcomps.twister.engine.priv.core.dynamic.impl; 2 3 import org.smartcomps.twister.engine.priv.core.dynamic.TerminateEC; 4 import org.smartcomps.twister.engine.priv.core.dynamic.StructuredEC; 5 import org.smartcomps.twister.engine.priv.core.dynamic.ExecutionContext; 6 import org.smartcomps.twister.engine.priv.core.dynamic.ProcessInstance; 7 8 public class TerminateECImpl extends BasicECImpl implements TerminateEC { 9 10 public void execute() { 11 // Looping through the execution context hierarchy to terminate all 12 if (getInstance() == null) { 13 StructuredEC container = getContainer(); 14 container.setStatus(ENDED_CANCELED); 15 while (container.getContainer() != null) { 16 container = container.getContainer(); 17 container.setStatus(ENDED_CANCELED); 18 } 19 ((ProcessInstanceImpl)container.getInstance()).setStatus(ProcessInstance.CANCELED); 20 } else { 21 ((ProcessInstanceImpl)getInstance()).setStatus(ProcessInstance.CANCELED); 22 } 23 this.setStatus(ENDED_CANCELED); 24 } 25 26 }

This page was automatically generated by Maven