7. Under the constructor of the class, add the following method for reading the associated data:
public string Read()
{
return _dataConnector.RetrieveTruckInfo(InstanceID, TruckID);
}
8. Finally add the code for the event implementation:
The code for the event implementation
public void Raisetruckleavingevent (Int32 truckid,
Int32 Startingx,
Int32 startingy)
{
if (_workflowruntime = null)
_workflowruntime = new WorkflowRuntime ();
Loads persisted workflow instances.
_workflowruntime.getworkflow (_instanceid);
if (truckleaving!= null)
{
Truckleaving (This, new Truckactivityeventargs (_instanceid,
Truckid,
STARTINGX,
Startingy));
}//If
}
public void Raiserouteupdatedevent (Int32 truckid,
Int32 X,
Int32 Y)
{
if (_workflowruntime = null)
_workflowruntime = new WorkflowRuntime ();
Loads persisted workflow instances.
_workflowruntime.getworkflow (_instanceid);
if (routeupdated!= null)
{
Routeupdated (This, new Truckactivityeventargs (_instanceid,
Truckid,
X, Y));
}//If
}
public void Raisetruckarrivedevent (Int32 truckid)
{
if (_workflowruntime = null)
_workflowruntime = new WorkflowRuntime ();
Loads persisted workflow instances.
_workflowruntime.getworkflow (_instanceid);
if (truckarrived!= null)
{
Truckarrived (This, new Truckactivityeventargs (_instanceid,
Truckid));
}//If
}