First of all, you should try to split your problem in small parts. Then solve one part at a time. Also jumping between different frameworks (SysOperation and RunBaseBatch) might not be productive, instead I recommend trying to learn to understand one of them first. Once you understand the concepts and can effortlessly develop functionalities using one of the frameworks, it should be easy to learn the other. But if you have difficulties with understanding the fundamentals, you are just making your life more difficult if you jump between them.
Your first part is passing values from class to another. This has nothing to do with batches!
I thought you already managed to pass values from one class to another, and your only problem was to use them in batch. But apparently even your first part is not working yet. So please forget the batch for now and only resume once you have completed the first part.
For the first part, here are the required steps:
Put this in the first class:
public void run(Args _args)
{
dialog.run();
if (dialog.closedOk())
{
Args args = new Args();
args.caller(this);
//I want to pass values to class extending runbaseBatch
RoleBatch::main(args);
}
}
By the way, I don't know what is in "_args" parameter of the run method, and I don't know if you have something valuable there. I assume that you don't have anything there that is needed in the batch class, so I'm instantiating a new Args object and passing "this" (=pointer to the current class) into it.
In your second class (the batch class) you can access any methods of the caller class from the main method of your batch class:
public static void main(Args _args)
{
MyFirstClass myFirstClass = _args.caller();
// Now you can call any methods of myFirstClass to fetch values from it
string myString = myFirstClass.getMyString();
}