hello all i am initiating a workflow from java code using cws. I have generated the cws.jar file and i am able to initiate the workflow without attributes. i want to pass values to attributes using java. Please help me with a sample code how can i pass/set the attribute values. My code is as below. I am able to get the names of workflow attributes in java class but i am unable to pass the data/inserting values to those attributes.
OTAuthentication otAuth = new OTAuthentication();
otAuth.setAuthenticationToken(authToken);
WorkflowService_Service wf = new WorkflowService_Service();
WorkflowService wfclient = wf.getBasicHttpBindingWorkflowService();
setSoapHeader((WSBindingProvider) wfclient, otAuth);
List<Long> attachments = new ArrayList<Long> ();
List<Long> memberRoleIDs = new ArrayList<Long> ();
String processName="test";
ProcessStartData psdata = new ProcessStartData();
psdata.setObjectID(2312257);
psdata.setTitle(processName);
ProcessDefinition pd = wfclient.getProcessDefinition(2312257);
for(int i =0;i<pd.getApplicationData().size();i++){
if( (pd.getApplicationData().get(i)) instanceof AttributeData ){
AttributeData attrData = (AttributeData)pd.getApplicationData().get(i);
AttributeGroupDefinition agd = attrData.getAttributes();
for (Attribute attrBute : agd.getAttributes()) {
System.out.println("attrBute "+attrBute.getDisplayName());
if(attrBute.getDisplayName().equals("empid")){
//How can i set this attribute value
}
}
System.out.println("attrData " +attrData.getAttributes().getAttributes());
}
}
ProcessInstance ps = wfclient.startProcess(psdata, attachments, memberRoleIDs);