2 package com
.interrupt
.bookkeeping
.action
;
5 import java
.util
.Iterator
;
7 import org
.apache
.log4j
.Logger
;
9 import com
.interrupt
.bookkeeping
.account
.IDebit
;
10 import com
.interrupt
.bookkeeping
.account
.GDebit
;
11 import com
.interrupt
.bookkeeping
.account
.ICredit
;
12 import com
.interrupt
.bookkeeping
.account
.GCredit
;
13 import com
.interrupt
.bookkeeping
.account
.IAccount
;
14 import com
.interrupt
.bookkeeping
.account
.IAccounts
;
15 import com
.interrupt
.bookkeeping
.account
.Accounts
;
16 import com
.interrupt
.bookkeeping
.cc
.bkell
.Bkell
;
17 import com
.interrupt
.bookkeeping
.journal
.Transaction
;
18 import com
.interrupt
.bookkeeping
.journal
.Entry
;
19 import com
.interrupt
.bookkeeping
.exception
.EntryException
;
20 import com
.interrupt
.bookkeeping
.exception
.AccountException
;
21 import com
.interrupt
.bookkeeping
.exception
.WorkflowException
;
22 import com
.interrupt
.bookkeeping
.users
.User
;
23 import com
.interrupt
.bookkeeping
.util
.Util
;
24 import com
.interrupt
.bookkeeping
.workflow
.StateManager
;
25 import com
.interrupt
.bob
.base
.IBob
;
26 import com
.interrupt
.bob
.base
.IVisitor
;
28 public class RemoveAction
extends AbstractAction
implements IVisitor
{
31 private Logger logger
= Logger
.getLogger(RemoveAction
.class);
32 public void execute(IBob ibob
, User user
) {
34 super.execute(ibob
, user
);
38 public void visit(IBob bob
) throws WorkflowException
{
40 logger
.debug("RemoveAction:visiting: ["+bob
.getClass()+"]");
41 String svalue
= (bob
.getAttributes()).getValue("state");
43 //throw new WorkflowException("cannot find 'state' attribute");
46 if(!svalue
.equals(Util
.CLOSED_STATE
)) {
47 throw new WorkflowException("state of ["+bob
.getClass()+"] must be 'CLOSED'");
50 StateManager smanager
= new StateManager();
51 smanager
.transition(bob
,Util
.REMOVED_STATE
);