Wednesday 15 February 2017

Frequent Questions

  • OOTB  Rule handler : (create-status,add-status,set-status,CR-check-item-status,CR-assert-targets-checked-in,disallow-adding-targets,disallow-removing-targets,EPM-attach-related-objects,require-authentication,demote-on-reject)

  • Utility to delete the Workflow created job(Workflow job got hung/corrupted then utility to delete this object) : verify_tasks

  • Export Preference utility:preferences_manager
  • Utility to creates new users, groups, persons, roles, and volumes outside of a Teamcenter session: make_user
  • Utility to export saved queries:import_export_reports
  • Handler to invoke some utility from workflow : invoke-system-action     -system=script 
  • Executes a specific action on a specific task in the workflow process from which the related background process was initiated : invoke-system-action    -system=script 
  • Email send from workflow on completion(Handler to use is):   system     
     eg: system mailx -s "Notification: Task has been approved"    smith /tmp/approval_note.txt
  • clearlocks : Utility to clear the locks in case of dead process
  • Interdependent LOV : You can create an interdependent attachment so that the user is prompted to enter values for each level in a cascading LOV
  • TC_project_validate_conditions:Determines how the ASSIGN_TO_PROJECT and REMOVE_FROM_PROJECT Access Manager privileges are validated in conjunction with privileged membership validation.Make it 0 to assign project to object in Teamcenter  
  • Multiple concurrent user session to rich client: To start multiple rich client you need to change activation_mode="NORMAL"  to activation_mode="PER_CLIENT" in the tcserver.xml file. File will be available at location TC_ROOT/iiopservers/. 



Thursday 9 February 2017

Teamcenter SOA Service : Expand BOM

Problem Statement : Given top bom line, you need to expand and store all of it's child line in HashMap.

Answer is ...Checkout the below code


Load property by default when object loaded.Get the item_id against which we store the bom line
SessionService sessionService = SessionService.getService( connection );

//Set Property Policy to get the required property as default

ObjectPropertyPolicy objectpropertypolicy = new ObjectPropertyPolicy();
PolicyType policytype = new PolicyType( "BOMLine", new String []    { "bl_item_item_id" } );
objectpropertypolicy.addType(policytype );

sessionService.setObjectPropertyPolicy(objectpropertypolicy);


Expand the topline and get all child lines
StructureManagementService structureManagementService = StructureManagementService.getService(connection);

com.teamcenter.services.strong.cad._2008_06.StructureManagement.ExpandPSAllLevelsInfo info = new com.teamcenter.services.strong.cad._2008_06.StructureManagement.ExpandPSAllLevelsInfo();


info.parentBomLines = new BOMLine[]{ (BOMLine) topline };
info.excludeFilter = "None2";

com.teamcenter.services.strong.cad._2008_06.StructureManagement.ExpandPSAllLevelsPref pref = new com.teamcenter.services.strong.cad._2008_06.StructureManagement.ExpandPSAllLevelsPref();

ExpandPSAllLevelsResponse2 expandPSAllLevelsResponse = structureManagementService.expandPSAllLevels(info, pref);

for (int i = 0; i < expandPSAllLevelsResponse.output.length; i++) 
{

  try 
  {

 BOMLine childline = expandPSAllLevelsResponse.output[i].parent.bomLine;
           hmstructureLine.put( childline.get_bl_item_item_id(), childline );
   
   catch (NotLoadedException e) 
   {
 StringBuilder sErrorMessage = new StringBuilder();

   sErrorMessage.append( "Exception occurred while fetching the item id for loaded structure. " );

throw new Exception( sErrorMessage.toString() );
   }

}

Important thing above is info.excludeFilter = "None2";
if you see help document it has mention about using 'None' but it won't work (Error : Invalid enum value)

If you  check service reference guide it has mentioned 'None2' value for BOMLineFilter2