Teamcenter C++ API Reference  2312
Classes | Namespaces | Typedefs | Functions
SolutionVariant.hxx File Reference
#include <unidefs.h>
#include <map>
#include <vector>
#include <set>
#include <base_utils/DateTime.hxx>
#include <metaframework/BusinessObjectRef.hxx>
#include <metaframework/BusinessObject.hxx>
#include <Smc0psmcfgsupport/libsmc0psmcfgsupport_exports.h>
#include <Smc0psmcfgsupport/libsmc0psmcfgsupport_undef.h>

Go to the source code of this file.

Classes

struct  Teamcenter::PSM::SolutionVariant::CreateSVInputProp
 
struct  Teamcenter::PSM::SolutionVariant::MultilevelSolVarCreateInfo
 
struct  Teamcenter::PSM::SolutionVariant::MultilevelSolVarCreateOutput
 
struct  Teamcenter::PSM::SolutionVariant::MultilevelSolVarCreateResponse
 
struct  Teamcenter::PSM::SolutionVariant::SolVarCreateInfo
 

Namespaces

namespace  Teamcenter
 A convenient C++ class to manage a list of tag_t. This convenient class is derived from TagList class which is only available for internal developers.
 
namespace  Teamcenter::PSM
 
namespace  Teamcenter::PSM::SolutionVariant
 

Typedefs

typedef std::map< std::string,
bool > 
Teamcenter::PSM::SolutionVariant::BoolMap
 
typedef std::map< std::string,
std::vector< bool > > 
Teamcenter::PSM::SolutionVariant::BoolVectorMap
 
typedef std::map< std::string,
Teamcenter::DateTime
Teamcenter::PSM::SolutionVariant::DateMap
 
typedef std::map< std::string,
std::vector
< Teamcenter::DateTime > > 
Teamcenter::PSM::SolutionVariant::DateVectorMap
 
typedef std::map< std::string,
double > 
Teamcenter::PSM::SolutionVariant::DoubleMap
 
typedef std::map< std::string,
std::vector< double > > 
Teamcenter::PSM::SolutionVariant::DoubleVectorMap
 
typedef std::map< tag_t, tag_t > Teamcenter::PSM::SolutionVariant::ExpandedBOMLine
 
typedef std::map< std::string,
float > 
Teamcenter::PSM::SolutionVariant::FloatMap
 
typedef std::map< std::string,
std::vector< float > > 
Teamcenter::PSM::SolutionVariant::FloatVectorMap
 
typedef std::map< std::string,
int > 
Teamcenter::PSM::SolutionVariant::IntMap
 
typedef std::map< std::string,
std::vector< int > > 
Teamcenter::PSM::SolutionVariant::IntVectorMap
 
typedef std::map< std::string,
std::string > 
Teamcenter::PSM::SolutionVariant::StringMap
 
typedef std::map< std::string,
std::vector< std::string > > 
Teamcenter::PSM::SolutionVariant::StringVectorMap
 
typedef std::map< std::string,
BusinessObjectRef
< Teamcenter::BusinessObject > > 
Teamcenter::PSM::SolutionVariant::svTagMap
 
typedef std::map< std::string,
std::vector< BusinessObjectRef
< Teamcenter::BusinessObject > > > 
Teamcenter::PSM::SolutionVariant::TagVectorMap
 

Functions

int SMC0_solution_variants_creation (std::vector< Teamcenter::PSM::SolutionVariant::MultilevelSolVarCreateInfo > &multilevelSolVarCreateInfoList, const tag_t savedVariantRule, const std::map< std::string, int > &preferencesMap, const tag_t revRule, bool multilevel, const std::map< std::string, std::string > &gvToSVType, Teamcenter::PSM::SolutionVariant::MultilevelSolVarCreateResponse &multilevelSolVarCreateResponse)
 

Function Documentation

int SMC0_solution_variants_creation ( std::vector< Teamcenter::PSM::SolutionVariant::MultilevelSolVarCreateInfo > &  multilevelSolVarCreateInfoList,
const tag_t  savedVariantRule,
const std::map< std::string, int > &  preferencesMap,
const tag_t  revRule,
bool  multilevel,
const std::map< std::string, std::string > &  gvToSVType,
Teamcenter::PSM::SolutionVariant::MultilevelSolVarCreateResponse multilevelSolVarCreateResponse 
)

Creates solution variant based on the inputs.
More details are given against each parameter of the function SMC0_solution_variants_creation.

Returns
  • #ITK_ok on success.
  • #TYPE_unknown_type if the input gvToSVType has the mapped Solution Variant BO type to be "UnknownType" for e.g. ("Item", "UnknownType").
  • #SMC0PSMCFGSUPPORT_blocked_single_level_reuse_sv_creation if the ITK is asked to create single level SV with solution category as "Reuse".
  • #SMC0PSMCFGSUPPORT_invalid_variant_rule_error if pcaVariantRule is NULLTAG.
  • #SMC0PSMCFGSUPPORT_invalid_or_incomplete_variant_rule if pcaVariantRule is invalid or incomplete.
  • #SMC0PSMCFGSUPPORT_non_applicable_variant_rule if pcaVariantRule is not applicable with Configurator Context.
  • #BOM_internal_error if due to some reason the SV creation is rolled back.

Here is how to construct the input for the ITK

for example, the below code snippet is for all levels.
BOM_create_window(&bomWindow);
tag_t topLine = NULLTAG;
BOM_set_window_top_line(bomWindow, NULLTAG, itemRev, NULLTAG, &topLine);
CreateSVInputProp prop(type); // type is mapped SV BO Type
for example, if gvToSVType is ("Item", "Design"), SV BO Type is "Design".
SolVarCreateInfo solVarCreInfo(prop,
topLine, // bomline input
svCategory, // can be one of the solution variant categories
NULLTAG //solution var item revision - will be created internally.);
MultilevelSolVarCreateInfo multilevelSolVarCreateInfo( solVarCreInfo, // solVarCreInfo, see above
NULLTAG, // m_mappedSVBomLine, for multilevel true this is generated internally
level); // corresponding bomline level.
std::vector< MultilevelSolVarCreateInfo > multilevelSolVarCreateInfoList;
multilevelSolVarCreateInfoList.push_back(multilevelSolVarCreateInfo);
std::map< std::string, int > preferencesMap;
preferencesMap.insert(std::pair<std::string, int>("DryRun", 0));
std::map < std::string, std::string > gvToSVType;
// call ITK
SMC0_solution_variants_creation(multilevelSolVarCreateInfoList,
m_svrRuleTag//saved variant rule tag ,
preferencesMap,
NULLTAG //revRule,
true//multilevel,
gvToSVType,
multilevelSolVarCreateResponse);
// Since solution variant bomlines are returned via output response. The caller should ensure that corresponding BOM window
// are closed after processing bom lines. The caller should also ensure that window corresponding to Generic bomline is also
// closed.
// if multilevel is false, and if the caller wants to do level by level processing for creating solution variants
// then the caller should make output of the previous level as the input of the next level.
// for example m_expandedBOMLines contains the map of generic bomline to SV bomline
// the caller should populate MultilevelSolVarCreateInfo from m_expandedBOMLines of the previous level and call SMC0_solution_variants_creation ITK again
// for example,
// SolVarCreateInfo solVarCreInfo(prop,
m_expandedBOMLines->first, // bomline input
svCategory, // can be one of the solution variant categories
NULLTAG //solution var item revision - will be created internally.);
// MultilevelSolVarCreateInfo multilevelSolVarCreateInfo( solVarCreInfo, // solVarCreInfo, see above
m_expandedBOMLines->second, // m_mappedSVBomLine
level); // corresponding bomline level.
// std::vector< MultilevelSolVarCreateInfo > multilevelSolVarCreateInfoList;
// multilevelSolVarCreateInfoList.push_back(multilevelSolVarCreateInfo);
// for the rest, please see How to construct the input for the ITK

(O) Response corresponding to the created Solution Variants.

Parameters
multilevelSolVarCreateInfoList(I) Input details of Solution Variant to be created
savedVariantRule(I) Saved Variant Rule
preferencesMap(I) The following preferences are used.
DryRun, allLevel, RollbackOnError, StopOnError
Usage: preferencesMap["DryRun"] = 1
Usage: preferencesMap["RollbackOnError"] = 1
"RollbackOnError" rolls back to the original state on error.
Usage: preferencesMap["StopOnError"] = 1
"StopOnError" stops further processing on error and returns appropriate error code.
Usage: preferencesMap["allLevel"] = 0
if multilevel is true and preferencesMap["allLevel"] = 0, the solution variant is created till first level.
revRule(I) Input Revision Rule tag
multilevel(I) multilevel (true or false)
If multilevel is true, solution variants are created for all levels.
If multilevel is false, solution variants are created for single level.
if multilevel is true and preferencesMap["allLevel"] = 0, solution variants are created till first level.
gvToSVType(I) Represents the mapping of BO type of generic and solution variant BOMLine for e.g. gvToSVType.insert( pair< std::string, std::string>( "Item", "Design" ) )
"Item" is Generic Variant BO type and "Design" is solution variant BO type.