Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
WFM Pre-Processor to update Global Variables
gundu
Hi,
Could someone tell me if there is there a way to access the WFM global variables using the Pre-Processor and update the same.
Here is what I am trying to achieve.
- Create CONFIGURABLE global variable.
- Add the reference to this global variable in the tasks variables.
- Create a Java pre-processor which will update this global dynamically.
I am able to update these global variables using the custom_instantiation.cfg. Also, I was able to access the task variables and update them but not the global variables. Has anyone tried the same.
Any pointers on this would be of great help.
Thanks,
Find more posts tagged with
Comments
Migrateduser
Hi
Well ,to my understanding "In TS6.7.1 SP-1" their is no way to get Global Variables in Your Java Code.If you go through CSSDK_DOC API ,you will find a class "CSWorkflow",this class has two methods as
getVariable(java.lang.String name)-- Method to get a single custom
variable for a workflow.
getVariables(java.lang.String[] names)--Get the custom variables of a
workflow. Return
CSNameValuePair[]
Using this class you can get all WF variables and update them,but for Global Variables their is no option available yet.
Similarly you can use task variables using class "CSTask".
But One thing you can do is that you can pass variable name and a parameter to your Pre-Processor Code,may be it can solve your problem.
Refer to Pre-Processor Examples.
gomes
Hi,
You can update variables what you have selected in custom_instantiation.cfg file.
Step1:You create empty global varaible or you can have some values.
Step2:In post Processor access,get workflow object. and try this.
Step3:workflow.updateVariable(arg0, arg1).
gundu
Hi Prabhat & Gomes,
Thanks for the response.
Gomes,
I tried to update the global variables in the post-processor and its doesnt work either. Just for clarification, I am referring to the CONFIGURABLE system variables in the workflow modeler as the global variables.
Prabhat,
Where can I find the pre-processor examples. It would be great if you could send me those.
Thanks,
Migrateduser
Hi
You can find information for pre-processor in the pdf file
"wfm_1001_user_v01_en.pdf" under the
TOPIC--"USING CUSTOM CODE" ,
SUB-TOPIC-- "CREATING CUSTOM CODE"
ARTICLE-----"Implementing the InProcessJavaCommand Interface"
Note: This will be present in TS 6.7.1 SP1 Help Manuals.
Thanks
gomes
public class CustomDeployPostProcess implements InProcessJavaCommand {
/**
*
*
* This method is used to set workflow variables
*/
public WFMWorkflow execute(WFMWorkflow workflow, Map params) {
try {
System.out.println("inside the custom--------------");
System.out
.println("edition path" + workflow.getVariable("edition"));
}
gundu
Hi Gomes,
I tried using the same. But deosnt really for the global variables :-(
Thanks,
Migrateduser
Hi gundu
As per my understanding Global Variables are also WF Variables,so if u see the code posted by gomes....it simply accessing the WF Variables before instantation of WF and updating their values using Pre-Processor .
So,if you try to follow gomes code then it will pro'ly sort out your problem.
Thanks
Prabhat
kalpanat
This is my understanding of "Global Variables" in WFM:
- We can create global variables that has a null value or ones with default value
- They can be accessed through job variable (getVariable and setVariable) methods
- However, the setVariable does not get reflected in the model dynamically
we had to create a workaround (have a CGI or External Task) for setting the values as per our needs
Thanks
Kalpana.