Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Content Management (Extended ECM)
API, SDK, REST and Web Services
Workpackage Description in LL9
Chris_Pratt-Johnson
I am trying to access form's data within a workflow package!! The documentation for LL_StartTask says:StartTaskThis function marks a task as executing and returns the work package.Long LL_StartTask( _ ByVal session as Long, _ ByVal workID as Long, _ ByVal subWorkID as Long, _ ByVal taskID as Long, _ ByVal workPackage as Long )workPackage:a Work Package value object of type RecArray, initialized using the ValueAlloc function. And the description of the workpackage states that:Type:Integer the work package type ID. SubType:Integer the work package subType ID where 1 = attachments, 2 = comments, 3 = attributes, and 4 = forms. UserData:Dynamic work package data that depends on the value of the SubType field. **** I managed to access attachments, attributes and comments but not forms **** In the case of forms it says that you would get:a List containing a member for each Form. Each member is an Assoc that contains the following fields: FormName:the name of the form added to the work package TemplateID:the ID of the form DisplayType:a value object that contains: Key Value Description Fieldname String the name of the field Value Dynamic the current value of the field But what I am getting is completely different structure!!Please help!!Nasif Dawd
Find more posts tagged with
Comments
***_****_(citlon01admin_-_(deleted))
Were you able to resolve this?Kristina
x-scoruser8_-_(deleted)
/*Try the following methods to see what your formvalues are. Note the remarkable depth in thestructure before you actually get to the data.I have determined that the documented structureof the workpackage is remarkably different thanthe published documentation.I am still working on a way to writethe values in the workpackage. Anybody know howto do that?*//*Input: Workflow IDOutput: nonePurpose: Output the field names and values to the console of all forms associated with a workflow.*/public static void getFormData(int itemId){ LLValue workPackage; workPackage = new LLValue().setTable(); LLValue recVal; recVal = new LLValue().setAssocNotSet(); LLValue formVal; formVal = new LLValue(); LAPI_WORKFLOW workLAPI; workLAPI = new LAPI_WORKFLOW(gSession); if(workLAPI.AccessWorkPackage(itemId, 0, workPackage) == LL_OK) { if(workPackage.isTable()) { for(int i = 0; i < workPackage.size(); i++) { if(workPackage.toInteger(i, "SubType") == TYPE_FORM) { recVal = workPackage.toValue(i, "UserData"); formVal = recVal.toValue("Forms"); for(int j = 0;j < formVal.size(); j++) { System.out.println("Form Name: " + formVal.toValue(j).toString("Name")); LLValue valVal= formVal.toValue(j).toValue("Data").toValue("DataAssoc").toValue("Values").toValue(0); LLNameEnumeration enumName; enumName = valVal.enumerateNames(); while(enumName.hasMoreElements()) { String elName = enumName.nextElement().toString(); LLValue nameVal = valVal.toValue(elName); LLNameEnumeration enumValue; enumValue = nameVal.enumerateNames(); while(enumValue.hasMoreElements()) { String elValue = enumValue.nextElement().toString(); if(nameVal.toValue(elValue).type() == LLValue.LL_LIST) { for(int k=0;k<nameVal.toValue(elValue).size();k++) { System.out.print(elName + "\t"); System.out.println(printLLValue(nameVal.toValue(elValue).toValue(k))); } } } } } } } } }}private static String printLLValue(LLValue llVal){ String returnString = ""; switch (llVal.type()) { case LLValue.LL_BOOLEAN : returnString = "" + llVal.toBoolean(); break; case LLValue.LL_DATE : returnString = llVal.toDate().toString(); break; case LLValue.LL_DOUBLE : returnString = "" + llVal.toDouble(); break; case LLValue.LL_INTEGER : returnString = "" + llVal.toInteger(); break; case LLValue.LL_STRING : returnString = llVal.toString(); break; default : break; } return returnString;}