4 Replies Latest reply on Jun 3, 2011 7:42 AM by teknix1

    Getting User-Assigned-Task Variables




      I have a task assigned to a user, I am trying to obtain, through an execute script, the process variables of this task. Unfortunately I keep getting an exception in one of the internal classes of LiveCycle. I'm not sure what I'm doing wrong.


      Here's the code that I am using (I am using the context of the same user that has the task assigned to):

           ServiceClientFactory userFactory = ServiceClientFactory.createInstance(InvocationContext.getInstance().getContext());
           TypedTaskManagerQueryService tmqs = new TypedTaskManagerQueryService(userFactory);
           List processVariableValues = tmqs.getProcessVariableValues(taskID);


      And here's the exception (I cut out a long part of it to make it clearer), it occurs on the getProcessVariableValues method in my code:

           com.adobe.pof.UnknownValueException: Attribute: workflow_principal_id on object: queue:[1] has not been loaded.
                at com.adobe.pof.DefaultGenericObject.getValue(DefaultGenericObject.java:90)
                at com.adobe.workflow.boi.BOIQueueBase.getWorkflowPrincipalId(BOIQueueBase.java:285)
                at com.adobe.idp.taskmanager.dsc.queryservice.TaskManagerQueryServiceImpl.getProcessVariable Values(TaskManagerQueryServiceImpl.java:160)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

      Any insight is greatly appreciated! Thanks


        • 1. Re: Getting User-Assigned-Task Variables
          teknix1 Level 1

          I'm still trying to figure out how to solve this. I thought perhaps if there was a way of setting the workflow_principal_id but I don't have any idea what that is exactly. Anybody noticing anything wrong in my code?




          • 2. Re: Getting User-Assigned-Task Variables
            $Nith$ Level 4

            "obtaining process variables of this task"??  What do you mean by this statement??



            All process variables are accessible by all the tasks within a process instance.


            If you are trying to access the process variables within your process, there is no need to use an ExecuteScript activity; Instead you can use SetValue.


            If you still wish to use ExecuteScript, there is no need to instantiate ServiceClientFactory. Since your ExecuteScript activity is being run within the process context, you can just use the following statement to get the variable values:


            String myVariableValue = patExecContext.getProcessDataStringValue("/process_data/Your_String_Variable");


            List myList = patExecContext.getProcessDataListValue("/process_data/My_list_variable");



            Is that make sense?


            • 3. Re: Getting User-Assigned-Task Variables
              teknix1 Level 1

              I should have specified that I want to do this from another process. With the code I provided, I should be able to retrieve variables from any process, granted that I have right to that process instance.


              I apologize for not using the correct terminology, I get confused between a task and a process instance. A task is when a process instance gets assigned to a user, ie: when using an assign task activity?




              • 4. Re: Getting User-Assigned-Task Variables
                teknix1 Level 1

                Apparently this would be a bug in the version of the server that I am using.


                Version: 8.2.1, GM
                Patch Version: SP3
                Service Pack Version: 8.2.3163.3.212556.2