The more common practice is to have the task data operated on by business logic contained in the Task Web Application. No other application will have access to the custom task data java classes.
However, you can directly invoke the web service support using in-proc apis shown in the following example.
Hope this helps.
–mark
import java.util.HashMap;
import java.util.Map;
import com.webmethods.portal.system.PortalSystem;
import com.webmethods.portal.bizPolicy.IContext;
import com.webmethods.portal.bizPolicy.IContextProvider;
import com.webmethods.portal.bizPolicy.command.ICommandManager;
import com.webmethods.portal.bizPolicy.command.ICommandBean;
import com.webmethods.portal.bizPolicy.command.task.webservice;
//get the current user's context
IContextProvider cp = (IContextProvider) PortalSystem.getContextProvider();
IContext ctx = cp.acquireContext(true);
//get the command manager
ICommandManager cm = (ICommandManager) PortalSystem.getCommandProvider();
//get the webservice version of the GetTask command that uses generic non-typed classes
GetTaskWS getTaskWS = (GetTaskWS) cm.getCommand(ctx, GetTaskWS.COMMAND_NAME);
//set the invocation properties (loosely typed)... Same inputs as the web service version
Map props = new HashMap();
props.put("user", <userid>);
props.put("taskID", <taskID>);
props.put("includeTaskData", true);
ICommandBean cb = getTaskWS.createBean(ctx, props);
//invoke
Map results = getTaskWS.invoke(ctx, cb);
We have tried to implement this code in our environment for getting the task data. It seems the ‘invoke (IContext, ICommandBean)’ method is not defined in the type of object GetTaskWS and hence the compilation error is thrown in designer as ““The method invoke (IContext, ICommandBean) is undefined for the type GetTaskWS
You can try to extend TaskInboxSearchContentProvider.
public class MyTaskSearchProvider extends TaskInboxSearchContentProvider {
//constructor
public MyTaskSearchProvider(){
m_searchQuery = new MySearchQuery();
}
public com.webmethods.caf.faces.data.task.impl.TaskData getTaskData() {
return (com.webmethods.caf.faces.data.task.impl.TaskData) getValue(PROPERTY_TASKDATA);
}
//inner class
public class MySearchQuery extends InboxSearchQuery {
private TaskSearchQueryTerm myQueryTerm= null;
public TaskSearchQueryTerm getMyQueryTerm() {
if (myQueryTerm== null) {
myQueryTerm= new TaskSearchQueryTerm();
}
return myQueryTerm;
}
//....
}
Compilation error is coming at line 2 with message “invoke method is not defined”. I suspect that invoke method is not defined in ICommand or it’s super classes (in webMethods 7.1.2)
Is there any way I can use these apis in a normal Dynamic webProject in the webMethods Designer by just importing few jars?? I dont want to use webservices as I am going to deploy my new webapp in MWS server itself.
Please help!!