cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Capture event

ptc-6083798
1-Visitor

Capture event

Hi

How we capture the copy event or any ohter event ?

ACCEPTED SOLUTION

Accepted Solutions

You can use a combination of the getNameList() and getEventName() methods in the siEnvironmentBean to accomplish this. For example, here is a sample trigger script which will output the available beans for a given operation. Note that the trigger must be configured to fire on the certain event for this to work!

var eb = bsf.lookupBean("siEnvironmentBean");

function main ()

{

var list = eb.getNameList();

var event = eb.getEventName();

print ("*****************************************************");

print("The available beans for the " + event + " operation are: ");

print(list);

print ("*****************************************************");

}

function print(s)

{

Packages.mks.util.Logger.message("GENERAL", 1, s);

}

main();

As an example, here is what an item edit produces for output in the Integrity server.log:

2014-10-21 16:08:44,524 INFO [mksis.IntegrityServer] GENERAL(1): *****************************************************

2014-10-21 16:08:44,524 INFO [mksis.IntegrityServer] GENERAL(1): The available beans for the Issue.changed.pre operation are:

2014-10-21 16:08:44,524 INFO [mksis.IntegrityServer] GENERAL(1): [siEnvironmentBean, imIssueDeltaBean, imServerBean, parametersBean]

2014-10-21 16:08:44,525 INFO [mksis.IntegrityServer] GENERAL(1): *****************************************************

View solution in original post

2 REPLIES 2

Hello A A,

What, exactly do you mean? Are you looking to launch a trigger event, or are you just trying to log events that are occuring?

Regards,
Kael


Kind Regards,
Kael Lizak

Senior Technical Support Engineer
PTC Integrity Lifecycle Manager

You can use a combination of the getNameList() and getEventName() methods in the siEnvironmentBean to accomplish this. For example, here is a sample trigger script which will output the available beans for a given operation. Note that the trigger must be configured to fire on the certain event for this to work!

var eb = bsf.lookupBean("siEnvironmentBean");

function main ()

{

var list = eb.getNameList();

var event = eb.getEventName();

print ("*****************************************************");

print("The available beans for the " + event + " operation are: ");

print(list);

print ("*****************************************************");

}

function print(s)

{

Packages.mks.util.Logger.message("GENERAL", 1, s);

}

main();

As an example, here is what an item edit produces for output in the Integrity server.log:

2014-10-21 16:08:44,524 INFO [mksis.IntegrityServer] GENERAL(1): *****************************************************

2014-10-21 16:08:44,524 INFO [mksis.IntegrityServer] GENERAL(1): The available beans for the Issue.changed.pre operation are:

2014-10-21 16:08:44,524 INFO [mksis.IntegrityServer] GENERAL(1): [siEnvironmentBean, imIssueDeltaBean, imServerBean, parametersBean]

2014-10-21 16:08:44,525 INFO [mksis.IntegrityServer] GENERAL(1): *****************************************************

Announcements


Top Tags