Search in sources :

Example 6 with StateMachineEngine

use of io.seata.saga.engine.StateMachineEngine in project javaboy-code-samples by lenve.

the class DubboSagaTransactionStarter method main.

public static void main(String[] args) {
    AbstractApplicationContext applicationContext = new ClassPathXmlApplicationContext(new String[] { "spring/seata-saga.xml", "spring/seata-dubbo-reference.xml" });
    StateMachineEngine stateMachineEngine = (StateMachineEngine) applicationContext.getBean("stateMachineEngine");
    // transactionCommittedDemo(stateMachineEngine);
    // 
    transactionCompensatedDemo(stateMachineEngine);
    new ApplicationKeeper(applicationContext).keep();
}
Also used : AbstractApplicationContext(org.springframework.context.support.AbstractApplicationContext) StateMachineEngine(io.seata.saga.engine.StateMachineEngine) ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext) ApplicationKeeper(io.seata.samples.saga.ApplicationKeeper)

Aggregations

StateMachineEngine (io.seata.saga.engine.StateMachineEngine)6 ClassPathXmlApplicationContext (org.springframework.context.support.ClassPathXmlApplicationContext)4 BeforeAll (org.junit.jupiter.api.BeforeAll)3 ApplicationContext (org.springframework.context.ApplicationContext)3 EngineExecutionException (io.seata.saga.engine.exception.EngineExecutionException)2 StateInstruction (io.seata.saga.engine.pcext.StateInstruction)2 StateInstance (io.seata.saga.statelang.domain.StateInstance)2 ArrayList (java.util.ArrayList)2 List (java.util.List)2 StateMachineConfig (io.seata.saga.engine.StateMachineConfig)1 ForwardInvalidException (io.seata.saga.engine.exception.ForwardInvalidException)1 ServiceInvoker (io.seata.saga.engine.invoker.ServiceInvoker)1 HierarchicalProcessContext (io.seata.saga.proctrl.HierarchicalProcessContext)1 CompensateSubStateMachineState (io.seata.saga.statelang.domain.CompensateSubStateMachineState)1 ExecutionStatus (io.seata.saga.statelang.domain.ExecutionStatus)1 StateMachineInstance (io.seata.saga.statelang.domain.StateMachineInstance)1 ServiceTaskStateImpl (io.seata.saga.statelang.domain.impl.ServiceTaskStateImpl)1 SubStateMachineImpl (io.seata.saga.statelang.domain.impl.SubStateMachineImpl)1 ApplicationKeeper (io.seata.samples.saga.ApplicationKeeper)1 HashMap (java.util.HashMap)1