| Quintiq file version 2.0 | 
| #parent: #root | 
| MethodOverride Execute ( | 
|   DSP_ServiceCommitterBase local_committer, | 
|   output String soft_error_o | 
| ) as Boolean | 
| { | 
|   TextBody: | 
|   [* | 
|     dataset := local_committer.astype( SWF_ServiceCommitter).Service().WorkflowDataset(); | 
|      | 
|     activity := dataset.GetActivity( this.ActivityObjectID() ); | 
|     parent := dataset.GetStep( this.ActivityParentID() ); | 
|     user := dataset.GetUser( this.ActivityCreatedByUserID() );  | 
|     assigned_auth := select( dataset, Authorization, auth, auth.DisplayName() = this.ActivityAuthorizationID() ); | 
|      | 
|     if( not isnull( activity ) ) | 
|     { | 
|       // only update the status when user is the assigned user | 
|       isnew := not ( user.Name() = assigned_auth.GetAuthorizationUser().Name() or user.Name() = assigned_auth.DisplayName() ); | 
|       activity.Update ( this.ActivityName() | 
|                       , this.ActivityDescription() | 
|                       , this.ActivityIsDefaultOpen() | 
|                       , this.ActivityDueDateHasManual() | 
|                       , this.ActivityDueDate() | 
|                       , this.ActivityCreateOn() | 
|                       , user | 
|                       , assigned_auth | 
|                       , parent | 
|                       , this.ActivityViewLink() | 
|                       , this.ActivityViewLinkWeb() | 
|                       , isnew ); | 
|     } | 
|     else | 
|     { | 
|       SWF_Activity::Create( dataset.WorkflowDefinition().ActiveWorkflow() | 
|                           , this.ActivityName() | 
|                           , this.ActivityDescription() | 
|                           , this.ActivityIsDefaultOpen() | 
|                           , this.ActivityDueDateHasManual() | 
|                           , this.ActivityDueDate() | 
|                           , this.ActivityCreateOn() | 
|                           , user | 
|                           , assigned_auth | 
|                           , parent | 
|                           , this.ActivityViewLink() | 
|                           , this.ActivityViewLinkWeb() | 
|                           , true /* isnew */ ); | 
|     } | 
|      | 
|     return true; | 
|   *] | 
| } |