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

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

When Notify Job Order Status Change_END from Job Order Notification Endpoint is called?

EB_9744252
4-Participant

When Notify Job Order Status Change_END from Job Order Notification Endpoint is called?

EB_9744252_0-1689164776147.png

I wonder when this service is executed? And how its arguments look like? What does it mean ProcessType? I want to use this mechanism 

EB_9744252_1-1689165024193.png

but I dont know when this NotifyJobOrderStatusChange_END and my custom service (To use Job Order Notifications, a custom service must be created that will receive the Job Order Notification messages from the ThingWorx Applications.) are called   Should I called it by some kind of Scheduler?

 

 

 

 

 

ACCEPTED SOLUTION

Accepted Solutions
mstarnaud
15-Moonstone
(To:EB_9744252)

Hi EB

 

I'll take a step back and explain the situation with this system, partly because I don't suggest doing this section manually (but you customize the next step). Please refer to this documentation link (and the other 2 pages below it) for more detailed information, this is the same documentation from your screenshot.

 

First, when a JobOrder's status changes, a record is added in a todo list. This is done automatically.

 

The second part is your question here : there is the Timer PTC.FSU.CORE.Process.ProcessQueue_TM, which should run every minute, that contains a few subscriptions. Make sure those subscriptions are active - we have seen some issues where they were not active. So the subscription for Notification will check the todo records and will end up calling the service you're asking about (PTC.FSU.CORE.JobOrder.EndPoint_TG -> NotifyJobOrderStatusChange_END) with 2 parameters : type="Notification" and the list of JobOrders from the todo list. So at this point you already have the list of JobOrders to look at. This entire section of the process is automatic and is not expected to be modified.

 

The third part is calling the custom service, giving it parameter JobOrder(s). At the end of the second part, the service will look at the configuration to know what your custom service is and will call it. This is the part you're expected to modify. You are expected to create a custom service, with 1 parameter (JobOrders), and do the actions you want with the JobOrders you receive.

 

As an example, some weeks ago I gave the following instructions to someone who wanted to try the endpoint : 

#1 : Go in Composer, on a Thing. It can be the endpoint Thing (PTC.FSU.CORE.JobOrder.Endpoint_TG).
#2 : Create a service, it receives 1 input : JobOrders (type is JSON), output type is Nothing.
	As a starting point, we can write a simple line of code to see the results : logger.warn("Endpoint service : JobOrders=" + JobOrders);
#3 : Save.
#4 : Go on Thing PTC.FSU.CORE.JobOrder.Endpoint_TG, in the Configuration tab.
#5 : Write the name of the Thing where you added the service (step #1).
#6 : Write the name of the service you created (step #2). Save.
#7 : Check the Bulk Notification box if you want, this is optional. It will group some messages together.
#8 : Go on Thing PTC.FSU.CORE.GlobalConfiguration.GlobalConfiguration_TG.
#9 : Execute service EnableWorkOrderStatusNotification_CFG.

Now you are ready to configure your data and test it : 
#10 : In the Equipment Configuration screen, you need to have an equipment with the Station flag, with an Event Subtype and 2 attributes : Production quantity and Waste quantity.
#11 : In the CWC Authoring - Work Instruction screen, you need to create a Work Instruction with at least 1 step.
#12 : Send the Work Instruction for approval and then approve it.
#13 : In the CWC Routing screen, you need to create a Route. You need to associate it with 1 product.
#14 : In the Route's sequence, select your Work Instruction and equipment. You can add more if you want.
#15 : In the Routing screen, click on the Release button to release the Route.
#16 : In the CWC Scheduling screen, make sure you have a Job Order with serial numbers, associated to your Route, in the Scheduled status.
#17 : Go in the CWC Execution - Assembly screen. Select the equipment to execute your steps on (step #10).
#18 : Select a serial number in the list and start the execution.
#19 : Execute the step(s).

After finishing the JobOrder (and also when we created it and changed the status to Scheduled earlier), it should execute the endpoint's service (step #2).
#20 : Because for our testing we put a logging message in the service's code, we can go see the results in the Composer's Scriptlog.
	Note that it can take a moment (like 1 minute) before the message is sent to the service.

At this point, you can see how the endpoint service gets called and what data you will be getting.
It will be your job to change it to do the exact tasks you want, such as reaching the ERP system with a specific message format.

 

View solution in original post

1 REPLY 1
mstarnaud
15-Moonstone
(To:EB_9744252)

Hi EB

 

I'll take a step back and explain the situation with this system, partly because I don't suggest doing this section manually (but you customize the next step). Please refer to this documentation link (and the other 2 pages below it) for more detailed information, this is the same documentation from your screenshot.

 

First, when a JobOrder's status changes, a record is added in a todo list. This is done automatically.

 

The second part is your question here : there is the Timer PTC.FSU.CORE.Process.ProcessQueue_TM, which should run every minute, that contains a few subscriptions. Make sure those subscriptions are active - we have seen some issues where they were not active. So the subscription for Notification will check the todo records and will end up calling the service you're asking about (PTC.FSU.CORE.JobOrder.EndPoint_TG -> NotifyJobOrderStatusChange_END) with 2 parameters : type="Notification" and the list of JobOrders from the todo list. So at this point you already have the list of JobOrders to look at. This entire section of the process is automatic and is not expected to be modified.

 

The third part is calling the custom service, giving it parameter JobOrder(s). At the end of the second part, the service will look at the configuration to know what your custom service is and will call it. This is the part you're expected to modify. You are expected to create a custom service, with 1 parameter (JobOrders), and do the actions you want with the JobOrders you receive.

 

As an example, some weeks ago I gave the following instructions to someone who wanted to try the endpoint : 

#1 : Go in Composer, on a Thing. It can be the endpoint Thing (PTC.FSU.CORE.JobOrder.Endpoint_TG).
#2 : Create a service, it receives 1 input : JobOrders (type is JSON), output type is Nothing.
	As a starting point, we can write a simple line of code to see the results : logger.warn("Endpoint service : JobOrders=" + JobOrders);
#3 : Save.
#4 : Go on Thing PTC.FSU.CORE.JobOrder.Endpoint_TG, in the Configuration tab.
#5 : Write the name of the Thing where you added the service (step #1).
#6 : Write the name of the service you created (step #2). Save.
#7 : Check the Bulk Notification box if you want, this is optional. It will group some messages together.
#8 : Go on Thing PTC.FSU.CORE.GlobalConfiguration.GlobalConfiguration_TG.
#9 : Execute service EnableWorkOrderStatusNotification_CFG.

Now you are ready to configure your data and test it : 
#10 : In the Equipment Configuration screen, you need to have an equipment with the Station flag, with an Event Subtype and 2 attributes : Production quantity and Waste quantity.
#11 : In the CWC Authoring - Work Instruction screen, you need to create a Work Instruction with at least 1 step.
#12 : Send the Work Instruction for approval and then approve it.
#13 : In the CWC Routing screen, you need to create a Route. You need to associate it with 1 product.
#14 : In the Route's sequence, select your Work Instruction and equipment. You can add more if you want.
#15 : In the Routing screen, click on the Release button to release the Route.
#16 : In the CWC Scheduling screen, make sure you have a Job Order with serial numbers, associated to your Route, in the Scheduled status.
#17 : Go in the CWC Execution - Assembly screen. Select the equipment to execute your steps on (step #10).
#18 : Select a serial number in the list and start the execution.
#19 : Execute the step(s).

After finishing the JobOrder (and also when we created it and changed the status to Scheduled earlier), it should execute the endpoint's service (step #2).
#20 : Because for our testing we put a logging message in the service's code, we can go see the results in the Composer's Scriptlog.
	Note that it can take a moment (like 1 minute) before the message is sent to the service.

At this point, you can see how the endpoint service gets called and what data you will be getting.
It will be your job to change it to do the exact tasks you want, such as reaching the ERP system with a specific message format.

 

Announcements


Top Tags