StateMachine states are not getting updated

Questions regarding the use of the .NET SDK 2.0 for Server or Client development or integration into customer products ...

Moderator: uasdknet

Post Reply
sudhapc
Hero Member
Hero Member
Posts: 28
Joined: 16 Oct 2018, 12:47

StateMachine states are not getting updated

Post by sudhapc »

StateMachine states are not changing from one state to another. Here no custom API methods are used to change the state of "order" node currentState value.

internal bool UpdateOrderStateToActive(Node orderNode, OMNodeManager omNodeManager)
{
var orderModel = orderNode.UserData as IOMModel;
if (orderModel == null) return false;
//var stateMachine = new OrderStateMachineModel();
var stateMachine = ((OrderModel) orderModel).State;
stateMachine.CurrentState.Id = new NodeId(Objects.OrderStateMachineType_Active, 5);
stateMachine.CurrentState.Number = Variables.OrderStateMachineType_Active_StateNumber;
stateMachine.CurrentState.Value = new LocalizedText(BrowseNames.Active);
stateMachine.CurrentState.Name = new QualifiedName("Active");
return true;

}

Post Reply