001 /* 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to You under the Apache License, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017 package org.apache.commons.scxml.model; 018 019 import java.util.Collection; 020 021 import org.apache.commons.logging.Log; 022 import org.apache.commons.scxml.ErrorReporter; 023 import org.apache.commons.scxml.EventDispatcher; 024 import org.apache.commons.scxml.SCInstance; 025 import org.apache.commons.scxml.SCXMLExpressionException; 026 027 /** 028 * The class in this SCXML object model that corresponds to the 029 * <cancel> SCXML element. 030 * 031 */ 032 public class Cancel extends Action { 033 034 /** 035 * Serial version UID. 036 */ 037 private static final long serialVersionUID = 1L; 038 039 /** 040 * Constructor. 041 */ 042 public Cancel() { 043 super(); 044 } 045 046 /** 047 * The ID of the send message that should be cancelled. 048 */ 049 private String sendid; 050 051 /** 052 * Get the ID of the send message that should be cancelled. 053 * 054 * @return Returns the sendid. 055 */ 056 public String getSendid() { 057 return sendid; 058 } 059 060 /** 061 * Set the ID of the send message that should be cancelled. 062 * 063 * @param sendid The sendid to set. 064 */ 065 public void setSendid(final String sendid) { 066 this.sendid = sendid; 067 } 068 069 /** 070 * {@inheritDoc} 071 */ 072 public void execute(final EventDispatcher evtDispatcher, 073 final ErrorReporter errRep, final SCInstance scInstance, 074 final Log appLog, final Collection derivedEvents) 075 throws ModelException, SCXMLExpressionException { 076 evtDispatcher.cancel(sendid); 077 } 078 079 } 080