TDear Sharan, dear list,

thank you for your helpful answer, Sharan.

I have written down (below) some lengthy experimenting and 
reasoning that 
lead me to the following two questions:


--> QUESTION 2:
Where/how can I identify the essential configuration parameters and 
code that 
triggers a production run for demo product 'configurable pc' on 
order creation?


--> QUESTION 1:

Would it make sense to have createProductionRunFromRequirement() to 
walk up 
the requirement:order relation and kick 
createProductionRunsForProductBom() 
once for each SALESorder in the relation and shove the sales orders 
through 
createProductionRunsForProductBom() into one 'production run'?
Variant:
Would it make sense to have createProductionRunFromRequirement() to 
walk up 
the requirement:order relation and kick 
createProductionRunsForProductBom() 
once, and shove the sales order that it finds through 
createProductionRunsForProductBom() into the 'production run'?
(It depends, doesn't it?)


I would be delighted to hear your thoughts.




--------------------------------------------------------------------
---


I did the following:

1. Manufacturing Manager -> Routing: Create new routing 'newRouting'
2. Catalog Manager -> Products -> Product:
   Inventory Section:
       Disc. When Inv. Not Avail? N
       Requirement Method Enum Id: Automatic for every sales Order
       Require Inventory: N
       Inventory Message        
       Lot Id: forbidden
3. Catalog Manager -> Products -> Work Effort
   Add 'newRouting', relation type 'Product and Routing 
Association' cost 0.1
4. Create order by shop front end
   Status 'created': does not contain requirement link
5. Set order status 'approved':
   Order contains requirement link 'newRequirement'
   Requirement Type Id: 'Product requirement',
   Status 'created'
   Facility ID, Product ID, Quantity are set correctly
6. Set Requirement status to 'approved'.
   No production run is created.
7. Change Requirement Type Id to 'Internal requirement'
   No production run is generated.
8. Framework Web Tools -> Service Engine -> Run Service
   Service name: 'createProductionRunFromRequirement'
   Pool: pool
   quantity: 1  
   requirementId: 'newRequirement'
   Response:
   errorMessage 
   Production Run Not Created: The following required parameter is 
missing: [createProductionRunsForProductBom.startDate]
   - I am not sure if in the real world a start date for an un-
approved 
   - production run is a requirement.
   - Contrarily, I think the start date of the production run 
should be 
   - assigned by the facility management. Otherwise facility 
management could
   - be forced to ramp up capacity in an instant to cover the 
request, 
   - while that might even not be posssible at all. 
9. Set start date in requirement yesterday, repeat service run
   Response:
   'No production run is required for product with id 'productID' 
in date 2015-07-05 00:00:00.000; 
   please verify the validity dates of the bill of materials and 
routing.'
   Same happens with date tomorrow.
   - This message seems outright odd to me, because I do support 
the opinion
   - that a real world production run does not need a bill of 
materials at all.
   - I dispute the notions that it needs a task nor cost > 0 nor a 
   - duration to model reality in certain nontrivial cases.
   
   
ManufacturingProductionRunIsNotRequiredForProductId is issued in 
applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/Pr
oductionRunServices.java line 2689, 
public static Map<String, Object> 
createProductionRunsForProductBom(DispatchContext dctx, Map<String, 
? extends Object> context)

in case 'workEffortId == null' (This message could be a little 
misleading, 
because this means only that tree.createManufacturingOrders(..) 
returned NULL 
AND DID NOT THROW)
This looks like two bugs to me, but possibly small fry IMHO.

createProductionRunsForProductBom() does not deal with the orderID, 
so the link 
to the order would not show up in the production run anyway. So 
does it's 
caller createProductionRunFromRequirement() (which I recon 
represents the 
service I called manually)

Requirement has an 1:n relation to order, the order generating the 
requirement 
is correctly referenced.

Another order for the same product generates a new requirement and 
leaves 
the previous one unchanged (no new orders linked to old 
requirement).


--> QUESTION 1:

Would it make sense to have createProductionRunFromRequirement() to 
walk up 
the order relation and kick createProductionRunsForProductBom() 
once for each
SALESorder in the relation and shove the sales orders through 
createProductionRunsForProductBom() into one 'production run'?
Variant:
Would it make sense to have createProductionRunFromRequirement() to 
walk up 
the order relation and kick createProductionRunsForProductBom() 
once, and
shove the sales order that it finds through 
createProductionRunsForProductBom() 
into the 'production run'?


tree.createManufacturingOrders(..) refers to
public String createManufacturingOrders(String facilityId, Date 
date, 
String workEffortName, String description, String routingId, String 
orderId, 
String orderItemSeqId, String shipGroupSeqId, String shipmentId, 
GenericValue userLogin)  throws GenericEntityException

obviously eats orderID.

This could provide for my scenario b) order -> requirement -> 
production run by 
cyclic service with manual intervention to set requirement types to 
'internal'
(still annoying...but maybe the requirement type could be fixed 
easily?)

But:
Obviously demo Product 'Configurable PC' can generate a production 
run directly
from order (even though at the wrong order state transition from 
nil to created 
instead of created to approved)

--> 
It seems easier to change just that trigger condition than have a 
cyclic 
service trigger the production runs from requirements.  


--> QUESTION 2:
Where can I find the essential configuration parameters and code 
that triggers
a production run for 'configurable pc' on order creation?



   


On Mon, 06 Jul 2015 19:37:50 +0200 "Sharan-F" 
<[email protected]> wrote:
>Hi
>
> There is a way to setup Requirements being created using the 
> Requirement Method Enum Id on the main product screen. You'll 
> need to expand 
>the
>Inventory section to see it. (Perhaps this is the way you are 
>generating the
>requirements?)
>
>You'll still need to attach your product to a manufacturing 
>routing etc
>
>Set the Requirement Method Enum Id to Create a Requirement for 
>Each Sales Order. Then when you Approve a Sales Order the 
> Requirement is created.
>
>And in theory when you Approve the Requirement – the Production 
>Run should
>be created for your Sales Order.
>
>I do remember there was a bug in that twhen he Requirement was 
>created ,it
>was as a Product Requirement and these don't create production 
>runs. The
>workaround used to be that if you changed the Product Requirement 
>to an
>Internal Requirement then it would create the production run.  
>
>I've done a quick test on the Trunk and that workaround doesn't 
>seem to be
>working anymore so something has changed that may need to be 
>fixed. So the
>functionality you need is there - it maybe just needs to be looked 
>at again
>to find out why it's stopped working.
>
>Thanks
>Sharan
>
>
>
>--
>View this message in context: 
>http://ofbiz.135035.n4.nabble.com/How-to-trigger-production-run-of-
>arbitrary-product-on-order-approve-ment-tp4670760p4670786.html
>Sent from the OFBiz - User mailing list archive at Nabble.com.

Reply via email to