Quintiq file version 2.0
#parent: #root
Method Delegate () id:Method_SWF_DialogCreateEditActivity_Delegate
{
  #keys: '[136682.0.610434165]'
  Body:
  [*
    // Forward the activity
    current_date := SWF_WorkflowDataset.GlobalParameter().CurrentDate();
                                                                           
    close_origin_activity := DataHolderIsClose.Data();
    
    origin_activity := DataHolderOriginActivity.Data();
    selectedelement := this.GetSelectionAuthorizationElement();
    selected_authorization := SWF_AuthorizationBase::GetSelectedAuthorizationFromStringSelections( SWF_WorkflowDataset,
                                                                                                   DropDownStringListAssignedTo.Text(),
                                                                                                   selectedelement );
                                                                                                 
    //Auto set created time and created user name
    description := SWF_Translation::TRANSLATE_NewActivityCreatedBy( DateTime::Now(), SWF_WorkflowDataset.GetCurrentUser().Name() ) + String::NewLine() + EditFieldDescription.Text();    
    SWF_WorkflowDataset.Service().TR_ProcessDelegateActivity 
                              ( origin_activity
                              , close_origin_activity
                              , EditFieldTitle.Text()
                              , description
                              , origin_activity.IsDefaultOpen()
                              , true /* Trust user input due date */
                              , DateTimeSelectorDueDate.DateTime().Date()
                              , current_date
                              , SWF_WorkflowDataset.GetCurrentUserID()
                              , guard( selected_authorization.DisplayName(), '' )
                              , guard( DropDownListStep.Data().ID(), Key::ZeroKey() )
                              , SWF_WorkflowDataset.GetCurrentUserID()
                              , guard( origin_activity.ViewLink(), '' )
                              , guard( DropDownListView.Data().Id(), '' ) );
  *]
}
