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

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

How to send parameters from one Integrity trigger to another in java ?

Alex275
4-Participant

How to send parameters from one Integrity trigger to another in java ?

Hello,

 

I am a junior developer and I develop triggers in java for Integrity and I would like to know how I can send parameters from a java trigger to another. Let me explain:

I have 2 triggers, let's call them trigger A and trigger B.
My 2 triggers are triggered according to rules.
My trigger B is an automatic numbering trigger and is triggered during trigger A and I need to bypass part of the code of trigger B for functional reasons.
To do this I would have liked to send a parameter from trigger A to trigger B to have the information in trigger B when A is triggered.


I had thought of doing this in the A :


ScriptServerBean serverBean = getScriptServerBean();
Map<String, String> serverMap = serverBean.getTransactionContext();
serverMap.put("parameter", "");

 

I have the parameter information in my trigger A but I can't get the information in my B trigger, maybe they don't belong to the same transaction ?

 

If you have any clue of solution I'm interested, thanks.

Alex

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
LLawton
14-Alexandrite
(To:Alex275)

You cannot pass context from one trigger to another, and I'm sure there are lots of reasons why you shouldn't even try. If I had to come up for reasons, I would look at multi-threading and performance in general.

The solution is to have code that is smart enough and to have a careful analysis of your trigger sequence. It sounds like B is triggered by what you did in A. Remember that B can see what you just did in A by looking at the current values of fields in the item being processed. So maybe you can pass some context that way.

We would need way more details to give you a better answer.

View solution in original post

2 REPLIES 2
LLawton
14-Alexandrite
(To:Alex275)

You cannot pass context from one trigger to another, and I'm sure there are lots of reasons why you shouldn't even try. If I had to come up for reasons, I would look at multi-threading and performance in general.

The solution is to have code that is smart enough and to have a careful analysis of your trigger sequence. It sounds like B is triggered by what you did in A. Remember that B can see what you just did in A by looking at the current values of fields in the item being processed. So maybe you can pass some context that way.

We would need way more details to give you a better answer.

Alex275
4-Participant
(To:LLawton)

Ok thank you very much for your answer, I will do it differently and pass the information through a field.
I wish you a good day.

Top Tags