Hi
I recently modified a Lego Technics Excavator so that it was controlled via ThingWorx and a Raspberry Pi rather than the Infra Red controller it comes with. I used the Java SDK to write the "agent" on the Pi. The Pi had a motor controller hat (from AdaFruit) on it. I had to write java code to create some methods within the Agent to control the motors, the hat uses Pulse Width Modulation to control motor speed writing Java to control this was a pain! By varying the values you use it is possible to control the motor speed with quite a range of speeds available. As the Excavator only needs motors to be on forwards, on backwards and off. I always run them at full speed.
So, short answer is yes. The bigger question is what hardware/software combination are you using to control the motor? You need to write code methods that control your motor - make sure these work outside of ThingWorx. Wrap these methods in ThingWorx Services as part of your agent. Then when your device connects, bring these services into the model definition (Services page, Browse Remote services button) once you have the service(s) there you can call them like any other ThingWorx service. Don't forget to have a subscription to turn the motor off when the temperature drops.
Remote services are very powerful and surprisingly quick in operation.
Regards
Ian