mboms.md
mBOMs
mBOM items:
mBOM items represent the bill of materials required to construct a part. A part will have an mBOM made up of many mBOM items which dictate the subparts to be used in a part's construction. One can think of parts as a tree structure, where the nodes are part objects and the edges are mbom items. In this vein the root of the tree would be a part representing a completed assembly, its mBOM would be parts used in its construction, and which in turn could have their own mBOM. Maintaining this tree structure through the mBOM and subsequent aBOM is a vital part of ION.
| mBOM Item | Description |
|---|---|
| id | Unique identifier of mBOM Item object |
| parent | The part object which this mBOM item describes the construction of |
| part | The part object which will be used in the construction of the parent |
| quantity | The amount of a specific part needed in construction |
| substitutes | List of valid substitutes that could be used in place of the specified part |
mBOM Substitutes
mBOM substitutes are valid alternatives that can be used in place of the defined part. Each of those mBOM items may have many mBOM substitutes which are subpart replacements for that specific subpart.
| mBOM Substitute | Description |
|---|---|
| id | Unique identifier of mBOM Substitute object |
| part | The part object which can be substituted for the part in the mBOM Item |
| mbomItem | The mBOM Item for which this object is a valid substitute for |
Query mBOM Item
The queries below specify how to list mBOM Items by a filter or get a specific mBOM Item. It is often more effective to query the mBOM relation through a part object.
query MBOMItems($filters: MBomItemsInputFilters) {
mbomItems(filters: $filters) {
edges {
node {
id partId parentId quantity
}
}
}
}
{
"filters": {
"parentId": {
"eq": 1
}
}
}
query GetMBOMItem {
mbomItems(id: 1) {
id partId parentId quantity
}
}
Query mBOM Substitute
The queries below specify how to list mBOM substitutes by a filter or get a specific mBOM substitute.
query MBOMSubstitutes($filters: MBomSubstituteInputFilters) {
mbomSubstitutes(filters: $filters) {
edges {
node {
id partId parentId mbomItemId
}
}
}
}
{
"filters": {
"mbomItemId": {
"eq": 1
}
}
}
query MBOMSubstitute {
mbomSubstitute(id: 1) {
id partId parentId mbomItemId
}
}
Create mBOM Item
An mBOM item defines which parts and how many of those parts are required to build a new part. The parent is the relation to the part being built, and the part relation is to the part required in the building. The quantity value must be greater than 0. Returns the newly created mBOM Item.
mutation($input: CreateMBomItemInput!){
createMbomItem(input: $input){
mbomItem {
id parentId partId quantity
}
}
}
{
"input": {
"parentId": 2,
"partId": 1,
"quantity": 3
}
}
Update mBOM Item
The quantity of an mBOM item and its associated part's can be updated. Returns the updated mBOM Item.
mutation UpdateMBomItem($input: UpdateMBomItemInput!) {
updateMbomItem(input: $input) {
mbomItem {
id parentId partId quantity
}
}
}
{
"input": {
"etag": "etag1",
"id": 1,
"partId": 3,
"quantity": 5
}
}
Create mBOM substitutes
Create a valid substitution for a specific part within an mBOM. Any parts which are listed with mBOM substitutes will not raise a validation error if they are attached to an aBOM instead of the part specified in the original mBOM Item.
mutation CreateMbomSubstitutes($input:
[CreateMBomSubstituteInput]!){
createMbomSubstitutes(input: $input){
mbomSubstitutes {
id parentId partId mbomItemId
}
}
}
{
"input": [
{'partId': 3, 'parentId': 2, 'mbomItemId': 1},
{'partId': 4, 'parentId': 2, 'mbomItemId': 1},
]
}
Delete a mBOM Item
An nBOM Item may be deleted unless it has already been used in the construction of an aBOM. Returns the ID of the deleted mBOM Item
mutation DeleteMBomItem($id: ID!, $etag: String!){
deleteMbomItem(id: $id, etag: $etag){
id
}
}
{
"id": 1,
"etag": "etag1"
}
Delete mBOM Substitute
Delete a mBOM substitute. Returns the ID of the deleted mBOM substitute.
mutation DeleteMBomSubstitute($id: ID!, $etag: String!){
deleteMbomSubstitute(id: $id, etag: $etag){
id
}
}
{
"id": 1,
"etag": "etag1"
}