StateMachineService::StateMachineService(ParsedStateMachinePtr statem, TaskContext* tc)
     : Service( statem->getName() ),
       _this( new ValueDataSource<StateMachinePtr>( statem ) ),
       statemachine(statem),
       mtc(tc)
 {
     this->createOperationFactory();
     this->setOwner( tc );
 }
 StateMachineTask::StateMachineTask(ParsedStateMachinePtr statem, ExecutionEngine* ee)
     : TaskObject( statem->getName() ),
       _this( new ValueDataSource<StateMachineWPtr>( statem ) ),
       statemachine(statem),
       mengine(ee)
 {
     this->createCommandFactory();
     this->createMethodFactory();
     this->setEngine( ee );
 }