Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X
Hi,
I am new to ThingWorx platform. Currently I am using ThingWorx version 9.3. It will a great support if I have some sample code on how to implement the below.
Through a Mashup, I am creating a dynamic Scheduler with a JobID, which needs to call the below service which is defined in another thing.
Service (JobID) <<which is defined in another Thing>>
{
... Based on the JobID passed from the Scheduler, I will do some functional logic....
}
If you have any simple and quick solution, Kindly assist.
@Velkumar, @Sathishkumar_C, @VladimirN
Solved! Go to Solution.
Hi @SKannapiran
To make it easier I will post each step with a screenshot
a. mySchedulerThingTemplate
and property to store jobID
b. email service thing myMailThing
And service to send mail based on Job ID
Step 1: Create Scheduler ThingTemplate say 'mySchedulerThingTemplate' using Scheduler ThingTemplate ( Refer 'a' )
Step 2: In mySchedulerThingTemplate create a service/subscription (based on your use case & jobId will be your input) and call service from "myMailThing" (Note: Make sure subscription is enabled)
Step 3: Create dynamic Schedulers through Mashup using ThingTemplate "mySchedulerThingTemplate"
So whenever an event is triggered, "myMailThing" service will be called in dynamic schedulers
I have attached entities for your reference
/VR
Hi @SKannapiran
Assuming "another Thing" service will be the same for all dynamic schedulers, only functional logic varies based on JobID
Step 1: Create Scheduler ThingTemplate say 'mySchedulerThingTemplate' using Scheduler ThingTemplate
Step 2: In mySchedulerThingTemplate create a service/subscription (based on your use case & jobId will be your input) and call service from "another Thing"
Step 3: Create dynamic Schedulers through Mashup using ThingTemplate "mySchedulerThingTemplate"
So whenever an event is triggered "another Thing" service will be called in dynamic schedulers
/VR
Thanks @Velkumar,
For ease of understanding, I have given the steps so far done with properties values.
My understanding, you want me to call the "EmailService" from TriggerEMail service, isnt?
If so, please share the code for it, as I mentioned earlier, I am novice to ThingWorx and my attempts made for this approach are not successful.
Needed code :
Below attempts are failing
var services = TargetThingName.GetServices(); <<GetServices is throwing error>>
targetThing.GetServiceDefinitionByName("TargetServiceName") <<Also throwing error>>
Resources["EntityServices"].GetServices <<Also throwing error>>
Hi @SKannapiran
To make it easier I will post each step with a screenshot
a. mySchedulerThingTemplate
and property to store jobID
b. email service thing myMailThing
And service to send mail based on Job ID
Step 1: Create Scheduler ThingTemplate say 'mySchedulerThingTemplate' using Scheduler ThingTemplate ( Refer 'a' )
Step 2: In mySchedulerThingTemplate create a service/subscription (based on your use case & jobId will be your input) and call service from "myMailThing" (Note: Make sure subscription is enabled)
Step 3: Create dynamic Schedulers through Mashup using ThingTemplate "mySchedulerThingTemplate"
So whenever an event is triggered, "myMailThing" service will be called in dynamic schedulers
I have attached entities for your reference
/VR