cancel
Showing results for 
Search instead for 
Did you mean: 

Automation Operation context in Studio and Java

karl_harris_
Star Collaborator
Star Collaborator

I want to create a context variable using Studio automation operation and read/write them with a Java class generated via the IDE.

Also, I would like to create an operation context variable in JAVA and read/write them in a Studio automation operation.

References to code examples are ok, I haven't been looking in the correct places....:-/

1 ACCEPTED ANSWER

Benjamin_Jalon1
Elite Collaborator
Elite Collaborator

You have here source code examples of default operations available in studio. You can look around there are more other operations.

About your question to get the Operation context, you just have to ask to automation to inject into your operation:

@Context
protected OperationContext ctx;

And get your value from this object.

ctx.get("myValue");

I'm not sure to understand the second part of your question. Anyway I hope with our example, it will be fine.

View answer in original post

3 REPLIES 3

Benjamin_Jalon1
Elite Collaborator
Elite Collaborator

You have here source code examples of default operations available in studio. You can look around there are more other operations.

About your question to get the Operation context, you just have to ask to automation to inject into your operation:

@Context
protected OperationContext ctx;

And get your value from this object.

ctx.get("myValue");

I'm not sure to understand the second part of your question. Anyway I hope with our example, it will be fine.

The ctx.put("myValue", value) I found in OperationContext.java answers my second questions.

Florent_Guillau
World-Class Innovator
World-Class Innovator

(shortened title)