cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

We are happy to announce the new Windchill Customization board! Learn more.

Issue with Business Rule and ERPConnector

avillanueva
22-Sapphire I

Issue with Business Rule and ERPConnector

First time using this. Short summary, looking to block "Design" view BOMs from being sent to ERP Connector (SAP). I am using preference "Business Rule set to inhibit production BOM publishing" and I have loaded a custom Attribute business rule. I have also set my DT value for "Always publish Production BOM..." to no. Sry I cannot post text of Business Rule but here it is:

avillanueva_0-1625259824410.png

Simple rule that should be true if view=Design. Except that I am still getting Design View BOM Headers in my export when the Change Notice is released. Do I have the right attribute for "view"? I often wonder where the source of the exact names is so I can look them up? I've seen it in the ESIResponseMetaInfo.xml as "view.identity" so I could be wrong there. Is the value right? I know that Design in DB is actually 1445. How can you test a business rule to know if its working? I did not see that in the documentation. Any logs that can be turned on to show it being evaluated? Thanks in advance for any replies.

 

As an aside, what's up with the business rules and specifying an object id? Seems odd. Must I keep track of these numbers now so I do not duplicate them? hmmm...

 

1 ACCEPTED SOLUTION

Accepted Solutions

To paraphrase Rodney D - "I feed like I've given birth ... to a developer!"

Solved, it should not have been this hard.

Rule for Views is like this:

   <config name=view.identity" value="=Design"></config>

Had to use Logical Attribute Report (netmarkets/jsp/lwcType/logicalAttributeReport.jsp). Note that even though "viewName" is listed, would not import since Attribute Condition could not find what data type it was. 

And... it works: Here is the log:

avillanueva_0-1625596272201.png

So, to recap:

  • Distribution Target as "Always publish Production BOM" options set to "YES"
  • Preferences call out Business Rule to prohibit BOM publishing set to my business rule set
  • Now I can post both Design and Manufacturing views to CN Resulting Items and ONLY the Manufacturing BOM is published.

View solution in original post

8 REPLIES 8

Tony,

 

Where you have

<config name="view" value="=Design"></config>

is your value correct

should it be

value="Design"

rather than

value="=Design"

avillanueva
22-Sapphire I
(To:d_graham)

I saw that and changed it to what you have. It complained in load about that. You can see in help why I choose that:

<config name="weight" value="<=100"></config>

Perhaps since its a String, I need to use this:

EQUALS
String
Validates that the object attribute value is the specified string.
EQUALS(MAJOR)

But why would it not care when you have the type declaration like this:

<config name="objectType" value="com.ptc.Waiver"></config>

I will play with this. Thanks Dave. Good to hear from your again.

Tony,

 

Maybe it is looking for a conditional operator? Maybe you need ==

Perhaps value="==Design"

After turning on DEBUG logs, I figured out that the help docs might be in error (others please confirm). The section titled "Configuring Option to Inhibit Publishing of a Production BOM" says you should set value for "Always publish Production BOM for a Part when Publishing..." to No. I confirmed that when it goes to check business rules set in preferences, setting this to no, skips evaluating business rules. Head is getting bloody now. 

 

Now that I can see it evaluating my business rule, I can focus on getting that rule right.

Progress but very strange. I created a set rule [Design,1445,DESIGN] to cover all know possible cases. Verified that "view" was invalid but "view.id" was liked by business rule engine. This is what logs showed:

avillanueva_0-1625593362640.png

None of the above. I believe that since view is actually a table reference, you do not get the nice view names as output. Perhaps I have the wrong attribute name again. Either way, I can work with this and key off of 30427 value which is unique to the output.

To paraphrase Rodney D - "I feed like I've given birth ... to a developer!"

Solved, it should not have been this hard.

Rule for Views is like this:

   <config name=view.identity" value="=Design"></config>

Had to use Logical Attribute Report (netmarkets/jsp/lwcType/logicalAttributeReport.jsp). Note that even though "viewName" is listed, would not import since Attribute Condition could not find what data type it was. 

And... it works: Here is the log:

avillanueva_0-1625596272201.png

So, to recap:

  • Distribution Target as "Always publish Production BOM" options set to "YES"
  • Preferences call out Business Rule to prohibit BOM publishing set to my business rule set
  • Now I can post both Design and Manufacturing views to CN Resulting Items and ONLY the Manufacturing BOM is published.
avillanueva
22-Sapphire I
(To:d_graham)

You get an error on import of the business rule with this: value="Design"

Help docs say that it should be "=Design" or it could be "EXACT(Design" 

Its also possible I have the wrong attribute name. 

Tony,

 

You probably know this but I'll mention it anyway.  WTParts have two attributes, view and view.id

view.id is a String

where as view is a TypeInstanceIdentifier

 

Maybe try using view.id rather then view.

 

Just a thought.

Top Tags