chenqinghong
2024-05-07 3ec06a830367465068963156dcc1d8e522571c13
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Quintiq file version 2.0
#parent: CustomDrawDataLayerWorkflowDefinition
Response OnDrawObject (
  SWF_WorkflowDefinition object
) id:Response_SWF_CustomDrawComponentProcessDashboard_CustomDrawDataLayerWorkflowDefinition_OnDrawObject
{
  #keys: '[113694.2.1117781579]'
  Body:
  [*
    // Draw Workflow info
    //this.Rectangle( region ); // Debug
    surface.TextColor( Color::White() );
    
    current_user := SWF_DataHolderCurrentUser.Data();
    
    if( not isnull( current_user ) )
    {
      gp                    := SWF_WorkflowDataset.GlobalParameter(); 
      bigfont               := FontSpecification::Construct( gp.DashboardFont(), gp.DashboardFontSizeBig() );
      mediumfont            := FontSpecification::Construct( gp.DashboardFont(), gp.DashboardFontSizeMedium() );
      leftmargin            := 25;
      active_workflow_name  := SWF_WorkflowDataset::GUI_ProcessDashboard_FormatName( guard( object.ActiveWorkflow().Name(), '' ) )
      user_and_date         := current_user.Name() + " - " + SWF_WorkflowDataset::GUI_ProcessDashboard_FormatDateToString( object.Dataset().GlobalParameter().CurrentDate() );
      nr_open_activity      := counter( current_user, AssignedActivity, aa, aa.Workflow().IsActive() and aa.Status() = SWF_ActivityBase::STATUS_Executable() );
      str_open_activity     := SWF_WorkflowDataset::GIU_ProcessDashboard_FormatActiveActivities( nr_open_activity );
      
      surface.Font( bigfont );
      surface.Text( leftmargin, 20, active_workflow_name );
      
      surface.Font( mediumfont );
      surface.Text( leftmargin, 55, user_and_date );
      surface.Text( leftmargin, 85, str_open_activity );
    }
  *]
  CanBindMultiple: false
  DefinitionID: 'Responsedef_CustomDrawDataLayer_OnDrawObject'
}