| Quintiq file version 2.0 | 
| #parent: #root | 
| Method New ( | 
|   internal[GUIComponent] parent, | 
|   SWF_StepDefinition stepdefinition | 
| ) as SWF_ActivityDefinition id:Method_SWF_DialogCreateEditActivityDefinition_New | 
| { | 
|   #keys: '[113694.2.1100499076]' | 
|   Body: | 
|   [* | 
|     // Create new activity definition | 
|     data := null( SWF_ActivityDefinition ); | 
|     Dialog.Data( data ); | 
|      | 
|     SelectionStep.Data( stepdefinition ); | 
|     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(  Key::ZeroKey(), //SWF_WorkflowDataset.GetNewGlobalID(), | 
|                                                   EditorName.Text(), | 
|                                                   SWF_WorkflowDataset::FormatStringToNumber( EditorDueoffset.Text() ), | 
|                                                   EditorDescription.Text(), | 
|                                                   guard( selected_authorization.DisplayName(), '' ), | 
|                                                   SelectionStep.Data().ID(), | 
|                                                   true, | 
|                                                   guard( SelectionView.Data().Name(), '' ), | 
|                                                   guard( data.ViewLinkWeb(), '' )); | 
|     }  | 
|      | 
|     return data; | 
|   *] | 
| } |