Sie sind auf Seite 1von 49

collaboration

Pro/INTRALINK
Toolkit SIG
innovation Training

Andrey Knourenko
global solutions Manager R&D
Pro/USER 00
© 2000 PTC
Agenda
Introduction to Pro/INTRALINK Toolkit (50min)
● Custom Applications
● Pro/INTRALINK APIs
● Pro/INTRALINK Objects
● Object Types
Break (15 min)
Advanced User Topics (50 min)
● Triggers
● Transactions
● Configuration Objects
● Clusters

© 2000 PTC
What Is the Pro/INTRALINK Toolkit?
● Development toolkit for Pro/INTRALINK
● Create custom applications that complement
Pro/INTRALINK
● C Programming Language
● Access to a library of Pro/INTRALINK C functions used by
the Pro/INTRALINK client
● Applications created with this tookit allow access to
Pro/INTRALINK information in a safe, controlled manner

© 2000 PTC
Agenda
Introduction to Pro/INTRALINK Toolkit (50min)
● Custom Applications
● License Requirements

● Types of Custom Applications

● Examples

● Pro/INTRALINK APIs
● Pro/INTRALINK Object
● Object Types

© 2000 PTC
Developing Custom Applications
To automate set of tasks required for Pro/INTRALINK users,
you will need:
● Purchase one Application Programming Module per site to
produce custom applications.
● After developed, applications that access the data server
will need a run-time license (which license depends upon
the type of application created).
● Run time licenses (not interchangeable):

● Pro/INTRALINK Client (Triggered)


● Pro/INTRALINK Toolkit Access License (Stand Alone)
● Both run-time licenses are:
● Floating
● Served from FlexLM server

© 2000 PTC
Types of Custom Applications
Stand Alone
● Access Workspace
● Uses:

● Modify versioned system and user-defined object attributes


inside of a workspace
● Create new objects in the workspace

● Can be run before/after Pro/E save with a mixed toolkit

application
● No run time license required (provided do not need to
connect to data server)
● Userguide Examples:

● Modifying Attributes
● Listing Workspace(next slide)

● Modifying Library Objects

● Mixed TK application

● Creating new objects, etc.

© 2000 PTC
Workspace Stand Alone Application -
Listing Contents of Workspace
/*==============================================================*\

FILE : TestListWS.c

PURPOSE : Lists the workspace objects.

\*=============================================================*/

#include <prointlnk.h>

#include <stdio.h>

#include <stdlib.h>

#include <string.h>

#include "UsGuidType.h"

#include "PDMTestError.h"

© 2000 PTC
Types of Custom Applications
Stand Alone Applications Con’t
● Access Commonspace Data Server
● Uses:

● Perform Queries
● Check Out Objects

● Check In Objects

● Modify Non-versioned system and user-defined attributes (e.g.

Rename, Promote, Demote, Modify Life Cycle Attributes)


● Requires the run-time license, Toolkit Access
● Userguide examples: Create a BOM (next slide), Finding an

object, Finding dependencies based on configuration, Check


Out any object, etc.
● Import/Export to/from Workspace
● Use new 3.0 APIs to exchange Pro/ENGINEER files with the

Workspace
● Requires the run-time license, Toolkit Access
© 2000 PTC
Standalone Data Server Application -
BOM Example
/*=============================================================*\

FILE : TestShowBom.c

PURPOSE : Creates a bill of materials (BOM).

\*=============================================================*/

#include <prointlnk.h>

#include <stdio.h>

#include <string.h>

#include <stdlib.h>

#include <UsGuidType.h>

#include <PDMTestError.h>

static PTCINTEGER BOMPartCount = 0;

static BOMPartInfo BOMParts[BOM_MAX_PARTS];

static BOMPartInfo* BOMPartList[BOM_MAX_PARTS];

/*-------------------------------------------------------------*\

Function declarations
© 2000 PTC
•Types of Custom Applications Con’t

Triggers
● Invoked automatically by the Pro/INTRALINK client based
upon an action in the client
● Timing may be Pre (before) or Post (after) the event
● Required Pre triggers abort the user invoked action if they fail
● May have more than one trigger for the same event and
timing. (Order executed is random)
● Cannot modify objects in CS from within a trigger
● Requires that the client session that invoked the trigger still
has a Client License
● Userguide examples: Trigger Administration, Trigger sample
for different events and timing.
● Consulting example of launching another application from a
© 2000 PTC
trigger (see next page).
Trigger Calling External App Example
● Exercise 14
Write a program to handle Post Promotion Trigger. Create the trigger manually in Pro/INTRALINK
Admin section. Register the trigger in the DLL. Upon the execution, collect the defined set of attribute
values for the object/objects. Write a text file indicating the object name and its attribute values.
Launch a separate application from the trigger. Read a configuration file and login to the Intralink
database. Upon checking the permissions for the user and the object, end the application.

/*==================================================================*\
Function : createNewTrigger()
Purpose : To create trigger for revision change and registering its
dll funtion definition library.
\*==================================================================*/
int createNewTrigger()
{
HPDMTRIGGER trigger = NULL_HPDMTRIGGER;
int err = 0;

err = PDMTriggerCreate("RevisionChange", PDM_ET_PIV_RLCHANGE,


PDM_TT_PRE, "", 1, 0, &trigger);

err = PDMTriggerSetDLLInfo(trigger, "releasechange",


"changeRevision", "");

return err;
}
/*==================================================================*\
Function : PDMDLLInit()
Purpose : To register the trigger.
\*==================================================================*/
© 2000 PTC
Agenda
Introduction to Pro/INTRALINK Toolkit (50min)
● Custom Applications
● Pro/INTRALINK APIs
● API Background

● API Naming Conventions

● Pro/INTRALINK Objects
● Object Types

© 2000 PTC
Pro/INTRALINK APIs
● Same APIs as used to create Pro/INTRALINK client
● C functions available through these libraries:
● proilcspace
● proilwspace
● proilbase
● proicommon
● Structured as object oriented functions
(i.e. functions based on the object, and a different function to do appropriate actions on the object)

● APIs are named with this format:


● PDM<object_type><action><what_acted_upon>
PDMPIVDelete or PDMPIVGetDependencies
● Action names are listed in Userguide on p1-6 thru 1-8

© 2000 PTC
● Object names (next slide)
Agenda
Introduction to Pro/INTRALINK Toolkit (50min)
● Custom Applications
● Pro/INTRALINK APIs
● Pro/INTRALINK Objects
● Commonspace Objects

● PI, PIV, Branch, etc.


● LO, LOV, GIR, etc.

● Pro/ADMIN Objects (FileSpace, UserGroup, etc.)

● Workspace Objects
● Object Types

© 2000 PTC
Pro/INTRALINK Objects
Objects Stored In Commonspace
● Attribute
● Branch (see next slide)
● Baseline
● Configuration (discussed later in 2nd half of the class)
● Folder
● GIR - Generic Instance Relationship (see LO slide)
● LO - Library Object (see slide after PI)
● LOV - Library Object Version (see slide after PI)
● OQL - Object Query
● PI - Product Item (see next slide)
● PIV - Product Item Version (see next slide)
● PromotionForm
● Release Level
● ReleaseScheme
● SubmissionForm
© 2000 PTC
PI Structure

PI (Product Item)
● Created on CheckIn ONLY
● Contains
● Name, TypeDef, Folder, AttrClass, Description, etc.

● Structure

Rev Rev Rev


C
A A main
V.5
V.1 V.2

Bolt.p
rt Rev Rev
Branch_on
e
AA V.1 BB V.1

© 2000 PTC
Structure of Family Table Objects
Pro/INTRALINK allows independent versioning of family
table objects. As a result, the Library Object was created
● The Family Table is the basic definition of the generic and all
instances for that Family Table. Likewise, the Library Object
in Pro/INTRALINK contains the PIVs for the generic and its
instances.
● For each Library Object, you can have many versions. Any
time you check in a new version of a member of that family
table (whether it is the generic or an instance) a new Library
Object Version (LOV) is created.
● The LOV is a bin that contains the specific PIVs created
when you check in an object with a family table (next slide)
● If you delete one of the PIVs of a family table, then ALL
LOVs that contain that PIV must be deleted.

© 2000 PTC
Library Object Structure

LO LOV LOV LOV LOV


1 2 3 4
PIV PIV PIV PIV
A1 A2 A2 A2
PIV PIV PIV PIV
B1 B1 B1 B2
PIV PIV PIV
C1 C1 D1
PIV
E1

© 2000 PTC
Pro/INTRALINK Objects con’t
Objects Associated with Pro/ADMIN
● AttrClass

● AttrDef

● Attribute

● FileSpaceReplica

● FileVault

● Folder

● LCO - Life Cycle Object

● LCOV - Life Cycle Object Version

● Role

● User

● UserGroup

© 2000 PTC
Library Objects (continued)
Getting LOVs from PIVs

List Of
PIVs
Cursor of LOV PL
clustors

Cluster Cluster
1 2
List of PIVs Containes the list
of PIVs for which
LOV 1 LOVs were found

LOV 2 May be the latest


LOV

© 2000 PTC
Library Objects (continued)
Obtaining Generic PIV from LOVs

List Of LOVs

Cursor of Generic PL
clusters

Cluster Cluster
1 2
List of PIVs Generic
PIV
Instances can have only one There should exist
generic. Generic can have only one generic
many instances. PIV

© 2000 PTC
Pro/INTRALINK Objects con’t
Objects Associated with Workspace:
● LDB - Local Data Base
● Workspace
● WSDependency
● WSGIR
The structure of these objects is the same as
● LIL those previously discussed.
● LILV Naming conventions are different because
user may perform different actions on these
● WSPI objects when they are in the Workspace.
● WSPIV

© 2000 PTC
Pro/INTRALINK Objects - AttrClass
Attribute Classes, AttrClass
● Attribute classes (AttrClass) are logical objects that contain the
definitions of attributes (AttrDef) .
● Can create a hierarchy of AttrClasses for PIs and PIVs
● Objects are associated with at least one AttrClass
● If the AttrClass is a sub-attribute class and you assign it to a PI
or PIV, then the object will also be assigned the AttrDefs of the
parent AttrClasses.
● Only attributes in the RootAttributeClass are visible in the
client.
● Tools
● Create - PDMAttrClassCreate

● Find Root for PI - PDMPIGetRootAttrClass

● To add/remove for a PI - PDMPIAddAttrClass,

PDMPIRemoveAttrClass

© 2000 PTC
Attribute Structure

PI - RootAttributeClass

AttrDef PI - AttrClass
“TeamMembs” “Motor”
Integer
Default Value = 4

AttrDef PI - AttrClass
“Designer” “ForEurope”
String
Default Value = tbd

AttrDef AttrDef AttrDef


“Country” “OnSchedule” “Cost”
String Boolean Real
Range: France Default Value = True
Italy
Germany
© 2000 PTC
Pro/INTRALINK Objects - AttrDef
Attribute Definitions, AttrDef
● Defines the definition of the attribute: Name, AttrClass, Type
and optionally Description and Default Value.
● Non-versioned or versioned.
Non-versioned attributes are associated with the PI and versioned
with the PIV
● FileBased (I.e. Pro/ENGINEER designated attributes)
Naming and value limitations of 32 lowercase characters + “_”
● Restrictions - EnumRestriction or RangeRestriction
Can set a list of discrete values or a range values
● Tips:
● Whether versioned or not determined by how you created the

AttrDef - PDMAttrDefCreate, PDMAttrDefCreateVersioned


● By default all versioned attributes for PIVs are file based

(designated in Pro/E). To change use PDMAttrDefSetFileBased.


© 2000 PTC
Pro/INTRALINK Objects - Attribute
● Attributes contain the actual value for the object they are
associated
● Non-versioned attributes may be modified in the CS.
● Versioned attributes must be modified in the WS.
● All functions associated with querying and setting
attributes follow this template:
● PDM<object>GetAtrribute

● PDM<object>SetAttribute

● Tip:
Setting Attribute functions return PTCERROR. If you receive
an error, check for value restrictions in the AttrDef.
PDM<object>GetAttribute returns a handle to the AttrDef.

© 2000 PTC
•Pro/INTRALINK Objects con’t

Objects for Information


◆Conflict
◆Error

© 2000 PTC
Agenda
Introduction to Pro/INTRALINK Toolkit (50min)
● Custom Applications
● Pro/INTRALINK APIs
● Pro/INTRALINK Object
● Object Types
● Handles

● Cursors

● Errors

© 2000 PTC
Object Types
● Mulitbyte Strings
● const char
● Used for any name used visible from the UI (name of PI, Workspace,
etc.)
● Type - PTCSTRING
● Integers
● Used when passing integers like the revision, version
● Type - PTCINTEGER
● Boolean
● Integer of 1 or 0
● Used often as a true/false return from an API
● Type - PTCBOOL
● Real Numbers
● double
● Used often to define values for attributes

© 2000 PTC
● Type - PTCREAL
Intralink Object Types
Handle
● Memory address
● Used to specify objects (e.g. PI, PIV)
● Tools
● PDM_HANDLE_IS_NULL

● PDM_HANDLE_SET_NULL

● PDM_HANDLE_CAST

● PDM_HANDLE_EQUAL

● Available types:
HPDMPI, HPDMPIV, HPDMBRANCH, HPDMLOV,
HPDMWORKSPACE, HPDMLDB, HPDMPDM,
HPDMWSPI, HPDMATTRDEF, HPDMOQL, etc.

© 2000 PTC
Object Types - Cursors
Cursor
● Memory Address
● Used when API returns a list of handles
● Temporary
● Tools
● Traverse - PDMCursorGetNext

● Delete from memory - PDMCursorDelete

● Type
HPDMCURSOR

© 2000 PTC
Object Types - Errors
Error
● Integer
● Type - PTCERROR
● Values
● PDM_SUCCESS (0)

● PDMERR_ILLEGAL_HANDLE

● PDMERR_SYSTEM_ERROR

● PDMERR_ATTRVALUE_WRONG_TYPE

● PDM_PASSWORD_INCORRECT

● Error Codes found in cerror.h or in Reference Guide

© 2000 PTC
Object Type - Errors Con’t
Error Stack
● Cursor of Error Handles
● Need a handle when the error returns more information
than just an error code. E.g. error code plus handles of
objects causing the error.
● Tools for ErrorStack
● PDMErrorGetStack

● PDMErrorGetDetails

● PDMErrorDumpStack

● PDMErrorClearStack

● Types
● HPDMERROR (handle)

● HPDMCURSOR

● See Userguide Example p5-4


© 2000 PTC
Error Sample Code
/*====================================================================*\

Function: ErrorHandle

Purpose: Handle errors.

\*====================================================================*/

static void ErrorHandle()

HPDMCURSOR errstack;

HPDMERROR errhandle;

PDM_ERROR_INFO errinfo;

PTCINTEGER i, ctr = 0;

FILE *fp;

/*--------------------------------------------------------------------*\

Get the error stack.

\*--------------------------------------------------------------------*/

PDMErrorGetStack (&errstack);

© 2000 PTC if (!PDM_HANDLE_IS_NULL (errstack))


Conflict Objects
Conflicts
● Occur During Fetch, Submit, Delete operations
● Check Conflicts before doing above operations
● Check if Overridable, Type and more Info
● Sample code

© 2000 PTC
Conflict Example Code

pivArray = (HPDMPIV*)calloc(sizeof(HPDMPIV), array_curr);


for(k=0;k<array_curr;k++)
pivArray[k] = piv_array[k].PIVHandle;

/*Fetch all the files to the workspace */


err = PDMWorkspaceCheckConflictsFetch(HPDMLDB, "expws",
array_curr, pivArray, 0, NULL, HDPMCHECKOUT*);

err= PDMCheckOutGetConflicts(HDPMCHECKOUT, HPDMCURSOR*);

if (!PDM_HANDLE_IS_NULL(HPDMCURSOR))
{
for ( status = PDMCursorGetNext(HPDMCURSOR,

HPDMCONFLICT*);!PDM_HANDLE_IS_NULL(HPDMCONFLICT);
status = PDMCursorGetNext(HPDMCURSOR,
HPDMCONFLICT*))
{
err = PDMConflictGetMsgByConf(HPDMCONFLICT,
PTCSTRING*);

err = PDMConflictIsOverridable(HPDMCONFLICT,
PTCBOOL*);

if(!PTCBOOL)
{
err = PDMConflictGetType(HPDMCONFLICT,
PTCINTEGER*);

© 2000 PTC
err = PDMCursorDelete(HPDMCURSOR);
•Intralink Object Types Con’t

Temporary Objects
◆HPDMCURSOR
◆HPDMCHECKIN

● PDMCheckInDelete
◆HPDMCHECKOUT
● PDMCheckOutDelete
◆HPDMDEPENCENCYGRAPH

● PDMPIVDepGraphDelete

© 2000 PTC
Agenda
Introduction to Pro/INTRALINK Toolkit (50min)
● Custom Applications
● Pro/INTRALINK APIs
● Pro/INTRALINK Object
● Object Types
Break (15 min)

© 2000 PTC
Triggers

Trigger Creation
● PDMTriggerCreate

Parameters:

● Name, Event Type, Trigger Type, Description, IsRequiredDLL

Trigger DLL should be initiated using PDMDLLInit function


DLL Info
● Tie up Trigger handle with DLL (Exercise 14)

PDMTriggerGetDLLInfo

Returning Trigger (some tips)


● Return success to avoid error dialog box and log separate

errors if any
● APIs generating more triggers not allowed
● Start a separate Toolkit application to have transactions
● Return Trigger immediately before launching another toolkit
application (Exercise 15)
© 2000 PTC
Workspace Transactions

● Ensure integrity of local database on concurrent access


● Important: references to any WS objects are valid ONLY
inside one workspace transaction
● Functions
● PDMLDBStartTransaction

● PDMLDBCommitTransaction

● PDMLDBAbortTransaction

● PDMIsLDBTransactionInProgress

© 2000 PTC
Commonspace Transactions
● When to use
● Group of modifications of CS objects

● Need abort changes

● Limitations of actions
● Check Out

● Delete (PI, PIV, Release Procedure)

● Purge

● Replicate Files

● Functions
● PDMStartTransaction

● PDMCommitTransaction

● PDMAbortTransaction

● Example

© 2000 PTC
Configuration Objects
◆What is a Configuration Object
● Contains a set of configuration rules
● Every rule consists of scope and query
◆How to create Configuration
● Create configuration object
● PDMConfigurationCreate

● PDMConfigurationCreateFromFile

● Add rule
● PDMConfigurationAddRule

◆When can it be used


● PDMPIVGetDepGraph
● PDMConfigurationExecute

© 2000 PTC
Get LOVs for PIVs, Clusters, etc.

© 2000 PTC
What Is Release Management?
● Allows administrators to create Release Procedures
and apply them to a Commonspace folder
● Release Procedures define the voting procedure,
notification and distribution for an approval process
● Voting can be Any, Majority or Unanimous and can
apply to users and/or groups
● Notification and Distribution take place via E-mail

© 2000 PTC
Approval Scheme Objects
Objects Associated with Release Procedures
● ApprovalScheme

● ASTaskInst

● ASTaskNode

● EvalNode

● PromotionParticipant

● RTP

© 2000 PTC
Approval Scheme

Promotion Initiated

Email Notification
Notification List Distribution List
AS Task Node2
Notifier AS Task Node1 Distributor
Group Group
Managers Managers

Approve Participant Approv


Notifier Distributor
Any? Jane e All?
Jane Jane
Participant (User)
Eval Yes Eval Yes Objects
Managers
Node1 Node2 Promoted
(Group)
Notifier No Participant No Distributor
Joe Joe Joe
(User)

Notifier Distributor
Bob Bob

Promotion Rejected

Email Notification

© 2000 PTC
Session Management
How does PDMIsCompatible work?

Login
● PDMConnectToPDM, PDMReconnectToPDM, PDMFlushAll
Transactions and Schema Compatibility
● Start, Abort,Commit, InProgress, Cleanup

© 2000 PTC
Questions?

© 2000 PTC
Guidelines on using bullets
There are 2 styles of main sub-heading:

This is a main sub-heading, and


● This is the second alternative sub-heading
Only use one of these alternative styles on each slide

Whichever sub-heading you use, use the following as the standard bullet with it
● This is the standard first level bullet

© 2000 PTC

Das könnte Ihnen auch gefallen