get the process id from a custom component

Avatar

Avatar
Level 6
neptas
Level 6

Likes

0 likes

Total Posts

259 posts

Correct reply

0 solutions
View profile

Avatar
Level 6
neptas
Level 6

Likes

0 likes

Total Posts

259 posts

Correct reply

0 solutions
View profile
neptas
Level 6

08-01-2009

Hello,



Anyone knows how to get the process id from a custom component?



thank you

Replies

Avatar

Avatar
Coach
Level 10
Jasmin_Charbonn
Level 10

Likes

149 likes

Total Posts

2,154 posts

Correct reply

97 solutions
Top badges earned
Coach
Give Back 1000
Give back 900
Give Back 800
Give back 600
View profile

Avatar
Coach
Level 10
Jasmin_Charbonn
Level 10

Likes

149 likes

Total Posts

2,154 posts

Correct reply

97 solutions
Top badges earned
Coach
Give Back 1000
Give back 900
Give Back 800
Give back 600
View profile
Jasmin_Charbonn
Level 10

09-01-2009

This doesn't make sense.



A process id related to the overall process (one instance of the process) and not to a particular step in the process.



Can you elaborate more on what you're trying to do?



Jasmin

Avatar

Avatar
Level 6
neptas
Level 6

Likes

0 likes

Total Posts

259 posts

Correct reply

0 solutions
View profile

Avatar
Level 6
neptas
Level 6

Likes

0 likes

Total Posts

259 posts

Correct reply

0 solutions
View profile
neptas
Level 6

09-01-2009

Jasmin,



Im trying to get a value from a process variable.



Thank you

Avatar

Avatar
Coach
Level 10
Jasmin_Charbonn
Level 10

Likes

149 likes

Total Posts

2,154 posts

Correct reply

97 solutions
Top badges earned
Coach
Give Back 1000
Give back 900
Give Back 800
Give back 600
View profile

Avatar
Coach
Level 10
Jasmin_Charbonn
Level 10

Likes

149 likes

Total Posts

2,154 posts

Correct reply

97 solutions
Top badges earned
Coach
Give Back 1000
Give back 900
Give Back 800
Give back 600
View profile
Jasmin_Charbonn
Level 10

09-01-2009

I still don't understand what you're trying to do?



From where are you trying to get the value of the process variable?



Jasmin

Avatar

Avatar
Level 6
neptas
Level 6

Likes

0 likes

Total Posts

259 posts

Correct reply

0 solutions
View profile

Avatar
Level 6
neptas
Level 6

Likes

0 likes

Total Posts

259 posts

Correct reply

0 solutions
View profile
neptas
Level 6

09-01-2009

Jasmin,



I want to transform the value of a variable based on a user input(here the user is the person that will design the process), however I want to make that transformation invisible to the user (ex: change a text or make some calculations). So, the idea would be to encapsulate this transformations inside a custom component. This component would have an input field where the user would place some value. Then the component would take that value and the value of a previous variable defined in the process, and change it.



I think there are some methods (get Process Variable Values) to get the value of the variables in the process, but because the same process can run multiple instances at the same time, I believe I need the process id (or taskid?) of the current context of the component.



got it?



thank you

Avatar

Avatar
Coach
Level 10
Jasmin_Charbonn
Level 10

Likes

149 likes

Total Posts

2,154 posts

Correct reply

97 solutions
Top badges earned
Coach
Give Back 1000
Give back 900
Give Back 800
Give back 600
View profile

Avatar
Coach
Level 10
Jasmin_Charbonn
Level 10

Likes

149 likes

Total Posts

2,154 posts

Correct reply

97 solutions
Top badges earned
Coach
Give Back 1000
Give back 900
Give Back 800
Give back 600
View profile
Jasmin_Charbonn
Level 10

12-01-2009

You don't need any context.



When you execute an instance of the process, your custom component will give you the value of the varibale for that instance only.



Jasmin

Avatar

Avatar
Level 6
neptas
Level 6

Likes

0 likes

Total Posts

259 posts

Correct reply

0 solutions
View profile

Avatar
Level 6
neptas
Level 6

Likes

0 likes

Total Posts

259 posts

Correct reply

0 solutions
View profile
neptas
Level 6

13-01-2009

Jasmin,



The point is how can I access to the value of a process variable in the Java code of my custom component.



thank you

Avatar

Avatar
Coach
Level 10
Jasmin_Charbonn
Level 10

Likes

149 likes

Total Posts

2,154 posts

Correct reply

97 solutions
Top badges earned
Coach
Give Back 1000
Give back 900
Give Back 800
Give back 600
View profile

Avatar
Coach
Level 10
Jasmin_Charbonn
Level 10

Likes

149 likes

Total Posts

2,154 posts

Correct reply

97 solutions
Top badges earned
Coach
Give Back 1000
Give back 900
Give Back 800
Give back 600
View profile
Jasmin_Charbonn
Level 10

13-01-2009

You can use the TaskManager API to get the value of a process variable for a specific process id. Here is a snipped of code:



_queryManager = TaskManagerClientFactory.getQueryManager(_factory);

procVar = _queryManager.getProcessVariableValues(processID);



int size = procVar.size();

for(int i = 0; i < size; i++)

{

MultiTypeVariable var = ((MultiTypeVariable)procVar.get(i));

System.out.println("name = " + var.getName());

System.out.println("value = " + var.getValue());

}



Jasmin

Avatar

Avatar
Level 6
neptas
Level 6

Likes

0 likes

Total Posts

259 posts

Correct reply

0 solutions
View profile

Avatar
Level 6
neptas
Level 6

Likes

0 likes

Total Posts

259 posts

Correct reply

0 solutions
View profile
neptas
Level 6

15-01-2009

Jasmin,



But from my java code in the custom component, where processID and _factory come form? If they are not explicity declared I will get a compile error. Sorry if I´m not seeing a obvious step.



thank you

Avatar

Avatar
Coach
Level 10
Jasmin_Charbonn
Level 10

Likes

149 likes

Total Posts

2,154 posts

Correct reply

97 solutions
Top badges earned
Coach
Give Back 1000
Give back 900
Give Back 800
Give back 600
View profile

Avatar
Coach
Level 10
Jasmin_Charbonn
Level 10

Likes

149 likes

Total Posts

2,154 posts

Correct reply

97 solutions
Top badges earned
Coach
Give Back 1000
Give back 900
Give Back 800
Give back 600
View profile
Jasmin_Charbonn
Level 10

16-01-2009

I told you this was a just snippet of code.



You can create a input parameter to your component and pass the /process_data/@id process varibale to it. It's a built in variable that contains the process id.



There's a ton of exmaples in the documentation online on how to create a factory object.

See http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/help/000274.html and http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/help/000008.html



Jasmin