@Test public void testMachineRunWithException() { PersistMachine p = persistMachineFactory.newInstance(getBizId(), "process_with_biz_exception"); p.addContext("goto", 2); p.addContext("_i", 1); try { p.run(); Assert.fail("Should get exception here!"); } catch (Exception e) { System.out.println("get a exception:" + e.getMessage() + "\n"); e.printStackTrace(); } PersistMachine p2 = persistMachineFactory.newInstance(p.getBizId()); Assert.assertEquals("state2", p2.getCurrentStateName()); p2.addContext("_i", 0); p2.run(); Assert.assertEquals("end", p2.getCurrentStateName()); }
public String getBizId() { return bizId; }
PersistMachine extends Machine { public String getBizId() { return bizId; } }
PersistMachine extends Machine { public String getBizId() { return bizId; } protected  PersistMachine(String bizId, String processName, int processVersion, ProcessDO processDO,
                             ProcessDOMapper processDOMapper
        , StateDOMapper stateDOMapper
        , PersistHelper persistHelper
        , TaskDOMapper taskDOMapper
        , ParticipationDOMapper participationDOMapper
        , JobDOMapper jobDOMapper); }
PersistMachine extends Machine { public String getBizId() { return bizId; } protected  PersistMachine(String bizId, String processName, int processVersion, ProcessDO processDO,
                             ProcessDOMapper processDOMapper
        , StateDOMapper stateDOMapper
        , PersistHelper persistHelper
        , TaskDOMapper taskDOMapper
        , ParticipationDOMapper participationDOMapper
        , JobDOMapper jobDOMapper); List<StateDOWithBLOBs> getStateDOList(); String getStatePathString(); void rollback(); String getBizId(); boolean isExist(); boolean isCompleted(); ProcessDO getProcessDO(); }
PersistMachine extends Machine { public String getBizId() { return bizId; } protected  PersistMachine(String bizId, String processName, int processVersion, ProcessDO processDO,
                             ProcessDOMapper processDOMapper
        , StateDOMapper stateDOMapper
        , PersistHelper persistHelper
        , TaskDOMapper taskDOMapper
        , ParticipationDOMapper participationDOMapper
        , JobDOMapper jobDOMapper); List<StateDOWithBLOBs> getStateDOList(); String getStatePathString(); void rollback(); String getBizId(); boolean isExist(); boolean isCompleted(); ProcessDO getProcessDO();  }