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

ThingWorx Navigate is now Windchill Navigate Learn More

Translate the entire conversation x

About RTPPM Job Order System And Sync Configuration

CB_10149096
12-Amethyst

About RTPPM Job Order System And Sync Configuration

Hi Everyone.

 

I have a service that takes job orders from ERP and saves RTPPM's job order and job order ap table. And works just fine.

But my problem is sometimes job orders and products change via equipment things even job order sync and product sync configurations are disabled. (For information Use Job Order Model and Use Product Model is enabled.)

 

Is there any service that changes this tables?

ACCEPTED SOLUTION

Accepted Solutions

Hi

 

Officially, endpoints only work for CWC and not RTPPM. Meaning there's a chance that it doesn't work correctly (for example : joborder missing an important information for RTPPM). And also you couldn't create support tickets for issues about this.

 

Now, does it realistically work? I have an old memory that there was one small reason why it did not work, but I'm not sure what it was. One of my suspects is maybe it puts the joborder in the wrong status (Not Scheduled?) which might be used by CWC and not RTPPM. If I'm correct, in order to work with RTPPM it would require an additional piece of code to change its status.

 

If possible, you should try to confirm if it works, it's not too complicated. Note that if it doesn't work, make sure that Timer PTC.FSU.CORE.Process.ProcessQueue_TM is enabled and has its 4 subscriptions active, as this is needed to finish importing with endpoints. On my side I will try to also test it soon but I'm not sure when I will have time.

View solution in original post

16 REPLIES 16

Hi CB

 

Can you please say which version of RTPPM you have?

 

Please answer the following questions, it will help debug this : 

- The Joborder and Joborder_ap tables are filled by the service that receives them from ERP. This is correct so far?

- The product table, is it also filled by the same service that receives them from ERP? If not, what else feeds it?

- In the Configuration tab, the SyncJobOrders and SyncProducts options are set to False, is this correct?

- Did you enable the RTPPM subscription called ProductTag_Subscription on the equipment? For reference, this just puts the product in the todo list.

- Did you enable the RTPPM subscription called JobOrder_Subscription on the equipment? Or does JobOrderProdEvent_Subscription contain the code for joborder & is enabled? For reference, this just puts the joborder in the todo list.

- Did you enable the RTPPM subscription called ProductionByTagAndTime_SubscriptionService on the equipment? I think it should be, even if your products & joborders come from ERP.

- When you want to change the active product or joborder, how do you do it? Do you use the tags and subscriptions? Do you use the Operator Dashboard screen? Do you have custom code for this (coming from ERP)?

- When a product or joborder comes (I'm guessing this is from a tag), it changes the already-existing information in the Product and Joborder and Joborder_ap tables. And this is your problem. Did I understand this correctly?

 

 

- Can you please use the following query to get the list of paths & routing items configured (change the equipment name in the condition near the end) : 

 

SELECT	e.uid 'EquipmentUid',
		e.name 'EquipmentName',
		pp.uid 'PathUid',
		pp.name 'PathName',
		pp.equipmentuid 'PathEquipmentUid',
		pp.isreleased,
		ri.uid 'RoutingItemUid',
		ri.equipmentuid 'RoutingEquipmentUid',
		ri.productionpathuid 'RoutingPathUid',
		ri.sequencenumber,
		ri.isscheduledpoint,
		ri.isproductionnotification,
		ri.isproductionpoint,
		ri.iscountforwaste,
		ri.isconstraintunit
FROM	equipment e			WITH(NOLOCK)
LEFT
JOIN	productionpath pp	WITH(NOLOCK)
							ON	pp.equipmentuid = e.uid
LEFT
JOIN	routingitem ri		WITH(NOLOCK)
							ON	ri.productionpathuid = pp.uid
							OR	ri.equipmentuid = e.uid
WHERE	e.name = 'EQUIPMENT_NAME_GOES_HERE' -- CHANGE THIS
AND		(
			pp.equipmentuid = e.uid
			OR
			ri.equipmentuid = e.uid
		)
ORDER
BY		pp.uid		ASC,
		ri.uid		ASC

 

- Can you get all the PathUids and/or RoutingPathUids returned by that query, and then run this second query looking for a joborder that was modified?

 

SELECT	jo.uid,
		jo.id,
		jo.actualstarttime,
		jo.actualendtime,
		joap.name,
		joap.displayname,
		joap.productionpathuid,
		joap.plannedquantity,
		joap.productuid,
		e.uid 'EquipmentUid',
		e.name 'EquipmentName',
		COUNT(jor.uid) 'RunsCount',
		MIN(jor.starttime) 'RunsStart',
		MAX(COALESCE(jor.endtime, '2030-01-01')) 'RunsEnd'
FROM	joborder jo			WITH(NOLOCK)
JOIN	joborder_ap joap	WITH(NOLOCK)
							ON	joap.uid = jo.uid
LEFT
JOIN	joborderrun jor		WITH(NOLOCK)
							ON	jor.joborderuid = jo.uid
LEFT
JOIN	equipment e			WITH(NOLOCK)
							ON	e.uid = jor.equipmentuid
WHERE	(
			joap.productionpathuid IN(1,2,3,4,5,6,7,8,9) -- CHANGE THIS
			OR
			joap.name = 'JOBORDER_NAME_HERE' -- CHANGE THIS
		)
AND		(
			jor.uid IS NULL
			OR
			e.name = 'EQUIPMENT_NAME_GOES_HERE' -- CHANGE THIS
		)
GROUP
BY		jo.uid,
		jo.id,
		jo.actualstarttime,
		jo.actualendtime,
		joap.name,
		joap.displayname,
		joap.productionpathuid,
		joap.plannedquantity,
		joap.productuid,
		e.uid,
		e.name
ORDER
BY		joap.name	ASC,
		jo.uid		ASC

 

Note that these queries work on versions before 9.7.0, I would need to adapt them slightly for the latest versions.

 

The reason I put those queries here is I am suspecting that maybe you have problems with the configuration of paths, routing items, or the ProductionPathUid column of the Joborder_ap table. For example if you leave the ProductionPathUid column empty when you insert the Joborder_ap, I think you would get the issue you're mentioning and it could result in having a "duplicate" joborder. Also if you have more than 1 Routingitem record returned by the first query it could give strange results when the models run, I suspect it would just cause an error and ignore the tag's value but I'm not sure. Feel free to post the results of the queries here if you want, but you might want to remove the names if you post it here in public.

 

Hi


 

 

Can you please say which version of RTPPM you have?

We use version ThingWorx 9.3.9-b1648.

 


- The Joborder and Joborder_ap tables are filled by the service that receives them from ERP. This is correct so far?


Yes that is correct

- The product table, is it also filled by the same service that receives them from ERP? If not, what else feeds it?


No. The product table is filled by customer. It's predeterminated. We check if product exist before add joborder from ERP. If it is'nt exist then we do not add that job order.

- In the Configuration tab, the SyncJobOrders and SyncProducts options are set to False, is this correct?


That is also correct.

- Did you enable the RTPPM subscription called ProductTag_Subscription on the equipment? For reference, this just puts the product in the todo list.


 Yes it is enabled.


- Did you enable the RTPPM subscription called JobOrder_Subscription on the equipment? Or does JobOrderProdEvent_Subscription contain the code for joborder & is enabled? For reference, this just puts the joborder in the todo list.


Yes this is also enabled.

- Did you enable the RTPPM subscription called ProductionByTagAndTime_SubscriptionService on the equipment? I think it should be, even if your products & joborders come from ERP.


If you meant ProductionByTagAndTime_Subscription yes that is enabled too.

 

- When you want to change the active product or joborder, how do you do it? Do you use the tags and subscriptions? Do you use the Operator Dashboard screen? Do you have custom code for this (coming from ERP)?


In this departman, all joborder comes with one product. So we don't want to change product accually. while you mention suscription, maybe we should disable it. Is it correct?

- When a product or joborder comes (I'm guessing this is from a tag), it changes the already-existing information in the Product and Joborder and Joborder_ap tables. And this is your problem. Did I understand this correctly?


We manually open joborder. from operator dashboard. So we don't use kepware tag. we only use tag for downtimes.

- Can you please use the following query to get the list of paths & routing items configured (change the equipment name in the condition near the end) : 


If you want we disguess theese. If we can't fix it, i will share rest of it.

Sincerely






Hi CB

 

>Can you please say which version of RTPPM you have? We use version ThingWorx 9.3.9-b1648.

 

Oh, there's a few things to know here. First that's a very old version that isn't supported anymore, I'll still help you but if we can't find the solution quickly my answer might be "you need to upgrade". 9.7.0 should be a great version to upgrade to, you just need to be careful about the TagResetValue after upgrading to 9.5.0+ (re-read this documentation, TagResetValue section). Second, the number you gave me is for Thingworx, not RTPPM. For RTPPM, go in Composer -> Manage (the gear icon) -> Installed Extensions (at the bottom) -> RTKPI extension. The number should be around 2.0.1 for you.

 

For the product : I'm understanding that you only use 1 product per machine, so an equipment never needs to change it after the 1st one starts. In that situation you can leave it as normal, or if you're certain it will never change then you can remove the tag binding on the ProductRemoteTag property so it will never detect a change, or disable subscription ProductTag_Subscription so it never processes it. But the product tag should not cause a joborder change, so you're not forced to do this to fix the joborder issue.

 

For the joborder : Can you please confirm if the JobOrderRemoteTag property/tag has changed value? This is my main suspect right now : that it is bound to a tag, and the tag value changed, so the subscription automatically changed the running joborder. Similar to the product, if you're certain that you never want to change it via subscription, you could remove the tag binding on JobOrderRemoteTag or disable subscription (JobOrder_Subscription). This will disable the automatic process that reads the tag and changes the running joborder. It will still let you change the joborder manually in the screen (Operator Dashboard).

 

If you want to validate if this was the issue, you can edit the JobOrderRemoteTag property, set its Log setting to True, and it will save all the changes in Valuestream. Then after the issue happens, you can check the time when the joborder was started "by mistake" in the Joborderrun table in SQL, and check if there was a value in JobOrderRemoteTag at that same time (in Thingworx's value_stream table in SQL, or using the QueryPropertyHistory service).  Remember to remove the Log setting after you check this. If this is not the root cause, then my only other suspects are custom code or someone manually clicking in the screen.

Thanks for your answer, but disabling Subscription is not solved my issue. I guess we need upgrade but decision is not up to me. 

 

I guess you can help me with giving information about how works ProductModelPropertyBindings and JobOrderModelPropertyBindings in the configuration tab. How this properties apply to the tables? And even i uncheck sync radio buttons, how could it be possible work?

Hi CB

 

Here's how the subscriptions work : 

 

- The tag puts the value in the ___RemoteTag property (Product and Joborder).

 

- There is a subscription on this property, that will copy the value in the Valuestream (saved values) of the Running___ property (Product and Joborder).

 

- There is a central subscription called ProductionByTagAndTime_Subscription. It's based on a timer that should trigger every 5 seconds. This will call a huge service that will call smaller services to do multiple stuff. It will check if there are waiting values in the Valuestream for Product, Joborder and Production. It will apply the changes (product change, joborder change, production change). And it will mark the Valuestream values as ready to be purged (there is another timer that will purge them some seconds later).

 

- There is also the option to use the button in the screen, to change the Joborder. I think what it does is it calls a service that is in the middle of the bigger service I just mentioned above, instead of using a value stored in Valuestream it receives the value from the one chosen in the screen.

 

So I suggested removing step 2, which would break the tag logic : the tag would not cause Joborder changes anymore. If that wasn't enough for you, it's because something else is causing those Joborder changes. It seems you have a lot of custom code, so it is my main suspect.

 

For the property bindings, it works like this : when a new Product or Joborder is detected in the Valuestream by the services I mentioned above, it will try to create it in the Product or Joborder table. It should not edit existing records. The service will already know the Name : it's the value in the tag/Valuestream. But to know what to use in all the other properties of the Product/Joborder, we can add those values in the PropertyBindings configuration. For example, products have a ProductType and a Displayname, so you can enter the values that you want to use in the Configuration tab. So for example if you write "Pallet" in the ProductypeName, then when it creates the product it will choose the Pallet product type. You can also write the name of a property that will contain the value. For example, for the Joborder's Planned Quantity, you can have a tag-based property called Planned_Qty, then write "Planned_Qty" in the PlannedQuantity binding, and so when a new Joborder gets created it will set the PlannedQuantity to the value that is inside the Planned_Qty property at that time. Most of these settings are optional, but I strongly recommend using the Product's ProductTypeName and the Joborder's PlannedQuantity bindings. This should be explained in this Joborder documentation and Product documentation.

 

For the Sync options, if you set them to True then the subscription will accept creating new Products & Joborders if they don't exist. If you receive a value in the tag/Valuestream (step 1 mentioned above), and that value is for a Product/Joborder that does not exist and you left the sync option to False, then it will throw an error to say the Product/Joborder does not exist so the value will be ignored.

Hello @CB_10149096,

 

You have some responses from a PTC support expert. If any of these replies helped you solve your question please mark the appropriate reply as the Accepted Solution. 
Of course, if you have more to share on your issue, please let the Community know so other community members can continue to help you.

Thanks,
Vivek N.
Community Moderation Team.

oaslan
14-Alexandrite
(To:mstarnaud)

Hi,

Can we use Job order Endpoint to import orders into RTPPM? We want operators to select an order from the table in the Start Work Order pop-up. (V10.0) Thanks in advance.

Hi

 

Officially, endpoints only work for CWC and not RTPPM. Meaning there's a chance that it doesn't work correctly (for example : joborder missing an important information for RTPPM). And also you couldn't create support tickets for issues about this.

 

Now, does it realistically work? I have an old memory that there was one small reason why it did not work, but I'm not sure what it was. One of my suspects is maybe it puts the joborder in the wrong status (Not Scheduled?) which might be used by CWC and not RTPPM. If I'm correct, in order to work with RTPPM it would require an additional piece of code to change its status.

 

If possible, you should try to confirm if it works, it's not too complicated. Note that if it doesn't work, make sure that Timer PTC.FSU.CORE.Process.ProcessQueue_TM is enabled and has its 4 subscriptions active, as this is needed to finish importing with endpoints. On my side I will try to also test it soon but I'm not sure when I will have time.

oaslan
14-Alexandrite
(To:mstarnaud)

Thank you for the fast response. No it doesn't work. I have some ideas but don't know which is the main reason. 

The "ImportJobOrder_END" service has these lines below that looks for CWC presence.

"const isCwcInstalled = Things[toolbox.GetInstallerThing_TBX()].IsApplicationInstalled_INS({ SolutionName: 'FSU - CWC' });
if (JobOrderList && isCwcInstalled) {

..."

Despite this, I ran the service with test data and got this result : "Success—Job order information validated successfully. The transaction has been added to the processing queue to create or update the job order." But there is no entry in the joborder table. I don't know where it's stored.

 

I tried to run CreateJobOrder service in CoreSQLThing, but it seems joborder table has different columns than the ones in the service.

 

Any idea?

Hi

 

2 important parts to know : 

 

- the Endpoint service will do a quick check to see if the json looks good and put the result in a todo list : it's the ProcessRunning table in SQL. Then there is a Timer called PTC.FSU.CORE.Process.ProcessQueue_TM (the one I mentioned earlier) that will regularly check if there are records to process, and it will try to finish the import & create the Joborder. To see the progress of this, you can look at the ProcessRunning and ProcessCompleted tables and check the status & DebugMessage.

 

- About the SQL table for Joborders, this is the only one that uses the _ap table. So half the information is in the Joborder table and half the information is in the Joborder_ap table, with the same Uid. I believe for RTPPM the most important parts are : Joborder.Id, Joborder.StatusDefinitionUid, Joborder_ap.name, Joborder_ap.Displayname, Joborder_ap.ProductUid, Joborder_ap.PlannedQuantity (optional).

oaslan
14-Alexandrite
(To:mstarnaud)

Hi mstarnaud,

 

I was able to successfully import a job order after enabling PTC.FSU.CORE.Process.ProcessQueue_TM and its subscriptions. I still have an issue with assigning the job order to a particular line or equipment. In the older versions, I could set a ProductionPath for a job order. This meant that only the equipment assigned to the job could see it. Instead, I found a new ProductionPathVersionLinkUID column that can be null. This is causing the job order to not be assigned to any equipment but all. There is no UI to manage ProductionPathVersionLinkUID.

 

Now I will try to run Product import endpoint because new products are released though not often. I guess it runs like JobOrder import.

 

Hi Oaslan

 

For the products : yes the import endpoint should work (although again officially it's just for CWC). But there's an even easier method : there's a screen when you can manage them, it's in the main menu -> Configuration -> Products -> Products tab.

 

For the Joborders : ah I didn't realize you already upgraded to version 9.7.0 or above (you said 10.0 in your other post). Starting in 9.7, there's a new versioning system for paths and it's a bit complicated : ProductionPathVersionLink should be reserved for CWC. For RTPPM, the paths' items (previously the RoutingItems table) is now in the RTPPMRouteConfiguration table, it's the list of equipments that are part of the path. For the part where the joborder isn't linked to the equipment, the RTPPMRouteconfiguration table for sure will be required, but on top of that there's the possibility that the Joborder_ap.ProductionPathUid column may be required for this, I forgot to mention this column in my previous email. I would need to test it to make sure (I haven't had the time yet and probably won't for a few more days still).

Hi Oaslan

 

Sorry for the long delay but I finally had time to test this and got it working. I tested it in 9.7.1, but I think it should work the same in 10.0.0.

 

My setup : I configured an equipment to work with RTPPM normally. This includes having products (if needed you can create them in the Configuration -> Products screen). It also includes filling the Production Path & Routing Items sheets in the Excel import file (see documentation here), the result of that goes into the SQL table called rtppmrouteconfiguration. Here is what my rtppmrouteconfiguration record looked like : 

mstarnaud_0-1755797297333.png

We don't use the ProductionPath and ProductionPathVersionLink tables at all in RTPPM starting with this version. 

 

When I tested I already had a joborder running, but I think it will work even if the equipment has never run a joborder before.

 

Then I used the import service (Thing PTC.FSU.CORE.JobOrder.EndPoint_TG, service ImportJobOrder_END) to import the joborder. Here is what my test import looked like :

 

{
	"JobOrderList":[
		{
			"JobOrderName":"MY_JOBORDER_NAME_HERE",
			"Product":"PRODUCT1",
			"PlannedQuantity":1,
			"PlannedStartTime":"2025-08-22",
			"PlannedEndTime":"2025-09-01",
			"UnitOfMeasure":"ea"			
		}
	]
}

 

If you want, you can remove the start & end times and the unit of measure. The only required parts are the name, the product (must already exist) and the quantity. Also, in my previous messages I was saying maybe you need the Joborder_ap.ProductionPathUid, well now I confirmed that this is not needed.

 

This gave me a success message, it sent the result into the ProcessRunning SQL table. Then moments later the Timer processed the ProcessRunning table and the Joborder was added to the list. Then I was able to go in the Operator Dashboard and change the running joborder, the one I imported appeared in the list correctly and I was able to run it.

 

Let me know if you have other questions regarding this.

Hello @CB_10149096

 

It looks like you have some responses from a community member. If any of these replies helped you solve your question please mark the appropriate reply as the Accepted Solution. 

Of course, if you have more to share on your issue, please let the Community know so other community members can continue to help you.

Thanks,
Vivek N.
Community Moderation Team.

Thank you but my issue not solved yet. I was busy in other development and you can be sure that if the problem solves, i will mark. 

Hi @CB_10149096


I wanted to follow up with you on your post to see if your question has been answered.
If so, please mark the appropriate reply as the Accepted Solution for the benefit of other members who may have the same question.
Of course, if you have more to share on your issue, please let the Community know so that we can continue to support.
 

Thanks,
Abhi

 

Announcements


Top Tags