2.4. Sub-Resources of Operations Including Information from the Routing

The values from routing can be found in the following resources:

Important

All these values, except for the target quantity in the specification resource are inherited from the routing from which the specific production order was generated from in the ERP-System.

2.4.1. Tutorials

2.4.1.1. Retrieve the Specification of Plannable Operations

Solution: show/hide

Java

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
        IOperationClient operationClient = api.getOperationClient();

        GetOperationsRequest operationsRequest = new GetOperationsRequest();
        operationsRequest.setIsPlannable(true);
        operationsRequest.embed(new OperationEmbed().specification(true));

        Page<OperationResponse> operationResponsePage = operationClient.getOperations(operationsRequest);

        operationResponsePage
            .streamForward()
            .forEach(operationResponse -> {
                OperationPropertiesWSModel properties = operationResponse.getProperties();
                OperationSpecificationPropertiesWSModel routingDetails = operationResponse
                    .getSpecification()
                    .getEmbedded();
                /* ... */
            });

/../_code/java/src/test/java/com/forcam/usage/operations/EmbedOperationEntriesTest.java

CURL

1
2
3
curl -X GET "http://$HOST:$PORT/ffwebservices/api/v2/operations?embed=specification&isPlannable=true&limit=100&offset=0" 
    --header "accept: application/json;charset=UTF-8" 
    --header "authorization: Bearer $TOKEN"

2.4.1.2. Retrieve the Required Components of Operations Currently Being Processed

Solution: show/hide

Java

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
        IOperationClient operationClient = api.getOperationClient();
        GetOperationsRequest operationsRequest = new GetOperationsRequest();
        operationsRequest.setOperationPhaseId(OperationPhase.PROCESSING);

        Page<OperationResponse> operationResponsePage = operationClient.getOperations(operationsRequest);

        List<OperationResponse> operationResponses = operationResponsePage
            .streamForward()
            .collect(Collectors.toList());
        Map<OperationResponse, List<OperationComponentWSModel>> operationComponentsMap = new HashMap<>();
        for (OperationResponse operationResponse : operationResponses) {
            String operationId = operationResponse
                .getProperties()
                .getId();
            GetOperationComponentsRequest componentsRequest = new GetOperationComponentsRequest(operationId);
            OperationComponentCollectionPage operationComponentResponses = operationClient.getOperationComponents(componentsRequest);
            List<OperationComponentWSModel> operationComponents = operationComponentResponses
                .streamForward()
                .collect(Collectors.toList());
            operationComponentsMap.put(operationResponse, operationComponents);
        }

/../_code/java/src/test/java/com/forcam/usage/operations/components/ComponentsTest.java

CURL

1
2
3
curl -X GET "http://$HOST:$PORT/ffwebservices/api/v2/operations?embed=components&operationPhaseId=PROCESSING
    --header "accept: application/json;charset=UTF-8"
    --header "authorization: Bearer $TOKEN"