/// <summary> /// create and execute command rollback transaction by send the RollbackType /// </summary> /// <param name="rollbackType"> if it is cancel we refresh the all open tasks under the same transaction /// if it is rollback we close the all open tasks under the same transaction /// </param> /// <returns></returns> internal ReturnResult CreateAndExecuteRollbackLocalTransaction(RollbackEventCommand.RollbackType rollbackType) { ReturnResult ReturnResult = new ReturnResult(); // if local transaction exist on the task take it from the transaction.ownerTask ; string taskTag = task.DataviewManager.LocalDataviewManager.Transaction != null?task.DataviewManager.LocalDataviewManager.Transaction.OwnerTask.getTaskTag() : task.getTaskTag(); // execute the rollback event command on the opened local transaction if (TaskTransactionManager.LocalOpenedTransactionsCount > 0) { IClientCommand command = CommandFactory.CreateRollbackEventCommand(taskTag, rollbackType); ReturnResult = ((Task)task).DataviewManager.LocalDataviewManager.Execute(command); } return(ReturnResult); }
/// <summary> /// a factory method that creates an Event command /// </summary> /// <param name = "taskTag">the task id</param> /// <param name = "cHandlerId">the id of the handler where execution should start</param> /// <param name = "cObj">the DIT index of the control that had the focus when the event occurred</param> /// <param name = "magicEvent">the code of the internal event</param> /// <returns>newly created command.</returns> internal static RollbackEventCommand CreateRollbackEventCommand(String taskTag, RollbackEventCommand.RollbackType rollbackType) { var cmd = new RollbackEventCommand { TaskTag = taskTag, Rollback = rollbackType }; return(cmd); }
public LocalRunTimeCommandRollback(RollbackEventCommand command) { taskId = command.TaskTag; rollbackType = command.Rollback; }