Use the contextObj as is when saving the StateMachineContext
- Polish and fix some merge issues - Relates #494
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2017 the original author or authors.
|
||||
* Copyright 2017-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -35,6 +35,14 @@ public class MongoDbRepositoryStateMachine extends RepositoryStateMachine {
|
||||
private String state;
|
||||
private byte[] stateMachineContext;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMachineId() {
|
||||
return machineId;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2017 the original author or authors.
|
||||
* Copyright 2017-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -60,8 +60,9 @@ public class MongoDbRepositoryStateMachinePersist<S, E> extends RepositoryStateM
|
||||
}
|
||||
|
||||
@Override
|
||||
protected MongoDbRepositoryStateMachine build(StateMachineContext<S, E> context, byte[] serialisedContext) {
|
||||
protected MongoDbRepositoryStateMachine build(StateMachineContext<S, E> context, Object contextObj, byte[] serialisedContext) {
|
||||
MongoDbRepositoryStateMachine mongodbRepositoryStateMachine = new MongoDbRepositoryStateMachine();
|
||||
mongodbRepositoryStateMachine.setId(contextObj.toString());
|
||||
mongodbRepositoryStateMachine.setMachineId(context.getId());
|
||||
mongodbRepositoryStateMachine.setState(context.getState().toString());
|
||||
mongodbRepositoryStateMachine.setStateMachineContext(serialisedContext);
|
||||
|
||||
Reference in New Issue
Block a user