cancel
Showing results for 
Search instead for 
Did you mean: 

Global variable: Security Token across processes instances

rangoo
Champ in-the-making
Champ in-the-making
Our Java Service Tasks make WebService (SOAP) calls. Services expect a security token( SAML 2.0) which expire after 20 mins. We renew the token after we validate it for expiry.

We are currently generating these tokens(for the same system user) for each process instance.  There is a limit for no. of tokens we can create for a user . Since our processes would run into several thousands we have to re-use our Security Token across Service Tasks across process instances. 

As the process variables scope is limited to the process instance, I can not use the security token across processes? If yes, do you have any recommendations?

Thanks





2 REPLIES 2

rangoo
Champ in-the-making
Champ in-the-making
Documentation says

there will be only one instance of that Java class created for the serviceTask it is defined on. All process-instances share the same class instance that will be used to call execute(DelegateExecution). This means that the class must not use any member variables and must be thread-safe, since it can be executed simultaneously from different threads. This also influences the way Field injection is handled.

If I use a singleton pattern to generate Tokens, I should be good ?

trademak
Star Contributor
Star Contributor
Yes that should be okay.

Best regards,