This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* NOTE: Replace [2022R1] with the name of YOUR database */ | |
/* Right-Click the Table in MS SQL Server Mgmt Studio and select "Select Top 1000 Rows" */ | |
SELECT TOP (1000) [CompanyID] | |
,[ScreenID] | |
,[Script] | |
,[Type] | |
,[CompanyMask] | |
,[CreatedByID] | |
,[CreatedByScreenID] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.WithFlowStates(states => | |
{ | |
states | |
.Update<State.approved>(flowState => flowState | |
.WithActions(actions => | |
{ | |
actions.Update(g => g.pushInventoryID, a => a.IsAutoAction(conditions.MyCondition)); | |
})); | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#region Actions - Hide (Pre-Defined Action) | |
screen | |
.WithActions(action => | |
{ | |
action.Add(removeHold); | |
action.Add(putOnHold); | |
action.Add(complete); | |
action.Add(reopen); | |
action.Add(g => g.schedule, a => a | |
.WithCategory(processingCategory) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using PX.Data; | |
using PX.Data.WorkflowAPI; | |
using PX.Objects.Common; | |
namespace Blog.CMMS | |
{ | |
using static PX.Data.WorkflowAPI.BoundedTo<CMMSWorkOrderEntry, CMMSWorkOrder>; | |
using static CMMSWorkOrder; | |
using State = Blog.CMMS.CMMSWorkOrder.Statuses; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.WithTransitions(transitions => | |
{ | |
transitions.AddGroupFrom(State.InitialState, ts => | |
{ | |
ts.Add(t => t | |
.To<State.hold>() | |
.IsTriggeredOn(g => g.initializeState) | |
.When(conditions.IsOnHold)); // CONDITION!!! | |
}); | |
transitions.Add(transition => transition |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.When(conditions.IsOnHold) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#region Conditions | |
Condition Bql<T>() where T : IBqlUnary, new() => context.Conditions.FromBql<T>(); | |
var conditions = new | |
{ | |
IsOnHold | |
= Bql<hold.IsEqual<True>>(), | |
IsScheduled | |
= Bql<scheduleDate.IsNotNull>(), | |
}.AutoNameConditions(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using static PX.Data.WorkflowAPI.BoundedTo<CMMSWorkOrderEntry, CMMSWorkOrder>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using PX.Data; | |
using PX.Data.WorkflowAPI; | |
using PX.Objects.Common; | |
namespace Blog.CMMS | |
{ | |
using static PX.Data.WorkflowAPI.BoundedTo<CMMSWorkOrderEntry, CMMSWorkOrder>; | |
using static CMMSWorkOrder; | |
using State = Blog.CMMS.CMMSWorkOrder.Statuses; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
transitions.AddGroupFrom(State.InitialState, ts => | |
{ | |
ts.Add(t => t | |
.To<State.hold>() | |
.IsTriggeredOn(g => g.initializeState)); | |
}); | |
transitions.Add(transition => transition | |
.From<State.hold>() | |
.To<State.open>() | |
.IsTriggeredOn(removeHold) |