cancel
Showing results for 
Search instead for 
Did you mean: 

How to read Action Information from a WebDynpro Callable Object?

Former Member
0 Kudos
63

Hello Experts,

I am using a Web Dynpro Callable Object in my guided procedure application. Definitly I will be using this Web Dynpro under an Action, say Action123. How can I get the name of this action or any other details of the action from this web Dynpro callable object using an API? I mean is there any Guided Procedure API which would help me to read the information of the action which holds the web dynpro callable object? I want to use this information in the execute method of the web Dynpro callable object.

Thank You,

mansooralip1

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

I can´t completely understand what you need.

When you are executing a process , and you are executing a callable object you want to get the name of the action that is holding that CO ? or you want to get info about the active version of the Callable Object?

If you need info about the current action, take a look at this excerpt (extracted from sap help --> Completing Actions Using the GP API ) :

*//Retrieving Information about Actionu2019s Parameters, Result States, or Process Exceptions*

IGPActionInstance instance =  rtManager.getActionInstance(processID, actionID, userContext);

if (instance.getTemplate().isAction()){

//the action template

IGPAction action = (IGPAction) instance.getTemplate();

//a collection of IGPAttributeInfo objects

Collection output = action.getOutputParameters().getAttributes();

Iterator itr = output.iterator();

while(itr.hasNext()){

      IGPAttributeInfo attr = (IGPAttributeInfo)itr.next();

      String name = attr.getTechName();

      int type = attr.getType();
}
.....
//an array of IGPResultStateInfo objects    

IGPResultStateInfo[] states = action.getResultStates();

for (int i=0; i<states.length; i++){

   String resultState = states<i>.getName();
.....
}

BUT, if what you need is to get information independent from the executing process (las active version of CO for example) then you are talking about the GP Development Objects, and you should use that libraries to get for example Retrieving Actions with Status ACTIVE ,Retrieving Objects Information and so on, please if this is the case refer to this link ,(it contains code examples and some explanation):

HELP SAP then click on Modeling and Configuring Workflows Using the GP API --> Editing GP Development Objects

Hope been helpful,

Best regards,

Marco.

Edited by: Marco Ustarroz on Jun 5, 2009 3:40 PM

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Marco,

I think we are very close to the solution using the information received from you so far. But still missing a link, may be if I put the question in a different way, you will be able to help me better.

Suppose I created an Action named Action123 using the following code. I am using a WebDynproComponent Callable Object say wd1CO as the callable object for this action. Now my Design task is completed and I initiated the process to start th process.

**************Creating an Action*********

String aName = "Action123";

String aDescription = "A test action";

// create an action in the u201Ctestu201D category

IGPModifiableAction a = manager.createAction(

Locale.getDefault(),

aName,

aDescription,

cat.getID()

);

**************End of Creating an Action*********

Now my requirement is to read the name of the Action from CO wd1CO. If I have some APIs I will insert that code into the CallableObject wd1CO, which would tell me the name of the Action. In this case the code which I want to insert into the wd1CO should give me the name of the Action ast Action123.

In nutshell, as shown in the above code, we can set a name for the action, but no way to read that name from an underlying Callable Object using code?

I am sure we are very near to answer, your kind help would help me a lot.

Thank You,

mansooralip1

Former Member
0 Kudos

Hi,

Please take a look at the java docs for full info, but also look at the blog to see a very good code example of how to use some of this libraries:

[JAVA GP API DOCs|http://help.sap.com/javadocs/NW04S/current/gp/index.html]

[Process Runtime Dashboard|https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/6271] [original link is broken] [original link is broken] [original link is broken];

Regards,

Marco.

Former Member
0 Kudos

This message was moderated.