Merge Rules from two Configurators

Hello all,

If you would like to take your mind off, oh I don’t know, maybe a megathread, I have another challenge for you.

We have created Product Configurators, and they work well.

Let me describe the problem.

We have two main manufacturing locations, main one in Kentucky and a satellite in Utah. In KY, we can make anything. In Utah, we have limited equipment, but we have a subset of things that can be made there and shipped to anywhere on the Western US for much less (obviously).

On occasion, we will have a customer somewhere in-between, and we might schedule the job initially in KY. Later, balancing the workloads, in case Utah is running low on jobs, we may want to switch the job to Utah.

Generally, we create our configurators to allow Utah to be an Alternate Method of Manufacturing, and the operations and parts get adjusted, and everyone is happy. Yea!

[Example 1: Part ‘P1234’ has default Method as ‘’. But we can change it to ‘U’ and it will apply the configurator rules to change the operations and materials to something that our Utah plant can do.]

But… a long time ago, in a galaxy far, far away (actually, right here), someone created separate parts and separate configurators for the KY versus UT parts. So, when a job for that particular Part gets moved from KY to UT, we have to effectively, delete or close the job and start over, because it has to be a different part that uses a different configurator.

[Example 2 (the problem child): Part ‘P1235KY’ uses one configurator and Part ‘P1235UT’ uses a different configurator.]

So, I’ve been asked to “merge” the parts and configurators.

We are “On Prem”, running 2023.2 (don’t @ me). I have created the following query to get much of the relevant information.

select
	pr.AltMethod
	,rs.RuleSetID
	,rs.KeepWhenLValue
	,rs.PartNum 
	,re.LValue
	,pm.MtlPartNum
	,pm.MtlSeq
FROM erp.PcRuleSet rs
JOIN erp.PcRules r ON r.Company = rs.Company AND r.RuleSetID = rs.RuleSetID AND r.ConfigID = rs.ConfigID AND r.PartNum = rs.PartNum AND rs.AltMethod = r.AltMethod
JOIN erp.PcRulesExpr re ON re.Company = r.Company AND re.RuleSetID = r.RuleSetID AND re.RuleSeq = r.RuleSeq AND r.PartNum = re.PartNum AND r.ConfigID = re.ConfigID AND re.AltMethod = rs.AltMethod
JOIN erp.Part p ON p.Company = rs.Company AND p.PartNum = rs.PartNum 
JOIN erp.PartRev pr ON pr.Company = p.Company AND pr.PartNum = p.PartNum AND pr.RevisionNum = rs.RevisionNum AND pr.AltMethod = re.AltMethod
JOIN erp.PartMtl pm ON pm.Company = rs.Company AND pm.PartNum = rs.PartNum AND pm.AltMethod = rs.AltMethod AND pm.MtlSeq = rs.MtlSeq
WHERE rs.PartNum like 'P1235%'
ORDER BY 2,1,4

My question: Is there any safe and legal way to copy configurator rules from TWO parts and TWO configurators to a “merged” configurator?

Our goal would be to have a single part [‘P1235’] and a single configurator with Alternate Method of Mfg for the second location.

2 Likes

I’m not aware of an easy way to accomplish this task within the database. If there’s a modest number of records, I would copy/paste my way through it.

It is possible to export your two configurators, directly edit the exported JSON files to merge them, then re-import. There are a number of pitfalls here, the merged file must exactly match the MOM of the part to which you’re importing.

There are lots of experts around the forum, I’m curious if they have any other advice.

2 Likes

Thank you for your response. I’m leaning that way as well. There are about 70 rules for each part. So it will be a pain, but I’m not sure it would be less than trying to munge together the json and hope we get it all right.

1 Like

Are the Operations and Materials the same, just with different rules? Also, are KY and UT different sites?

1 Like

The operations and materials are MOSTLY the same, but no, they are not identical. This is the reason that we need alternative method of manufacture. If made in Utah, we have to do it a little differently based on different machines and materials.

Yes, they are two different sites.

1 Like

Here’s what I’d do.

I don’t have access to configurator right now, so I can’t see the context object. But one of the context objects should be something like Context.CurrentPlant or Context.Plant.

I’d create a “master” rule set (one MOM), you can set rules for keeping or removing an Op / Mtl based on that. For example, if there’s an operation that is removed for utah:

return Context.Plant != "UTAH_SITE_ID";

You can use rule actions similarly to change Operations / Prod Standards or Materials / Quantities:

// Operation Example
string NewOpCode = "ASSEMBLE_KY"; //Operation Code with proper resources
string NewOpDesc = "Assemble at Kentucky";
decimal NewProdStd = 40m;

if (Context.Plant == "UTAH_SITE_ID")
{
    NewOpCode = "ASSEMBLE_UT"; //Utah Operation with resources in Utah
    NewOpDesc = "Assemble at Utah";
    NewProdStd = 55m;
}


JobOper.OpCode = NewOpCode;


// If you don't want to manually set descriptions & prodstandards
// This will pull the defaults from your Operation. 

SetOperationMasterDefaults();

// You can also get the defaults, then change prodStandard, etc.


JobOper.ProdStandard = NewProdStd;
JobOper.OpDesc = NewOpDesc;
2 Likes