Quintiq file version 2.0
#parent: #root
Method Edit (
  internal[GUIComponent] parent,
  SWF_ActivityDefinitionBase activitydefinition
) id:Method_SWF_DialogCreateEditActivityDefinition_Edit
{
  #keys: '[113694.2.1100502902]'
  Body:
  [*
    // Edit activity definition
    data := activitydefinition;
    Dialog.Data( activitydefinition );
    this.EnableDisableComponents();
    
    result := this.DoModal( parent );
    
    if( result > 0 )
    {
      selected_authorization := SWF_AuthorizationBase::GetSelectedAuthorizationFromStringSelections( SWF_WorkflowDataset,
                                                                                                     SWF_StringSelectionManagedBy.BoundValue(),
                                                                                                     SWF_StringSelectionManagedBy.SelectedElement() );
                                                                                                       
      service := SWF_WorkflowDataset.Service();
      service.TR_CreateUpdateActivityDefinition( data.ID(), 
                                              EditorName.Text(),
                                              SWF_WorkflowDataset::FormatStringToNumber( EditorDueoffset.Text() ),
                                              EditorDescription.Text(),
                                              guard( selected_authorization.DisplayName(), '' ),
                                              SelectionStep.Data().ID(),
                                              data.CanGenerateActivity(),
                                              guard( SelectionView.Data().Name(), '' ),
                                              guard( data.ViewLinkWeb(), '' ));  
    }
  *]
}
