/* * BusinessProcessState createdstate = new BusinessProcessState * { * DatePerformed = DateTime.Now, * PerformedBy = "System", * Comment = "Created workflow for Payment Request" * * }; * _PaymentRequestservice.Create(request); * * BusinessProcess bp = _BusinessProcessService.CreateBusinessProcess(BP_PR,request.PaymentRequestID, * "PaymentRequest", createdstate); * request.BusinessProcessID = bp.BusinessProcessID; */ public BusinessProcess CreateBusinessProcessForObject(int templateID, int DocumentID, string DocumentType, bool save = false) { StateTemplate startingTemplate = _unitOfWork.StateTemplateRepository.FindBy(s => s.ParentProcessTemplateID == templateID && s.StateType == 0).Single(); BusinessProcess bp = new BusinessProcess { ProcessTypeID = templateID, DocumentID = DocumentID, DocumentType = DocumentType }; BusinessProcessState StartingState = new BusinessProcessState { DatePerformed = DateTime.Now, PerformedBy = "System", Comment = "Created workflow for" + DocumentType }; _unitOfWork.BusinessProcessRepository.Add(bp); StartingState.ParentBusinessProcess = bp; StartingState.StateID = startingTemplate.StateTemplateID; _unitOfWork.BusinessProcessStateRepository.Add(StartingState); bp.CurrentStateID = StartingState.BusinessProcessStateID; // _unitOfWork.BusinessProcessRepository.Edit(bp); // PromotWorkflow(StartingState); if (save) { _unitOfWork.Save(); } return(bp); }
public override void CloneData(StateTemplate _reference) { MoveAround controller = _reference as MoveAround; this.rotationSpeed = controller.GetRotationSpeed(); this.minDistance = controller.GetMinDistance(); }
public override void CloneData(StateTemplate _reference) { Attack controller = _reference as Attack; this.CoolDown = controller.GetCoolDown(); this.AttackTime = controller.GetAttackTime(); }
public string Serialize() { StateTemplate temp = new StateTemplate(); foreach (Output o in Outputs) { OutputTemplate ot = new OutputTemplate(); ot.ID = o.ID; ot.Ports = o.Ports; ot.Name = o.Name; ot.IPAddress = o.IP; foreach (Fixture f in o.GetFixtures()) { ot.Fixtures.Add(FixtureTemplateFactory.createFixtureTemplate(f)); } temp.Outputs.Add(ot); } foreach (Fixture f in FixturePool) { temp.FixturePool.Add(FixtureTemplateFactory.createFixtureTemplate(f)); } temp.ActionMessage = ActionMessage; return(JsonConvert.SerializeObject(temp)); }
public ActionResult EditStateJSON(StateTemplate item) { if (item != null) { _StateTemplateService.Update(item); return(Json(toStateTemplatePOCO(item), JsonRequestBehavior.AllowGet)); } return(Json("{}")); }
public override void CloneData(StateTemplate _reference) { FollowPlayer controller = _reference as FollowPlayer; this.rotationSpeed = controller.GetRotationSpeed(); this.minDistance = controller.GetMinDistance(); this.parentSpeedOnEnter = controller.GetParentSpeedOnEnter(); this.parentSpeedOnExit = controller.GetParentSpeedOnExit(); }
public ActionResult Edit(StateTemplate item) { if (ModelState.IsValid) { _StateTemplateService.Update(item); return(RedirectToAction("Index")); } return(View(item)); }
public ActionResult EditKendo([DataSourceRequest] DataSourceRequest request, StateTemplate item) { if (ModelState.IsValid) { _StateTemplateService.Update(item); return(Json(ModelState.ToDataSourceResult())); } return(Json(ModelState.ToDataSourceResult())); }
public ActionResult Delete(int id = 0) { StateTemplate item = _StateTemplateService.FindById(id); if (item == null) { return(HttpNotFound()); } return(View(item)); }
public bool Delete(StateTemplate item) { if (item == null) { return(false); } _unitOfWork.StateTemplateRepository.Delete(item); _unitOfWork.Save(); return(true); }
private StateTemplatePOCO toStateTemplatePOCO(StateTemplate item) { return(new StateTemplatePOCO() { AllowedAccessLevel = item.AllowedAccessLevel, Name = item.Name, ParentProcessTemplateID = item.ParentProcessTemplateID, StateNo = item.StateNo, StateTemplateID = item.StateTemplateID, StateType = item.StateType }); }
// Update is called once per frame protected override void Update() { this.currState.Tick(); StateTemplate state = this.currState.CheckTransitions(); if (this.currState != state) { this.currState.OnExit(); this.currState = state; this.currState.OnEnter(); } }
public virtual void Init() { if (this.StartHealth == -1) { this.StartHealth = this.Health; } this.Health = this.StartHealth; this.currState = this.states[0]; this.currState.OnEnter(); this.OnEnemyCreated.Raise(); }
public override void CloneData() { List <StateTemplate> states = this.parent.GetStates(); List <StateTemplate> clonedStates = new List <StateTemplate>(); //this.parent.Start(); for (int count = 0; count < states.Count; count++) { clonedStates.Add(Instantiate(states[count])); clonedStates[count].name = this.parent.gameObject.name + "_" + clonedStates[count].name; } for (int count = 0; count < clonedStates.Count; count++) { List <TransitionTemplate> transition = clonedStates[count].GetTransitions(); List <TransitionTemplate> clonedTransition = new List <TransitionTemplate>(); for (int countT = 0; countT < transition.Count; countT++) { clonedTransition.Add(Instantiate(transition[countT])); clonedTransition[countT].name = this.parent.gameObject.name + "_" + clonedTransition[countT].name; string targetId = clonedTransition[countT].GetTarget().GetID(); StateTemplate newTarget = clonedStates.Find(x => x.GetID() == targetId); clonedTransition[countT].SetTarget(newTarget); clonedTransition[countT].CloneData(transition[countT]); } clonedStates[count].SetTransitions(clonedTransition); clonedStates[count].Init(this.parent); clonedStates[count].CloneData(states[count]); } this.parent.SetStates(clonedStates); }
public T Deserialize <T>(string str) { StateTemplate stateTemp = JsonConvert.DeserializeObject <StateTemplate>(str); State state = new State(); // deserialize outputs foreach (OutputTemplate o in stateTemp.Outputs) { Output output = new Output(); // add prots foreach (Port p in o.Ports) { output.Ports.Add(p); } // add fixtures foreach (FixtureTemplate ft in o.Fixtures) { Fixture f = FixtureFactory.createFixture(ft); f.Name = ft.Name; output.TryPatchFixture(f); } output.IP = o.IPAddress; output.Name = o.Name; state.Outputs.Add(output); } // deserialize fixture pool foreach (FixtureTemplate ft in stateTemp.FixturePool) { Fixture f = FixtureFactory.createFixture(ft); f.Name = ft.Name; state.FixturePool.Add(f); } state.ActionMessage = stateTemp.ActionMessage; return((T)Convert.ChangeType(state, typeof(State))); }
public ActionResult CreateKendo([DataSourceRequest] DataSourceRequest request, StateTemplate item, int ProcessTemplateID = 0) { if (item != null && ModelState.IsValid) { if (ProcessTemplateID > 0) { item.ParentProcessTemplateID = ProcessTemplateID; } _StateTemplateService.Add(item); } return(Json(new[] { item }.ToDataSourceResult(request, ModelState))); }
// Use this for initialization public override void Init(StateTemplate _parent) { base.Init(_parent); this.target = this.parent.GetParent().GetTarget(); }
public virtual void CloneData(StateTemplate _reference) { }
// Use this for initialization public override void Init(StateTemplate _parent) { base.Init(_parent); this.state = (MoveAround)this.parent; }
public bool Add(StateTemplate item) { _unitOfWork.StateTemplateRepository.Add(item); _unitOfWork.Save(); return(true); }
// Use this for initialization public virtual void Init(StateTemplate _parent) { this.parent = _parent; }
public virtual void SetTarget(StateTemplate _target) { this.targetState = _target; }
public ActionResult DeleteKendo([DataSourceRequest] DataSourceRequest request, StateTemplate item) { if (item != null) { _StateTemplateService.DeleteById(item.StateTemplateID); } return(Json(ModelState.ToDataSourceResult())); }
public ITraitContextBuilder UseTrait(StateIdentifier stateIdentifier, StateTemplate stateTemplate) { stateIdentifiers.Add(stateIdentifier); stateMapping.Add(stateIdentifier, stateTemplate); return(this); }