cxtms 1.9.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +384 -0
- package/dist/cli.d.ts +6 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +4784 -0
- package/dist/cli.js.map +1 -0
- package/dist/extractUtils.d.ts +11 -0
- package/dist/extractUtils.d.ts.map +1 -0
- package/dist/extractUtils.js +19 -0
- package/dist/extractUtils.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +129 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +6 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/schemaLoader.d.ts +17 -0
- package/dist/utils/schemaLoader.d.ts.map +1 -0
- package/dist/utils/schemaLoader.js +134 -0
- package/dist/utils/schemaLoader.js.map +1 -0
- package/dist/validator.d.ts +72 -0
- package/dist/validator.d.ts.map +1 -0
- package/dist/validator.js +432 -0
- package/dist/validator.js.map +1 -0
- package/dist/workflowValidator.d.ts +103 -0
- package/dist/workflowValidator.d.ts.map +1 -0
- package/dist/workflowValidator.js +753 -0
- package/dist/workflowValidator.js.map +1 -0
- package/package.json +51 -0
- package/schemas/actions/all.json +27 -0
- package/schemas/actions/clipboard.json +46 -0
- package/schemas/actions/confirm.json +21 -0
- package/schemas/actions/consoleLog.json +16 -0
- package/schemas/actions/dialog.json +25 -0
- package/schemas/actions/fileDownload.json +16 -0
- package/schemas/actions/forEach.json +31 -0
- package/schemas/actions/if.json +12 -0
- package/schemas/actions/mutation.json +25 -0
- package/schemas/actions/navigate.json +18 -0
- package/schemas/actions/navigateBack.json +22 -0
- package/schemas/actions/navigateBackOrClose.json +21 -0
- package/schemas/actions/notification.json +19 -0
- package/schemas/actions/openBarcodeScanner.json +104 -0
- package/schemas/actions/query.json +32 -0
- package/schemas/actions/refresh.json +13 -0
- package/schemas/actions/resetDirtyState.json +22 -0
- package/schemas/actions/setFields.json +21 -0
- package/schemas/actions/setStore.json +13 -0
- package/schemas/actions/validateForm.json +15 -0
- package/schemas/actions/workflow.json +24 -0
- package/schemas/components/README.md +147 -0
- package/schemas/components/appComponent.json +58 -0
- package/schemas/components/barcodeScanner.json +69 -0
- package/schemas/components/button.json +123 -0
- package/schemas/components/calendar.json +489 -0
- package/schemas/components/card.json +176 -0
- package/schemas/components/collection.json +54 -0
- package/schemas/components/dataGrid.json +119 -0
- package/schemas/components/datasource.json +151 -0
- package/schemas/components/dropdown.json +57 -0
- package/schemas/components/field-collection.json +618 -0
- package/schemas/components/field.json +265 -0
- package/schemas/components/form.json +234 -0
- package/schemas/components/index.json +71 -0
- package/schemas/components/layout.json +69 -0
- package/schemas/components/module.json +167 -0
- package/schemas/components/navDropdown.json +36 -0
- package/schemas/components/navbar.json +78 -0
- package/schemas/components/navbarItem.json +28 -0
- package/schemas/components/navbarLink.json +36 -0
- package/schemas/components/row.json +31 -0
- package/schemas/components/slot.json +30 -0
- package/schemas/components/tab.json +34 -0
- package/schemas/components/tabs.json +35 -0
- package/schemas/components/timeline.json +172 -0
- package/schemas/components/timelineGrid.json +328 -0
- package/schemas/fields/README.md +66 -0
- package/schemas/fields/attachment.json +156 -0
- package/schemas/fields/autocomplete-googleplaces.json +130 -0
- package/schemas/fields/checkbox.json +82 -0
- package/schemas/fields/date.json +88 -0
- package/schemas/fields/datetime.json +75 -0
- package/schemas/fields/email.json +75 -0
- package/schemas/fields/index.json +53 -0
- package/schemas/fields/number.json +91 -0
- package/schemas/fields/password.json +70 -0
- package/schemas/fields/radio.json +94 -0
- package/schemas/fields/rangedatetime.json +56 -0
- package/schemas/fields/select-async.json +334 -0
- package/schemas/fields/select.json +115 -0
- package/schemas/fields/tel.json +79 -0
- package/schemas/fields/text.json +86 -0
- package/schemas/fields/textarea.json +95 -0
- package/schemas/fields/time.json +91 -0
- package/schemas/fields/url.json +74 -0
- package/schemas/schema.graphql +12248 -0
- package/schemas/schemas.json +610 -0
- package/schemas/workflows/activity.json +96 -0
- package/schemas/workflows/common/condition.json +48 -0
- package/schemas/workflows/common/expression.json +76 -0
- package/schemas/workflows/common/mapping.json +173 -0
- package/schemas/workflows/common/step.json +38 -0
- package/schemas/workflows/flow/aggregation.json +44 -0
- package/schemas/workflows/flow/entity.json +129 -0
- package/schemas/workflows/flow/state.json +105 -0
- package/schemas/workflows/flow/transition.json +143 -0
- package/schemas/workflows/input.json +122 -0
- package/schemas/workflows/output.json +61 -0
- package/schemas/workflows/schedule.json +26 -0
- package/schemas/workflows/tasks/accounting-transaction.json +95 -0
- package/schemas/workflows/tasks/action-event.json +65 -0
- package/schemas/workflows/tasks/all.json +152 -0
- package/schemas/workflows/tasks/appmodule.json +56 -0
- package/schemas/workflows/tasks/attachment.json +97 -0
- package/schemas/workflows/tasks/authentication.json +86 -0
- package/schemas/workflows/tasks/caching.json +68 -0
- package/schemas/workflows/tasks/charge.json +92 -0
- package/schemas/workflows/tasks/commodity.json +92 -0
- package/schemas/workflows/tasks/contact-address.json +72 -0
- package/schemas/workflows/tasks/contact-payment-method.json +72 -0
- package/schemas/workflows/tasks/contact.json +82 -0
- package/schemas/workflows/tasks/csv.json +81 -0
- package/schemas/workflows/tasks/document-render.json +105 -0
- package/schemas/workflows/tasks/document-send.json +84 -0
- package/schemas/workflows/tasks/edi.json +157 -0
- package/schemas/workflows/tasks/email-send.json +110 -0
- package/schemas/workflows/tasks/error.json +72 -0
- package/schemas/workflows/tasks/export.json +90 -0
- package/schemas/workflows/tasks/filetransfer.json +102 -0
- package/schemas/workflows/tasks/flow-transition.json +68 -0
- package/schemas/workflows/tasks/foreach.json +69 -0
- package/schemas/workflows/tasks/generic.json +47 -0
- package/schemas/workflows/tasks/graphql.json +78 -0
- package/schemas/workflows/tasks/httpRequest.json +161 -0
- package/schemas/workflows/tasks/import.json +64 -0
- package/schemas/workflows/tasks/inventory.json +67 -0
- package/schemas/workflows/tasks/job.json +88 -0
- package/schemas/workflows/tasks/log.json +73 -0
- package/schemas/workflows/tasks/map.json +58 -0
- package/schemas/workflows/tasks/movement.json +54 -0
- package/schemas/workflows/tasks/note.json +59 -0
- package/schemas/workflows/tasks/number.json +65 -0
- package/schemas/workflows/tasks/order-tracking-event.json +109 -0
- package/schemas/workflows/tasks/order.json +139 -0
- package/schemas/workflows/tasks/payment.json +85 -0
- package/schemas/workflows/tasks/pdf-document.json +60 -0
- package/schemas/workflows/tasks/postal-codes.json +92 -0
- package/schemas/workflows/tasks/resolve-timezone.json +65 -0
- package/schemas/workflows/tasks/setVariable.json +76 -0
- package/schemas/workflows/tasks/switch.json +75 -0
- package/schemas/workflows/tasks/template.json +73 -0
- package/schemas/workflows/tasks/tracking-event.json +137 -0
- package/schemas/workflows/tasks/transmission.json +185 -0
- package/schemas/workflows/tasks/unzip-file.json +68 -0
- package/schemas/workflows/tasks/user.json +70 -0
- package/schemas/workflows/tasks/validation.json +99 -0
- package/schemas/workflows/tasks/while.json +53 -0
- package/schemas/workflows/tasks/workflow-execute.json +82 -0
- package/schemas/workflows/trigger.json +90 -0
- package/schemas/workflows/variable.json +46 -0
- package/schemas/workflows/workflow.json +335 -0
- package/scripts/postinstall.js +291 -0
- package/scripts/setup-vscode.js +80 -0
- package/skills/cxtms-developer/SKILL.md +118 -0
- package/skills/cxtms-developer/ref-cli-auth.md +120 -0
- package/skills/cxtms-developer/ref-entity-accounting.md +180 -0
- package/skills/cxtms-developer/ref-entity-commodity.md +239 -0
- package/skills/cxtms-developer/ref-entity-contact.md +163 -0
- package/skills/cxtms-developer/ref-entity-geography.md +154 -0
- package/skills/cxtms-developer/ref-entity-job.md +77 -0
- package/skills/cxtms-developer/ref-entity-notification.md +85 -0
- package/skills/cxtms-developer/ref-entity-order-sub.md +160 -0
- package/skills/cxtms-developer/ref-entity-order.md +183 -0
- package/skills/cxtms-developer/ref-entity-organization.md +41 -0
- package/skills/cxtms-developer/ref-entity-rate.md +182 -0
- package/skills/cxtms-developer/ref-entity-shared.md +176 -0
- package/skills/cxtms-developer/ref-entity-warehouse.md +115 -0
- package/skills/cxtms-developer/ref-graphql-query.md +309 -0
- package/skills/cxtms-module-builder/SKILL.md +477 -0
- package/skills/cxtms-module-builder/ref-components-data.md +293 -0
- package/skills/cxtms-module-builder/ref-components-display.md +411 -0
- package/skills/cxtms-module-builder/ref-components-forms.md +369 -0
- package/skills/cxtms-module-builder/ref-components-interactive.md +317 -0
- package/skills/cxtms-module-builder/ref-components-layout.md +390 -0
- package/skills/cxtms-module-builder/ref-components-specialized.md +477 -0
- package/skills/cxtms-workflow-builder/SKILL.md +438 -0
- package/skills/cxtms-workflow-builder/ref-accounting.md +66 -0
- package/skills/cxtms-workflow-builder/ref-communication.md +169 -0
- package/skills/cxtms-workflow-builder/ref-entity.md +342 -0
- package/skills/cxtms-workflow-builder/ref-expressions-ncalc.md +128 -0
- package/skills/cxtms-workflow-builder/ref-expressions-template.md +161 -0
- package/skills/cxtms-workflow-builder/ref-filetransfer.md +80 -0
- package/skills/cxtms-workflow-builder/ref-flow.md +210 -0
- package/skills/cxtms-workflow-builder/ref-other.md +157 -0
- package/skills/cxtms-workflow-builder/ref-query.md +105 -0
- package/skills/cxtms-workflow-builder/ref-utilities.md +417 -0
- package/templates/module-configuration.yaml +44 -0
- package/templates/module-form.yaml +152 -0
- package/templates/module-grid.yaml +229 -0
- package/templates/module-select.yaml +139 -0
- package/templates/module.yaml +84 -0
- package/templates/workflow-api-tracking.yaml +189 -0
- package/templates/workflow-basic.yaml +76 -0
- package/templates/workflow-document.yaml +155 -0
- package/templates/workflow-entity-trigger.yaml +90 -0
- package/templates/workflow-ftp-edi.yaml +158 -0
- package/templates/workflow-ftp-tracking.yaml +161 -0
- package/templates/workflow-mcp-tool.yaml +112 -0
- package/templates/workflow-public-api.yaml +135 -0
- package/templates/workflow-scheduled-execute.yaml +75 -0
- package/templates/workflow-scheduled.yaml +125 -0
- package/templates/workflow-utility.yaml +96 -0
- package/templates/workflow-webhook.yaml +128 -0
- package/templates/workflow.yaml +140 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# File Transfer Tasks Reference
|
|
2
|
+
|
|
3
|
+
SFTP/FTP file transfer operations. Use `FileTransfer/Connect` to establish a session, perform file operations, then `FileTransfer/Disconnect`.
|
|
4
|
+
|
|
5
|
+
## Connection Lifecycle
|
|
6
|
+
|
|
7
|
+
```yaml
|
|
8
|
+
activities:
|
|
9
|
+
- name: Transfer
|
|
10
|
+
steps:
|
|
11
|
+
- task: "FileTransfer/Connect@1"
|
|
12
|
+
name: Connect
|
|
13
|
+
inputs:
|
|
14
|
+
host: "{{ sftpConfig.host }}"
|
|
15
|
+
port: "{{ sftpConfig.port }}"
|
|
16
|
+
username: "{{ sftpConfig.username }}"
|
|
17
|
+
password: "{{ sftpConfig.password }}"
|
|
18
|
+
protocol: "sftp"
|
|
19
|
+
outputs:
|
|
20
|
+
- name: connection
|
|
21
|
+
mapping: "connection"
|
|
22
|
+
|
|
23
|
+
- task: "FileTransfer/ListFiles@1"
|
|
24
|
+
name: ListFiles
|
|
25
|
+
inputs:
|
|
26
|
+
connection: "{{ Transfer.Connect.connection }}"
|
|
27
|
+
path: "/incoming"
|
|
28
|
+
outputs:
|
|
29
|
+
- name: files
|
|
30
|
+
mapping: "files"
|
|
31
|
+
|
|
32
|
+
- task: foreach
|
|
33
|
+
name: ProcessFiles
|
|
34
|
+
collection: "Transfer.ListFiles.files"
|
|
35
|
+
item: "file"
|
|
36
|
+
steps:
|
|
37
|
+
- task: "FileTransfer/DownloadFile@1"
|
|
38
|
+
name: Download
|
|
39
|
+
inputs:
|
|
40
|
+
connection: "{{ Transfer.Connect.connection }}"
|
|
41
|
+
path: "{{ file.path }}"
|
|
42
|
+
outputs:
|
|
43
|
+
- name: content
|
|
44
|
+
mapping: "content"
|
|
45
|
+
|
|
46
|
+
- task: "FileTransfer/MoveFile@1"
|
|
47
|
+
name: Archive
|
|
48
|
+
inputs:
|
|
49
|
+
connection: "{{ Transfer.Connect.connection }}"
|
|
50
|
+
sourcePath: "{{ file.path }}"
|
|
51
|
+
destinationPath: "/processed/{{ file.name }}"
|
|
52
|
+
|
|
53
|
+
- task: "FileTransfer/Disconnect@1"
|
|
54
|
+
name: Disconnect
|
|
55
|
+
inputs:
|
|
56
|
+
connection: "{{ Transfer.Connect.connection }}"
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Available Tasks
|
|
60
|
+
|
|
61
|
+
| Task | Description |
|
|
62
|
+
|------|-------------|
|
|
63
|
+
| `FileTransfer/Connect` | Establish SFTP/FTP connection |
|
|
64
|
+
| `FileTransfer/Disconnect` | Close connection |
|
|
65
|
+
| `FileTransfer/ListFiles` | List files in remote directory |
|
|
66
|
+
| `FileTransfer/DownloadFile` | Download file content |
|
|
67
|
+
| `FileTransfer/UploadFile` | Upload file to remote |
|
|
68
|
+
| `FileTransfer/MoveFile` | Move/rename remote file |
|
|
69
|
+
| `FileTransfer/DeleteFile` | Delete remote file |
|
|
70
|
+
|
|
71
|
+
## Upload Example
|
|
72
|
+
|
|
73
|
+
```yaml
|
|
74
|
+
- task: "FileTransfer/UploadFile@1"
|
|
75
|
+
name: Upload
|
|
76
|
+
inputs:
|
|
77
|
+
connection: "{{ Transfer.Connect.connection }}"
|
|
78
|
+
path: "/outgoing/report.csv"
|
|
79
|
+
content: "{{ GenerateReport.Export.file }}"
|
|
80
|
+
```
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
# Flow Workflow YAML Reference
|
|
2
|
+
|
|
3
|
+
## Contents
|
|
4
|
+
- Flow top-level structure (workflowType, entity, states, transitions, aggregations)
|
|
5
|
+
- Flow entity section (entity name, type, includes, query)
|
|
6
|
+
- Flow states section (initial, final, parent hierarchy, onEnter/onExit steps)
|
|
7
|
+
- Flow transitions section (manual, auto, event triggers; from/to states; conditions)
|
|
8
|
+
- Flow aggregations section (reusable collection expressions: all, any, sum, count)
|
|
9
|
+
|
|
10
|
+
Flow workflows are declarative state machines for entity lifecycle management. Use `workflowType: Flow` in the workflow section.
|
|
11
|
+
|
|
12
|
+
## Top-Level Structure
|
|
13
|
+
|
|
14
|
+
```yaml
|
|
15
|
+
workflow:
|
|
16
|
+
workflowId: "<uuid>"
|
|
17
|
+
name: "Flow Workflow Name"
|
|
18
|
+
workflowType: Flow # Required - identifies this as a Flow workflow
|
|
19
|
+
executionMode: Async
|
|
20
|
+
isActive: true
|
|
21
|
+
priority: 75 # 0-100, default 50
|
|
22
|
+
tags: ["tag1"]
|
|
23
|
+
agentInstruction: "AI guidance" # Optional
|
|
24
|
+
concurrency:
|
|
25
|
+
enabled: true
|
|
26
|
+
group: "groupName"
|
|
27
|
+
waitTime: 30
|
|
28
|
+
|
|
29
|
+
entity: # Required for Flow (replaces activities)
|
|
30
|
+
name: <EntityName>
|
|
31
|
+
type: <EntityType> # Required for Order, AccountingTransaction, Contact
|
|
32
|
+
includes: [<navigation-paths>] # Optional
|
|
33
|
+
query: "<graphql-query>" # Optional
|
|
34
|
+
|
|
35
|
+
states: [...] # Required, at least 1 state
|
|
36
|
+
transitions: [...] # Required, at least 1 transition
|
|
37
|
+
aggregations: [...] # Optional
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Entity Section
|
|
41
|
+
|
|
42
|
+
Specifies which entity's lifecycle this flow manages.
|
|
43
|
+
|
|
44
|
+
### Valid Entity Names
|
|
45
|
+
Order, Commodity, AccountingTransaction, Workflow, OrganizationConfig, Contact, AppModule, Attachment, OrderCommodity, TrackingEvent, JobOrder
|
|
46
|
+
|
|
47
|
+
### Entity Types (required for specific entities)
|
|
48
|
+
|
|
49
|
+
**Order** requires type: Brokerage, ParcelShipment, Quote, WarehouseReceipt, AirShipmentOrder, OceanShipmentOrder, LoadOrder, DeliveryOrder
|
|
50
|
+
**AccountingTransaction** requires type: Invoice, Bill, CreditMemo
|
|
51
|
+
**Contact** requires type: Customer, Carrier, Vendor, Driver, Employee
|
|
52
|
+
|
|
53
|
+
```yaml
|
|
54
|
+
entity:
|
|
55
|
+
name: Order
|
|
56
|
+
type: ParcelShipment
|
|
57
|
+
includes:
|
|
58
|
+
- Commodities
|
|
59
|
+
- Customer
|
|
60
|
+
- Charges
|
|
61
|
+
query: "{ commodities { id, quantity }, customer { name, email } }"
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## States Section
|
|
65
|
+
|
|
66
|
+
Each state represents a status in the entity lifecycle.
|
|
67
|
+
|
|
68
|
+
```yaml
|
|
69
|
+
states:
|
|
70
|
+
- name: Draft # Required, unique
|
|
71
|
+
stage: Entry # Optional grouping label
|
|
72
|
+
isInitial: true # At most 1 initial state
|
|
73
|
+
- name: Active
|
|
74
|
+
stage: Processing
|
|
75
|
+
- name: AwaitingPickup
|
|
76
|
+
parent: Active # Hierarchical state
|
|
77
|
+
- name: InTransit
|
|
78
|
+
parent: Active
|
|
79
|
+
onEnter: # Steps on entering this state
|
|
80
|
+
- task: "Email/Send"
|
|
81
|
+
inputs:
|
|
82
|
+
template: in_transit_notification
|
|
83
|
+
onExit: # Steps on exiting this state
|
|
84
|
+
- task: "Utilities/Log@1"
|
|
85
|
+
inputs:
|
|
86
|
+
message: "Leaving InTransit"
|
|
87
|
+
- name: Delivered
|
|
88
|
+
stage: Complete
|
|
89
|
+
isFinal: true # Terminal state, no outgoing transitions
|
|
90
|
+
requireConfirmation: true # User must confirm before entering
|
|
91
|
+
query: "{ charges { id, amount } }" # State-specific data query
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### State Rules
|
|
95
|
+
- **name**: Required, must be unique across all states
|
|
96
|
+
- **isInitial**: At most one state can be initial. When an entity has null status, the engine resolves it to the initial state automatically.
|
|
97
|
+
- **isFinal**: Final states cannot be transition sources
|
|
98
|
+
- **parent**: References another state; parent cannot be initial or final; children inherit parent transitions
|
|
99
|
+
|
|
100
|
+
## Transitions Section
|
|
101
|
+
|
|
102
|
+
Define how entities move between states.
|
|
103
|
+
|
|
104
|
+
```yaml
|
|
105
|
+
transitions:
|
|
106
|
+
- name: submit # Required, unique
|
|
107
|
+
displayName: "Submit Order" # Optional UI label
|
|
108
|
+
from: Draft # Single state
|
|
109
|
+
to: Submitted # Must be a leaf state (no children)
|
|
110
|
+
trigger: manual # manual | auto | event
|
|
111
|
+
|
|
112
|
+
- name: auto_approve
|
|
113
|
+
from: Submitted
|
|
114
|
+
to: Approved
|
|
115
|
+
trigger: auto # Evaluated automatically
|
|
116
|
+
priority: 10 # Higher = checked first (default 50)
|
|
117
|
+
conditions:
|
|
118
|
+
- expression: "Order.Amount < 1000"
|
|
119
|
+
|
|
120
|
+
- name: payment_received
|
|
121
|
+
from: AwaitingPayment
|
|
122
|
+
to: Paid
|
|
123
|
+
trigger: event # External event-driven
|
|
124
|
+
eventName: PaymentConfirmed # Required when trigger is 'event'
|
|
125
|
+
|
|
126
|
+
- name: bulk_transition
|
|
127
|
+
from: # Array of source states
|
|
128
|
+
- Draft
|
|
129
|
+
- Submitted
|
|
130
|
+
to: Cancelled
|
|
131
|
+
trigger: manual
|
|
132
|
+
|
|
133
|
+
- name: force_cancel
|
|
134
|
+
from: "*" # Wildcard: any non-final state
|
|
135
|
+
to: Cancelled
|
|
136
|
+
trigger: manual
|
|
137
|
+
steps: # Steps during transition
|
|
138
|
+
- task: "Utilities/Log@1"
|
|
139
|
+
inputs:
|
|
140
|
+
message: "Force cancelled"
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Trigger Types
|
|
144
|
+
- **manual**: User-initiated or API call
|
|
145
|
+
- **auto**: Automatic evaluation based on conditions; sorted by priority descending
|
|
146
|
+
- **event**: External event-driven; requires `eventName`
|
|
147
|
+
|
|
148
|
+
### Auto-Transitions and Cross-Entity Support
|
|
149
|
+
|
|
150
|
+
Auto-transitions can fire on related entities. For example, an Order status change can trigger a Commodity flow transition via the `OrderCommodities` join table.
|
|
151
|
+
|
|
152
|
+
```yaml
|
|
153
|
+
states:
|
|
154
|
+
- name: Pending
|
|
155
|
+
autoTransitions:
|
|
156
|
+
- to: InTransit
|
|
157
|
+
trigger:
|
|
158
|
+
entityType: Order
|
|
159
|
+
event: StatusChanged
|
|
160
|
+
conditions:
|
|
161
|
+
- "order.orderStatusName == 'Shipped'"
|
|
162
|
+
priority: 1
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
**Cross-entity resolution:**
|
|
166
|
+
| Triggering Entity | Flow Entity | Resolution |
|
|
167
|
+
|-------------------|-------------|------------|
|
|
168
|
+
| Order | Commodity | Via `OrderCommodities` join table |
|
|
169
|
+
|
|
170
|
+
### From States
|
|
171
|
+
- Single state: `from: Draft`
|
|
172
|
+
- Multiple states: `from: [Draft, Submitted]`
|
|
173
|
+
- Wildcard (any non-final state): `from: "*"`
|
|
174
|
+
|
|
175
|
+
### Execution Order
|
|
176
|
+
1. Validate transition from current state
|
|
177
|
+
2. Evaluate conditions (all must pass)
|
|
178
|
+
3. Execute `onExit` steps (from source state)
|
|
179
|
+
4. Execute transition `steps` (step inputs merged + template expressions resolved)
|
|
180
|
+
5. Update entity status
|
|
181
|
+
6. Execute `onEnter` steps (on target state)
|
|
182
|
+
|
|
183
|
+
## Aggregations Section
|
|
184
|
+
|
|
185
|
+
Reusable data queries for conditions.
|
|
186
|
+
|
|
187
|
+
```yaml
|
|
188
|
+
aggregations:
|
|
189
|
+
- name: allItemsReceived # Required, unique
|
|
190
|
+
expression: "all(Order.Commodities, item.ReceivedQuantity >= item.Quantity)"
|
|
191
|
+
- name: totalWeight
|
|
192
|
+
expression: "sum(Order.Commodities, item.Weight)"
|
|
193
|
+
- name: hasAnyDamaged
|
|
194
|
+
expression: "any(Order.Commodities, item.IsDamaged)"
|
|
195
|
+
- name: itemCount
|
|
196
|
+
expression: "count(Order.Commodities)"
|
|
197
|
+
- name: chargesByType
|
|
198
|
+
expression: "sum(Order.Charges, item.Amount)"
|
|
199
|
+
parameter: chargeType # Optional parameter
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### Valid Aggregation Functions
|
|
203
|
+
- **all(collection, predicate)** - All items match
|
|
204
|
+
- **any(collection, predicate)** - At least one matches
|
|
205
|
+
- **sum(collection, selector)** - Sum values
|
|
206
|
+
- **count(collection)** - Count items
|
|
207
|
+
- **first(collection)** - First item
|
|
208
|
+
- **last(collection)** - Last item
|
|
209
|
+
- **distinct(collection, selector)** - Unique values
|
|
210
|
+
- **groupBy(collection, selector)** - Group by value
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
# Other Tasks Reference
|
|
2
|
+
|
|
3
|
+
## Contents
|
|
4
|
+
- User & Auth tasks (User CRUD, verification codes, OAuth2 authentication)
|
|
5
|
+
- Caching tasks (SetCache and GetCache for in-memory key-value storage)
|
|
6
|
+
- EDI & Structured File Parsing tasks (EDI/Parse for X12/EDIFACT, StructuredFile/Parse)
|
|
7
|
+
- Flow/Transition task (trigger state machine transitions programmatically)
|
|
8
|
+
- Note tasks (Create, Update, Delete, NoteThread/Rename, bulk Import/Export)
|
|
9
|
+
- AppModule tasks (Create, Update, Delete app modules)
|
|
10
|
+
- ActionEvent/Create task (trigger UI notifications or webhooks)
|
|
11
|
+
|
|
12
|
+
## User & Auth
|
|
13
|
+
|
|
14
|
+
| Task | Description |
|
|
15
|
+
|------|-------------|
|
|
16
|
+
| `User/Create` | Create user account |
|
|
17
|
+
| `User/Update` | Update user |
|
|
18
|
+
| `User/Delete` | Delete user |
|
|
19
|
+
| `User/GetVerificationCode` | Get phone verification code |
|
|
20
|
+
| `User/GetEmailVerificationCode` | Get email verification code |
|
|
21
|
+
| `User/GetResetPasswordToken` | Get password reset token |
|
|
22
|
+
| `Authentication/OAuth2` | Execute OAuth2 authentication flow |
|
|
23
|
+
|
|
24
|
+
```yaml
|
|
25
|
+
- task: "Authentication/OAuth2"
|
|
26
|
+
name: Authenticate
|
|
27
|
+
inputs:
|
|
28
|
+
provider: "{{ oauthConfig.provider }}"
|
|
29
|
+
clientId: "{{ oauthConfig.clientId }}"
|
|
30
|
+
clientSecret: "{{ oauthConfig.clientSecret }}"
|
|
31
|
+
tokenUrl: "{{ oauthConfig.tokenUrl }}"
|
|
32
|
+
outputs:
|
|
33
|
+
- name: token
|
|
34
|
+
mapping: "accessToken"
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Caching
|
|
38
|
+
|
|
39
|
+
| Task | Description |
|
|
40
|
+
|------|-------------|
|
|
41
|
+
| `Caching/SetCache` | Store value in in-memory cache |
|
|
42
|
+
| `Caching/GetCache` | Retrieve value from cache |
|
|
43
|
+
|
|
44
|
+
```yaml
|
|
45
|
+
- task: "Caching/SetCache@1"
|
|
46
|
+
name: CacheRate
|
|
47
|
+
inputs:
|
|
48
|
+
key: "rate-{{ inputs.carrierId }}"
|
|
49
|
+
value: "{{ Data.GetRate.rate }}"
|
|
50
|
+
ttl: 3600
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
```yaml
|
|
54
|
+
- task: "Caching/GetCache@1"
|
|
55
|
+
name: GetCachedRate
|
|
56
|
+
inputs:
|
|
57
|
+
key: "rate-{{ inputs.carrierId }}"
|
|
58
|
+
outputs:
|
|
59
|
+
- name: rate
|
|
60
|
+
mapping: "value"
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## EDI & Structured File Parsing
|
|
64
|
+
|
|
65
|
+
| Task | Description |
|
|
66
|
+
|------|-------------|
|
|
67
|
+
| `X12/Parse` | Parse X12 EDI documents (850, 856) |
|
|
68
|
+
| `EDIFACT/Parse` | Parse EDIFACT messages (IFTMIN) |
|
|
69
|
+
| `EDIFACT/Generate` | Generate EDIFACT messages (IFTMIN) |
|
|
70
|
+
| `EDI/Parse` | **Deprecated** — alias for X12/Parse, use `X12/Parse` instead |
|
|
71
|
+
| `StructuredFile/Parse` | Parse structured files |
|
|
72
|
+
|
|
73
|
+
```yaml
|
|
74
|
+
- task: "X12/Parse@1"
|
|
75
|
+
name: ParseX12
|
|
76
|
+
inputs:
|
|
77
|
+
ediData: "{{ Transfer.Download.content }}"
|
|
78
|
+
transactionSet: "850"
|
|
79
|
+
validateSchema: true
|
|
80
|
+
outputs:
|
|
81
|
+
- name: parsed
|
|
82
|
+
mapping: "document"
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
```yaml
|
|
86
|
+
- task: "EDIFACT/Parse@1"
|
|
87
|
+
name: ParseEdifact
|
|
88
|
+
inputs:
|
|
89
|
+
edifactData: "{{ Transfer.Download.content }}"
|
|
90
|
+
messageType: "IFTMIN"
|
|
91
|
+
outputs:
|
|
92
|
+
- name: parsed
|
|
93
|
+
mapping: "document"
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
```yaml
|
|
97
|
+
- task: "EDIFACT/Generate@1"
|
|
98
|
+
name: GenerateEdifact
|
|
99
|
+
inputs:
|
|
100
|
+
messageType: "IFTMIN"
|
|
101
|
+
data: "{{ shipmentData }}"
|
|
102
|
+
outputs:
|
|
103
|
+
- name: edifactData
|
|
104
|
+
mapping: "edifactData"
|
|
105
|
+
- name: messageType
|
|
106
|
+
mapping: "messageType"
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Flow
|
|
110
|
+
|
|
111
|
+
| Task | Description |
|
|
112
|
+
|------|-------------|
|
|
113
|
+
| `Flow/Transition` | Trigger a Flow state transition programmatically |
|
|
114
|
+
|
|
115
|
+
```yaml
|
|
116
|
+
- task: "Flow/Transition@1"
|
|
117
|
+
name: TransitionOrder
|
|
118
|
+
inputs:
|
|
119
|
+
entityName: "Order"
|
|
120
|
+
entityId: "{{ inputs.orderId }}"
|
|
121
|
+
transition: "approve"
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## Notes
|
|
125
|
+
|
|
126
|
+
| Task | Description |
|
|
127
|
+
|------|-------------|
|
|
128
|
+
| `Note/Create` | Create a note |
|
|
129
|
+
| `Note/Update` | Update a note |
|
|
130
|
+
| `Note/Delete` | Delete a note |
|
|
131
|
+
| `NoteThread/Rename` | Rename note thread |
|
|
132
|
+
| `Notes/Import` | Bulk import notes |
|
|
133
|
+
| `Notes/Export` | Bulk export notes |
|
|
134
|
+
|
|
135
|
+
## App Module
|
|
136
|
+
|
|
137
|
+
| Task | Description |
|
|
138
|
+
|------|-------------|
|
|
139
|
+
| `AppModule/Create` | Create app module |
|
|
140
|
+
| `AppModule/Update` | Update app module |
|
|
141
|
+
| `AppModule/Delete` | Delete app module |
|
|
142
|
+
|
|
143
|
+
## Action Events
|
|
144
|
+
|
|
145
|
+
| Task | Description |
|
|
146
|
+
|------|-------------|
|
|
147
|
+
| `ActionEvent/Create` | Create action event (triggers UI notifications or webhook) |
|
|
148
|
+
|
|
149
|
+
```yaml
|
|
150
|
+
- task: "ActionEvent/Create"
|
|
151
|
+
name: NotifyUser
|
|
152
|
+
inputs:
|
|
153
|
+
eventName: "OrderStatusChanged"
|
|
154
|
+
data:
|
|
155
|
+
orderId: "{{ inputs.orderId }}"
|
|
156
|
+
newStatus: "{{ Data.GetOrder.order.status }}"
|
|
157
|
+
```
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# Query, Validation & Workflow Tasks Reference
|
|
2
|
+
|
|
3
|
+
## Query/GraphQL
|
|
4
|
+
|
|
5
|
+
Executes internal GraphQL queries against the CX backend. The query runs via MediatR to the internal GraphQL engine.
|
|
6
|
+
|
|
7
|
+
```yaml
|
|
8
|
+
- task: "Query/GraphQL"
|
|
9
|
+
name: GetOrder
|
|
10
|
+
inputs:
|
|
11
|
+
query: |
|
|
12
|
+
query($organizationId: Int!, $orderId: Int!) {
|
|
13
|
+
order(organizationId: $organizationId, orderId: $orderId) {
|
|
14
|
+
orderId
|
|
15
|
+
orderNumber
|
|
16
|
+
status
|
|
17
|
+
customer {
|
|
18
|
+
contactId
|
|
19
|
+
name
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
variables:
|
|
24
|
+
organizationId: "{{ organizationId }}"
|
|
25
|
+
orderId: "{{ inputs.orderId }}"
|
|
26
|
+
outputs:
|
|
27
|
+
- name: order
|
|
28
|
+
mapping: "order"
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
The query result is a dictionary. The `mapping` path extracts from the result. Output stored at `ActivityName.GetOrder.order`.
|
|
32
|
+
|
|
33
|
+
**Notes**:
|
|
34
|
+
- `organizationId` is always available as a system variable
|
|
35
|
+
- Variables support template expressions: `"{{ int organizationId }}"`
|
|
36
|
+
- Multiple queries can be in one step (returns merged results)
|
|
37
|
+
|
|
38
|
+
## Validation/Validate@1
|
|
39
|
+
|
|
40
|
+
Validates data against rules. Commonly used in Before entity triggers to block invalid changes.
|
|
41
|
+
|
|
42
|
+
Two rule types:
|
|
43
|
+
- **`rule: "required"`** — checks that `value` is not null or empty
|
|
44
|
+
- **Condition expression** — evaluates an NCalc `conditions` expression (no `rule` property needed)
|
|
45
|
+
|
|
46
|
+
```yaml
|
|
47
|
+
- task: "Validation/Validate@1"
|
|
48
|
+
name: ValidateOrder
|
|
49
|
+
inputs:
|
|
50
|
+
rules:
|
|
51
|
+
- rule: "required"
|
|
52
|
+
value: "{{ Data.GetOrder.order.status? }}"
|
|
53
|
+
message: "Order status is required"
|
|
54
|
+
- conditions: "[Data.GetOrder.order.status] != 'Cancelled'"
|
|
55
|
+
message: "Cannot modify cancelled orders"
|
|
56
|
+
- conditions: "[Data.GetOrder.order.amount] > 0"
|
|
57
|
+
message: "Amount must be positive"
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
If validation fails and `continueOnError` is false (default), execution stops and a `ValidationException` is returned. Set `continueOnError: true` to collect errors in the `errors` output instead:
|
|
61
|
+
|
|
62
|
+
```yaml
|
|
63
|
+
- task: "Validation/Validate@1"
|
|
64
|
+
name: ValidateOrder
|
|
65
|
+
continueOnError: true
|
|
66
|
+
inputs:
|
|
67
|
+
rules:
|
|
68
|
+
- rule: "required"
|
|
69
|
+
value: "{{ Data.GetOrder.order.status? }}"
|
|
70
|
+
message: "Order status is required"
|
|
71
|
+
- conditions: "[Data.GetOrder.order.amount] > 0"
|
|
72
|
+
message: "Amount must be positive"
|
|
73
|
+
outputs:
|
|
74
|
+
- name: errors
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Workflow/Execute
|
|
78
|
+
|
|
79
|
+
Executes a child workflow. Can run sync (wait for result) or async (fire and forget).
|
|
80
|
+
|
|
81
|
+
```yaml
|
|
82
|
+
- task: "Workflow/Execute@1"
|
|
83
|
+
name: RunChild
|
|
84
|
+
inputs:
|
|
85
|
+
workflowId: "<uuid>"
|
|
86
|
+
workflowInputs:
|
|
87
|
+
orderId: "{{ inputs.orderId }}"
|
|
88
|
+
customerId: "{{ Data.GetOrder.order.customer.contactId }}"
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
The child workflow's outputs are available as step outputs: `ActivityName.RunChild.outputName`.
|
|
92
|
+
|
|
93
|
+
**Circular call detection**: The executor maintains a call stack and throws if a workflow calls itself recursively.
|
|
94
|
+
|
|
95
|
+
## Workflow/Create, Workflow/Update, Workflow/Delete
|
|
96
|
+
|
|
97
|
+
CRUD operations on workflow definitions (not executions). Rarely used in standard workflows.
|
|
98
|
+
|
|
99
|
+
```yaml
|
|
100
|
+
- task: "Workflow/Create"
|
|
101
|
+
name: CreateWorkflow
|
|
102
|
+
inputs:
|
|
103
|
+
name: "Generated Workflow"
|
|
104
|
+
document: "{{ workflowYaml }}"
|
|
105
|
+
```
|