Teamcenter C++ API Reference  2312
VerificationRequestServices.hxx
Go to the documentation of this file.
1 //Copyright 2022 Siemens Digital Industries Software
2 //==================================================
3 //Copyright $2020.
4 //Siemens Product Lifecycle Management Software Inc.
5 //All Rights Reserved.
6 //==================================================
7 //Copyright 2022 Siemens Digital Industries Software
8 
16 #ifndef TEAMCENTER_CRT0_VERIFICATION_REQUEST_MANAGEMENT_HXX
17 #define TEAMCENTER_CRT0_VERIFICATION_REQUEST_MANAGEMENT_HXX
18 
19 #include <string>
20 #include <vector>
21 #include <map>
22 
23 #include <unidefs.h>
24 #include <pom/pom/pom.h>
25 
26 #include <Crt0ValidationContract/libcrt0validationcontract_exports.h>
27 
28 namespace Teamcenter
29 {
30  class CRT0VALIDATIONCONTRACT_API VerificationRequestServices
31  {
32  public:
37  {
38  tag_t parameter; /* Parameter object to be added to Verification Request as Input or Output. */
39 
40  std::string direction; /* The direction to be set for Parameter. Valid values are: “Input”, “Output” */
41 
46  {
47  parameter = NULLTAG;
48  direction = "";
49  }
50  };
51 
55  struct RecipeDataS
56  {
57  std::string recipeName; /* Name of the Fnd0Recipe object to be executed for the given content. */
58 
59  std::string recipeUid; /* The Fnd0Recipe object UID to be executed for the given content. */
60 
61  std::vector<tag_t> bomWindows; /* A list of BOMWindow objects to which qualified business objects are resolved. */
62 
66  RecipeDataS() : recipeName(""), recipeUid("")
67  {}
68  };
69 
74  {
75  tag_t objectTobeAdded; /* Object (BOMLine or Workspace) to be added */
76 
77  std::string childPathObjectTobeAdded; /* PS Occurrence Thread child path of object to be added */
78 
79  tag_t objectTobeAddedCtx; /* The context (BOMLine) of object to added */
80 
81  std::string childPathCtx; /* PS Occurrence Thread child path of context */
82 
83  std::map<std::string, std::vector<std::string> > additionalProps; /* Additional properties for objectToBeAdded */
84 
85  std::vector<ParameterInfoS> parameters; /* List of parameter and its direction to be set */
86 
87  RecipeDataS recipeData; /* The recipe to be executed on given content */
88 
93  {
94  objectTobeAdded = NULLTAG;
95  childPathObjectTobeAdded = "";
96  objectTobeAddedCtx = NULLTAG;
97  childPathCtx = "";
98  }
99  };
100 
105  {
106  tag_t user; /* The User object to be added as Participant to Verification Request */
107 
108  std::string role; /* Role of user as participant to be added to Verification Request.
109  Valid values for role are “Systems Designer” and “Simulation Engineer”. */
110 
115  {
116  user = NULLTAG;
117  role = "";
118  }
119  };
120 
125  {
126  std::string worflowTemplateToInitiate; /* Workflow template to initiate */
127 
128  std::string name; /* Name of created process */
129 
130  std::string description; /* description of created process */
131 
136  {}
137  };
138 
143  {
144  std::string clientId; /* Unique client id */
145 
146  std::string verificationRequestName; /* Verification Request object name */
147 
148  std::string verificationRequestType; /* Verification Request type */
149 
150  tag_t verificationRequestDefinition; /* Crt0VCDefnRevision object */
151 
152  tag_t reviseVerificationRequestRevision; /* Existing Crt0VldnContractRevision Verification Request Object. */
153 
154  std::vector<AddObjectInputS> verificationRequestContent; /* A list of AddObjectInputInfo structure. Represents, contents to be added */
155 
156  std::map<std::string, std::vector<std::string> > verificationRequestProps; /* Additional properties to set on Verification Request object */
157 
158  std::string createParamterCopyOptions; /* To set given parameter directly or create copy */
159 
160  RecipeDataS recipeData; /* The recipe to be executed on given content */
161 
162  std::vector<ParticipantInfoS> participants; /* List of Participant details to be set*/
163 
164  std::string workflowNameToInitiate; /* Workflow to initiate */
165 
166  bool populateFromParent; /* Flag to populate content from parent */
167 
168  tag_t parentVerificationRequest; /* Parent Verification Request */
169 
173  CreateVRInputDataS() :clientId(""), verificationRequestName(""), verificationRequestType(""), verificationRequestDefinition(NULLTAG),
174  reviseVerificationRequestRevision(NULLTAG), createParamterCopyOptions(""), workflowNameToInitiate(""),
175  populateFromParent(false), parentVerificationRequest(NULLTAG)
176 
177  {}
178  };
179 
184  {
185  tag_t parameter; /* Parameter object associated with Verification Request. */
186 
187  std::string direction; /* Direction of parameter. “Input” or “Output”. */
188 
193  {}
194  };
195 
200  {
201  tag_t owningObj; /* Element */
202  tag_t owningVldnLinkObj; /* Validation Link*/
203  tag_t parameter; /* parameter */
204  std::string direction; /* parameter directions. */
205 
210  {}
211  };
212 
217  {
218  tag_t attributeElement; /* Attribute Element */
219  tag_t owningObj; /* Owning Object */
220  tag_t owningVldnLinkObj; /* Validation Link */
221  tag_t source_parameter; /* List of parameter directions. */
222  tag_t target_parameter; /* List of parameter directions. */
223  std::string direction; /* List of parameter directions. */
224 
229  {
230  attributeElement = NULLTAG;
231  owningObj = NULLTAG;
232  owningVldnLinkObj = NULLTAG;
233  source_parameter = NULLTAG;
234  target_parameter = NULLTAG;
235  direction = "";
236  }
237  };
238 
243  {
244  tag_t addedObject; /* Element of Verification Request */
245 
246  tag_t addedObjectVldnLink; /* Element Validation Link */
247 
248  std::vector<AddParameterOutputS> parameters; /* Parameters of Verification Request */
249 
250  // Add any additional data required data of element
251 
256  {
257  addedObject = NULLTAG;
258  addedObjectVldnLink = NULLTAG;
259  }
260  };
261 
266  {
267  std::string clientId; /* Unique client id */
268 
269  tag_t verificationRequest; /* Created Verification Request object */
270 
271  std::vector<AddObjectOutputS> verificationRequestAddObjectData; /* added obejcts and parameters details of Verification Request */
272 
277  {
278  clientId = "";
279  verificationRequest = NULLTAG;
280  }
281  };
282 
287  {
288  tag_t addedParticipant = NULLTAG;
289 
290  tag_t participantType = NULLTAG;
291 
292  // Add any other output data, if required.
293 
298  {}
299  };
300 
310  static int createVerificationRequest(
311  const std::vector<CreateVRInputDataS>& input,
312  std::vector<CreateVRDataS>& output
313  );
314 
324  static int addObjectsAndParametersToVerificationRequest(
325  const tag_t verificationRequest,
326  const RecipeDataS& recipeData,
327  const std::vector<AddObjectInputS>& addObjectInputs,
328  const std::string& createParamterCopyOptions,
329  std::vector<AddObjectOutputS>& addObjectOutputDatas
330  );
331 
341  static int addParticipantToVerficationRequest(
342  const std::map < tag_t, std::vector<ParticipantInfoS> >& vrToPartcipantInfoMap,
343  std::map < tag_t, std::vector<tag_t> >& outVrToParticipants
344  );
345 
355  static int initiateWorflowToVerficationRequest(
356  const std::map < tag_t, InitiateWorkflowInfoS >& vrToWorkSSflowInfoMap,
357  std::map < tag_t, tag_t >& outVrToCreatedProcessMap
358  );
359 
360  static int getAbsOccDatasBasedOnQualiferAndAbsOcc(const std::vector<tag_t> &listOfQualifier,
361  const std::vector<tag_t> &listOfAbsOcc,
362  std::vector<tag_t> &listOfQualiferOut,
363  std::vector<tag_t> &listOfAbsOccOut,
364  std::vector<tag_t> &listOfAbsOccDataOut);
365  };
366 }
367 
368 #ifdef __cplusplus
369 extern "C" {
370 #endif
371 
378  extern CRT0VALIDATIONCONTRACT_API int CRT0_createValidationLinks(
379  tag_t verificationRequestTag,
380  const std::vector<tag_t>& wsoObjects,
381  const std::map<tag_t, tag_t> &elementToContextMap,
382  std::map< tag_t, tag_t >& assignedElementToValidationLinkMap
383  );
384 
385 
394  extern CRT0VALIDATIONCONTRACT_API int CRT0_deleteMappingPreAction(
395  const tag_t attributeAlignmentTag,
396  const tag_t contextObjTag
397  );
398 
407  extern CRT0VALIDATIONCONTRACT_API int CRT0_IsObjectiveModifiable(
408  tag_t affectedObj,
409  bool& isApplicable,
410  int& errorCode,
411  std::string& errorMessage
412  );
413 
414 #ifdef __cplusplus
415 }
416 #endif
417 
418 #include <Crt0ValidationContract/libcrt0validationcontract_undef.h>
419 #endif