‎2018 Mar 05 12:47 PM - edited ‎2024 Feb 04 3:47 AM
As far as i know i can extend a function by using @pluginAt if i used a POSITION = Before i can trigger a function just before the target function.
So what i want to do is to use this way so i can edit the bar code readed from the bar code reader before it goes to the database but, still i don't know which function or which class is responsible for fetching data from database.
***************
TEST CASE : Bar code readed : 1234567890
Item Real Bar Code : 1234567
Quantity : 890
i just need to change the barcode from 1234567890 to 1234567 before searching in the database.
******************
And if i am going the wrong way please tell me
Request clarification before answering.
The right method is "readMaterialByExternalID", which you can find in the MaterialManager.
Please use the POSITION.BEFORE posibility to inject your code, before the method will be executed.
Example:
@PluginAt(pluginClass = IMaterialManager.class, method = "readMaterialByExternalID", where = PluginAt.POSITION.BEFORE)
public void beforeReadMaterialByExternalID(Object proxy, Object[] args, StackTraceElement caller) {
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Using the @PluginAt Annotation you're not overriding the actual method, instead you're injecting your code before or after a method will be executed. The method "readMaterialByExternalID"has the parameter "externalID" which you can find inside your parameters: "Object[] args ". By changing the "args" array before the method will be called, you can affect on the behaviour of the the "readMaterialByExternalID" method.
| User | Count |
|---|---|
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.