1 // Created on: 1999-11-19
2 // Created by: Andrey BETENEV
3 // Copyright (c) 1999-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
18 #include <StepAP203_CcDesignApproval.hxx>
19 #include <StepAP203_CcDesignDateAndTimeAssignment.hxx>
20 #include <StepAP203_CcDesignPersonAndOrganizationAssignment.hxx>
21 #include <StepAP203_CcDesignSecurityClassification.hxx>
22 #include <StepBasic_Approval.hxx>
23 #include <StepBasic_ApprovalDateTime.hxx>
24 #include <StepBasic_ApprovalPersonOrganization.hxx>
25 #include <StepBasic_ApprovalRole.hxx>
26 #include <StepBasic_DateAndTime.hxx>
27 #include <StepBasic_DateTimeRole.hxx>
28 #include <StepBasic_PersonAndOrganization.hxx>
29 #include <StepBasic_PersonAndOrganizationRole.hxx>
30 #include <StepBasic_ProductCategoryRelationship.hxx>
31 #include <StepBasic_SecurityClassificationLevel.hxx>
32 #include <STEPConstruct_AP203Context.hxx>
33 #include <STEPConstruct_Part.hxx>
34 #include <StepRepr_NextAssemblyUsageOccurrence.hxx>
35 #include <StepShape_ShapeDefinitionRepresentation.hxx>
41 # include <winsock2.h>
46 #include <OSD_Process.hxx>
47 #include <Quantity_Date.hxx>
49 #include <TCollection_HAsciiString.hxx>
50 #include <TColStd_SequenceOfAsciiString.hxx>
51 #include <Interface_HArray1OfHAsciiString.hxx>
53 #include <StepBasic_CalendarDate.hxx>
54 #include <StepBasic_LocalTime.hxx>
55 #include <StepBasic_ApprovalStatus.hxx>
56 #include <StepBasic_CoordinatedUniversalTimeOffset.hxx>
57 #include <StepBasic_AheadOrBehind.hxx>
58 #include <StepBasic_Person.hxx>
59 #include <StepBasic_Organization.hxx>
60 #include <StepBasic_SecurityClassification.hxx>
61 #include <StepBasic_Product.hxx>
62 #include <StepBasic_ProductDefinition.hxx>
63 #include <StepBasic_ProductDefinitionFormation.hxx>
64 #include <StepBasic_ProductRelatedProductCategory.hxx>
65 #include <StepAP203_HArray1OfPersonOrganizationItem.hxx>
66 #include <StepAP203_HArray1OfClassifiedItem.hxx>
67 #include <StepAP203_HArray1OfDateTimeItem.hxx>
68 #include <StepAP203_HArray1OfApprovedItem.hxx>
69 #include <StepBasic_ProductCategory.hxx>
71 //=======================================================================
72 //function : STEPConstruct_AP203Context
74 //=======================================================================
76 STEPConstruct_AP203Context::STEPConstruct_AP203Context ()
81 //=======================================================================
82 //function : DefaultApproval
84 //=======================================================================
86 Handle(StepBasic_Approval) STEPConstruct_AP203Context::DefaultApproval ()
88 if ( defApproval.IsNull() ) {
89 Handle(StepBasic_ApprovalStatus) aStatus = new StepBasic_ApprovalStatus;
90 Handle(TCollection_HAsciiString) aName = new TCollection_HAsciiString ("not_yet_approved");
91 aStatus->Init ( aName );
93 Handle(TCollection_HAsciiString) aLevel = new TCollection_HAsciiString ("");
94 defApproval = new StepBasic_Approval;
95 defApproval->Init ( aStatus, aLevel );
100 //=======================================================================
101 //function : SetDefaultApproval
103 //=======================================================================
105 void STEPConstruct_AP203Context::SetDefaultApproval (const Handle(StepBasic_Approval) &app)
110 //=======================================================================
111 //function : DefaultDateAndTime
113 //=======================================================================
115 Handle(StepBasic_DateAndTime) STEPConstruct_AP203Context::DefaultDateAndTime ()
117 if ( defDateAndTime.IsNull() ) {
119 Quantity_Date date = sys.SystemDate ();
121 Handle(StepBasic_CalendarDate) aDate = new StepBasic_CalendarDate;
122 aDate->Init ( date.Year(), date.Day(), date.Month() );
124 Handle(StepBasic_CoordinatedUniversalTimeOffset) zone =
125 new StepBasic_CoordinatedUniversalTimeOffset;
126 #if defined(_MSC_VER) && _MSC_VER >= 1600
128 _get_timezone (&shift);
130 Standard_Integer shift = Standard_Integer(timezone);
132 Standard_Integer shifth = abs ( shift ) / 3600;
133 Standard_Integer shiftm = ( abs ( shift ) - shifth * 3600 ) / 60;
134 StepBasic_AheadOrBehind sense = ( shift >0 ? StepBasic_aobBehind :
135 shift <0 ? StepBasic_aobAhead :
136 StepBasic_aobExact );
137 zone->Init ( shifth, ( shiftm != 0 ), shiftm, sense );
139 Handle(StepBasic_LocalTime) aTime = new StepBasic_LocalTime;
140 aTime->Init ( date.Hour(), Standard_True, date.Minute(), Standard_False, 0., zone );
142 defDateAndTime = new StepBasic_DateAndTime;
143 defDateAndTime->Init ( aDate, aTime );
145 return defDateAndTime;
148 //=======================================================================
149 //function : SetDefaultDateAndTime
151 //=======================================================================
153 void STEPConstruct_AP203Context::SetDefaultDateAndTime (const Handle(StepBasic_DateAndTime) &dt)
158 //=======================================================================
159 //function : DefaultPersonAndOrganization
161 //=======================================================================
163 Handle(StepBasic_PersonAndOrganization) STEPConstruct_AP203Context::DefaultPersonAndOrganization ()
165 if ( defPersonAndOrganization.IsNull() ) {
166 // get IP address as a unique id of organization
167 #ifdef _WIN32 // adapted for NT which lacks gethostent()
170 gethostname ( hostname, 1020 );
171 hostname[1020] = '\0';
172 struct hostent *he = gethostbyname ( hostname );
173 #else // adapted for Sun2.5, which lacks definition of gethostname()
174 struct hostent *he = gethostent();
175 while ( he && he->h_name && (unsigned char)he->h_addr_list[0][0] == 127 )
178 Handle(TCollection_HAsciiString) orgId = new TCollection_HAsciiString ( "" );
179 if ( he && he->h_addr_list && he->h_length >0 ) {
181 unsigned i1 = (unsigned char)he->h_addr_list[0][0];
182 unsigned i2 = (unsigned char)he->h_addr_list[0][1];
183 unsigned i3 = (unsigned char)he->h_addr_list[0][2];
184 sprintf ( str, "IP%03u.%03u.%03u.000", i1, i2, i3 );
185 orgId->AssignCat ( str );
188 // create organization
189 Handle(StepBasic_Organization) aOrg = new StepBasic_Organization;
190 Handle(TCollection_HAsciiString) oName = new TCollection_HAsciiString ( "Unspecified" );
191 Handle(TCollection_HAsciiString) oDescr = new TCollection_HAsciiString ( "" );
192 aOrg->Init ( Standard_True, orgId, oName, oDescr );
194 // construct person`s name
196 Standard_CString usr = sys.UserName().ToCString();
197 #if !defined(_WIN32) && !defined(__ANDROID__)
199 struct passwd *pwd = getpwnam ( usr );
200 if ( pwd ) usr = pwd->pw_gecos;
202 else usr = "Unknown";
204 TCollection_AsciiString user ( usr );
205 Handle(TCollection_HAsciiString) fname = new TCollection_HAsciiString ("");
206 Handle(TCollection_HAsciiString) lname = new TCollection_HAsciiString ("");
207 Handle(Interface_HArray1OfHAsciiString) mname;
208 TColStd_SequenceOfAsciiString names;
209 Standard_Integer i; // svv Jan11 2000 : porting on DEC
211 TCollection_AsciiString token = user.Token ( " \t", i );
212 if ( ! token.Length() ) break;
213 names.Append ( token );
215 if ( names.Length() >0 ) fname->AssignCat ( names.Value(1).ToCString() );
216 if ( names.Length() >1 ) lname->AssignCat ( names.Value(names.Length()).ToCString() );
217 if ( names.Length() >2 ) {
218 mname = new Interface_HArray1OfHAsciiString ( 1, names.Length()-2 );
219 for ( i=2; i < names.Length(); i++ )
220 mname->SetValue ( i-1, new TCollection_HAsciiString ( names.Value(i) ) );
224 Handle(StepBasic_Person) aPerson = new StepBasic_Person;
225 Handle(TCollection_HAsciiString) uid = new TCollection_HAsciiString ( orgId );
226 uid->AssignCat ( "," );
227 uid->AssignCat ( TCollection_AsciiString ( sys.UserId() ).ToCString() );
228 Handle(Interface_HArray1OfHAsciiString) suffix, prefix;
229 aPerson->Init ( uid, Standard_True, lname, Standard_True, fname, ( ! mname.IsNull() ),
230 mname, Standard_False, suffix, Standard_False, prefix );
232 defPersonAndOrganization = new StepBasic_PersonAndOrganization;
233 defPersonAndOrganization->Init ( aPerson, aOrg );
235 return defPersonAndOrganization;
238 //=======================================================================
239 //function : SetDefaultPersonAndOrganization
241 //=======================================================================
243 void STEPConstruct_AP203Context::SetDefaultPersonAndOrganization (const Handle(StepBasic_PersonAndOrganization) &po)
245 defPersonAndOrganization = po;
248 //=======================================================================
249 //function : DefaultSecurityClassificationLevel
251 //=======================================================================
253 Handle(StepBasic_SecurityClassificationLevel) STEPConstruct_AP203Context::DefaultSecurityClassificationLevel ()
255 if ( defSecurityClassificationLevel.IsNull() ) {
256 defSecurityClassificationLevel = new StepBasic_SecurityClassificationLevel;
257 Handle(TCollection_HAsciiString) levName = new TCollection_HAsciiString ( "unclassified" );
258 defSecurityClassificationLevel->Init ( levName );
260 return defSecurityClassificationLevel;
263 //=======================================================================
264 //function : SetDefaultSecurityClassificationLevel
266 //=======================================================================
268 void STEPConstruct_AP203Context::SetDefaultSecurityClassificationLevel (const Handle(StepBasic_SecurityClassificationLevel) &scl)
270 defSecurityClassificationLevel = scl;
273 //=======================================================================
274 //function : RoleCreator
276 //=======================================================================
278 Handle(StepBasic_PersonAndOrganizationRole) STEPConstruct_AP203Context::RoleCreator () const
283 //=======================================================================
284 //function : RoleDesignOwner
286 //=======================================================================
288 Handle(StepBasic_PersonAndOrganizationRole) STEPConstruct_AP203Context::RoleDesignOwner () const
290 return roleDesignOwner;
293 //=======================================================================
294 //function : RoleDesignSupplier
296 //=======================================================================
298 Handle(StepBasic_PersonAndOrganizationRole) STEPConstruct_AP203Context::RoleDesignSupplier () const
300 return roleDesignSupplier;
303 //=======================================================================
304 //function : RoleClassificationOfficer
306 //=======================================================================
308 Handle(StepBasic_PersonAndOrganizationRole) STEPConstruct_AP203Context::RoleClassificationOfficer () const
310 return roleClassificationOfficer;
313 //=======================================================================
314 //function : RoleCreationDate
316 //=======================================================================
318 Handle(StepBasic_DateTimeRole) STEPConstruct_AP203Context::RoleCreationDate () const
320 return roleCreationDate;
323 //=======================================================================
324 //function : RoleClassificationDate
326 //=======================================================================
328 Handle(StepBasic_DateTimeRole) STEPConstruct_AP203Context::RoleClassificationDate () const
330 return roleClassificationDate;
333 //=======================================================================
334 //function : RoleApprover
336 //=======================================================================
338 Handle(StepBasic_ApprovalRole) STEPConstruct_AP203Context::RoleApprover () const
343 //=======================================================================
346 //=======================================================================
348 void STEPConstruct_AP203Context::Init (const Handle(StepShape_ShapeDefinitionRepresentation) &sdr)
351 STEPConstruct_Part SDRTool;
352 SDRTool.ReadSDR ( sdr );
353 InitPart ( SDRTool );
356 //=======================================================================
359 //=======================================================================
361 void STEPConstruct_AP203Context::Init (const STEPConstruct_Part &SDRTool)
364 InitPart ( SDRTool );
367 //=======================================================================
370 //=======================================================================
372 //void STEPConstruct_AP203Context::Init (const STEPConstruct_Part &SDRTool, const Handle(Interface_Model) &Model) {}
374 //=======================================================================
377 //=======================================================================
379 void STEPConstruct_AP203Context::Init (const Handle(StepRepr_NextAssemblyUsageOccurrence) &NAUO)
382 InitAssembly ( NAUO );
385 //=======================================================================
386 //function : GetCreator
388 //=======================================================================
390 Handle(StepAP203_CcDesignPersonAndOrganizationAssignment) STEPConstruct_AP203Context::GetCreator () const
395 //=======================================================================
396 //function : GetDesignOwner
398 //=======================================================================
400 Handle(StepAP203_CcDesignPersonAndOrganizationAssignment) STEPConstruct_AP203Context::GetDesignOwner () const
402 return myDesignOwner;
405 //=======================================================================
406 //function : GetDesignSupplier
408 //=======================================================================
410 Handle(StepAP203_CcDesignPersonAndOrganizationAssignment) STEPConstruct_AP203Context::GetDesignSupplier () const
412 return myDesignSupplier;
415 //=======================================================================
416 //function : GetClassificationOfficer
418 //=======================================================================
420 Handle(StepAP203_CcDesignPersonAndOrganizationAssignment) STEPConstruct_AP203Context::GetClassificationOfficer () const
422 return myClassificationOfficer;
425 //=======================================================================
426 //function : GetSecurity
428 //=======================================================================
430 Handle(StepAP203_CcDesignSecurityClassification) STEPConstruct_AP203Context::GetSecurity () const
435 //=======================================================================
436 //function : GetCreationDate
438 //=======================================================================
440 Handle(StepAP203_CcDesignDateAndTimeAssignment) STEPConstruct_AP203Context::GetCreationDate () const
442 return myCreationDate;
445 //=======================================================================
446 //function : GetClassificationDate
448 //=======================================================================
450 Handle(StepAP203_CcDesignDateAndTimeAssignment) STEPConstruct_AP203Context::GetClassificationDate () const
452 return myClassificationDate;
455 //=======================================================================
456 //function : GetApproval
458 //=======================================================================
460 Handle(StepAP203_CcDesignApproval) STEPConstruct_AP203Context::GetApproval () const
465 //=======================================================================
466 //function : GetApprover
468 //=======================================================================
470 Handle(StepBasic_ApprovalPersonOrganization) STEPConstruct_AP203Context::GetApprover () const
475 //=======================================================================
476 //function : GetApprovalDateTime
478 //=======================================================================
480 Handle(StepBasic_ApprovalDateTime) STEPConstruct_AP203Context::GetApprovalDateTime () const
482 return myApprovalDateTime;
485 //=======================================================================
486 //function : GetProductCategoryRelationship
488 //=======================================================================
490 Handle(StepBasic_ProductCategoryRelationship) STEPConstruct_AP203Context::GetProductCategoryRelationship () const
492 return myProductCategoryRelationship;
495 //=======================================================================
498 //=======================================================================
500 void STEPConstruct_AP203Context::Clear ()
503 myDesignOwner.Nullify();
504 myDesignSupplier.Nullify();
505 myClassificationOfficer.Nullify();
506 mySecurity.Nullify();
507 myCreationDate.Nullify();
508 myClassificationDate.Nullify();
509 myApproval.Nullify();
511 // myApprover.Nullify();
512 // myApprovalDateTime.Nullify();
514 myProductCategoryRelationship.Nullify();
517 //=======================================================================
518 //function : InitRoles
520 //=======================================================================
522 void STEPConstruct_AP203Context::InitRoles ()
524 roleCreator = new StepBasic_PersonAndOrganizationRole;
525 roleDesignOwner = new StepBasic_PersonAndOrganizationRole;
526 roleDesignSupplier = new StepBasic_PersonAndOrganizationRole;
527 roleClassificationOfficer = new StepBasic_PersonAndOrganizationRole;
528 roleCreationDate = new StepBasic_DateTimeRole;
529 roleClassificationDate = new StepBasic_DateTimeRole;
530 roleApprover = new StepBasic_ApprovalRole;
532 roleCreator->Init ( new TCollection_HAsciiString ( "creator" ) );
533 roleDesignOwner->Init ( new TCollection_HAsciiString ( "design_owner" ) );
534 roleDesignSupplier->Init ( new TCollection_HAsciiString ( "design_supplier" ) );
535 roleClassificationOfficer->Init ( new TCollection_HAsciiString ( "classification_officer" ) );
536 roleCreationDate->Init ( new TCollection_HAsciiString ( "creation_date" ) );
537 roleClassificationDate->Init ( new TCollection_HAsciiString ( "classification_date" ) );
538 roleApprover->Init ( new TCollection_HAsciiString ( "approver" ) );
541 //=======================================================================
542 //function : InitPart
544 //=======================================================================
546 void STEPConstruct_AP203Context::InitPart (const STEPConstruct_Part &SDRTool)
548 if ( myCreator.IsNull() ) {
549 myCreator = new StepAP203_CcDesignPersonAndOrganizationAssignment;
550 Handle(StepAP203_HArray1OfPersonOrganizationItem) items =
551 new StepAP203_HArray1OfPersonOrganizationItem (1, 2);
552 items->ChangeValue(1).SetValue ( SDRTool.PDF() );
553 items->ChangeValue(2).SetValue ( SDRTool.PD() );
554 myCreator->Init ( DefaultPersonAndOrganization(), RoleCreator(), items );
557 if ( myDesignOwner.IsNull() ) {
558 myDesignOwner = new StepAP203_CcDesignPersonAndOrganizationAssignment;
559 Handle(StepAP203_HArray1OfPersonOrganizationItem) items =
560 new StepAP203_HArray1OfPersonOrganizationItem (1, 1);
561 items->ChangeValue(1).SetValue ( SDRTool.Product() );
562 myDesignOwner->Init ( DefaultPersonAndOrganization(), RoleDesignOwner(), items );
565 if ( myDesignSupplier.IsNull() ) {
566 myDesignSupplier = new StepAP203_CcDesignPersonAndOrganizationAssignment;
567 Handle(StepAP203_HArray1OfPersonOrganizationItem) items =
568 new StepAP203_HArray1OfPersonOrganizationItem (1, 1);
569 items->ChangeValue(1).SetValue ( SDRTool.PDF() );
570 myDesignSupplier->Init ( DefaultPersonAndOrganization(), RoleDesignSupplier(), items );
573 if ( myCreationDate.IsNull() ) {
574 myCreationDate = new StepAP203_CcDesignDateAndTimeAssignment;
575 Handle(StepAP203_HArray1OfDateTimeItem) items =
576 new StepAP203_HArray1OfDateTimeItem (1, 1);
577 items->ChangeValue(1).SetValue ( SDRTool.PD() );
578 myCreationDate->Init ( DefaultDateAndTime(), RoleCreationDate(), items );
581 if ( mySecurity.IsNull() ) {
583 Handle(TCollection_HAsciiString) aName = new TCollection_HAsciiString ( "" );
584 Handle(TCollection_HAsciiString) aPurpose = new TCollection_HAsciiString ( "" );
585 Handle(StepBasic_SecurityClassification) sc = new StepBasic_SecurityClassification;
586 sc->Init ( aName, aPurpose, DefaultSecurityClassificationLevel() );
588 mySecurity = new StepAP203_CcDesignSecurityClassification;
589 Handle(StepAP203_HArray1OfClassifiedItem) items =
590 new StepAP203_HArray1OfClassifiedItem (1, 1);
591 items->ChangeValue(1).SetValue ( SDRTool.PDF() );
592 mySecurity->Init ( sc, items );
594 InitSecurityRequisites();
596 if ( myApproval.IsNull() ) {
597 myApproval = new StepAP203_CcDesignApproval;
598 Handle(StepAP203_HArray1OfApprovedItem) items =
599 new StepAP203_HArray1OfApprovedItem (1, 3);
600 items->ChangeValue(1).SetValue ( SDRTool.PDF() );
601 items->ChangeValue(2).SetValue ( SDRTool.PD() );
602 items->ChangeValue(3).SetValue ( mySecurity->AssignedSecurityClassification() );
603 myApproval->Init ( DefaultApproval(), items );
605 InitApprovalRequisites();
607 if ( myProductCategoryRelationship.IsNull() ) {
608 Handle(StepBasic_ProductCategory) PC = new StepBasic_ProductCategory;
609 Handle(TCollection_HAsciiString) PCName = new TCollection_HAsciiString ( "part" );
610 PC->Init ( PCName, Standard_False, 0 );
612 myProductCategoryRelationship = new StepBasic_ProductCategoryRelationship;
613 Handle(TCollection_HAsciiString) PCRName = new TCollection_HAsciiString ( "" );
614 Handle(TCollection_HAsciiString) PCRDescr = new TCollection_HAsciiString ( "" );
615 myProductCategoryRelationship->Init ( PCRName, Standard_True, PCRDescr, PC, SDRTool.PRPC() );
619 //=======================================================================
620 //function : InitAssembly
622 //=======================================================================
624 void STEPConstruct_AP203Context::InitAssembly (const Handle(StepRepr_NextAssemblyUsageOccurrence) &NAUO)
626 if ( mySecurity.IsNull() ) {
628 Handle(TCollection_HAsciiString) aName = new TCollection_HAsciiString ( "" );
629 Handle(TCollection_HAsciiString) aPurpose = new TCollection_HAsciiString ( "" );
630 Handle(StepBasic_SecurityClassification) sc = new StepBasic_SecurityClassification;
631 sc->Init ( aName, aPurpose, DefaultSecurityClassificationLevel() );
633 mySecurity = new StepAP203_CcDesignSecurityClassification;
634 Handle(StepAP203_HArray1OfClassifiedItem) items =
635 new StepAP203_HArray1OfClassifiedItem (1, 1);
636 items->ChangeValue(1).SetValue ( NAUO );
637 mySecurity->Init ( sc, items );
639 InitSecurityRequisites();
641 if ( myApproval.IsNull() ) {
642 myApproval = new StepAP203_CcDesignApproval;
643 Handle(StepAP203_HArray1OfApprovedItem) items =
644 new StepAP203_HArray1OfApprovedItem (1, 1);
645 items->ChangeValue(1).SetValue ( mySecurity->AssignedSecurityClassification() );
646 myApproval->Init ( DefaultApproval(), items );
648 InitApprovalRequisites();
651 //=======================================================================
652 //function : InitSecurityRequisites
654 //=======================================================================
656 void STEPConstruct_AP203Context::InitSecurityRequisites ()
658 if ( myClassificationOfficer.IsNull() ||
659 myClassificationOfficer->Items()->Value(1).Value() != mySecurity->AssignedSecurityClassification() ) {
660 myClassificationOfficer = new StepAP203_CcDesignPersonAndOrganizationAssignment;
661 Handle(StepAP203_HArray1OfPersonOrganizationItem) items =
662 new StepAP203_HArray1OfPersonOrganizationItem (1, 1);
663 items->ChangeValue(1).SetValue ( mySecurity->AssignedSecurityClassification() );
664 myClassificationOfficer->Init ( DefaultPersonAndOrganization(), RoleClassificationOfficer(), items );
667 if ( myClassificationDate.IsNull() ||
668 myClassificationDate->Items()->Value(1).Value() != mySecurity->AssignedSecurityClassification() ) {
669 myClassificationDate = new StepAP203_CcDesignDateAndTimeAssignment;
670 Handle(StepAP203_HArray1OfDateTimeItem) items =
671 new StepAP203_HArray1OfDateTimeItem (1, 1);
672 items->ChangeValue(1).SetValue ( mySecurity->AssignedSecurityClassification() );
673 myClassificationDate->Init ( DefaultDateAndTime(), RoleClassificationDate(), items );
677 //=======================================================================
678 //function : InitApprovalRequisites
680 //=======================================================================
682 void STEPConstruct_AP203Context::InitApprovalRequisites ()
684 if ( myApprover.IsNull() ||
685 myApprover->AuthorizedApproval() != myApproval->AssignedApproval() ) {
686 myApprover = new StepBasic_ApprovalPersonOrganization;
687 StepBasic_PersonOrganizationSelect po;
688 po.SetValue ( DefaultPersonAndOrganization() );
689 myApprover->Init ( po, myApproval->AssignedApproval(), RoleApprover() );
692 if ( myApprovalDateTime.IsNull() ||
693 myApprovalDateTime->DatedApproval() != myApproval->AssignedApproval() ) {
694 myApprovalDateTime = new StepBasic_ApprovalDateTime;
695 StepBasic_DateTimeSelect dt;
696 dt.SetValue ( DefaultDateAndTime() );
697 myApprovalDateTime->Init ( dt, myApproval->AssignedApproval() );