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)
WF executing twice
kaalraa
Hi all,
All well.. but the last thing is when i invoke the compiled job spec file... it is being repeated twice. The workflow which is creating the job file dynamically runs the complete code as well as the job spec file twice.
As a brief of the same... it is giving all logs twice, all code written under template_script is executed twice and moreover the dynamically built job spec file is also invoked twice creating 2 tasks under my tasks to do screen.
If anyone can help me out on the same.. that would be great for me.
- AKs.... The Shadow
Find more posts tagged with
Comments
Adam Stoller
Have you searched the forums?
Have you searched the manual?
This is a known aspect (not a bug, not sure I'd call it a feature either) of wft processing that the wft code is processed twice.
If you look at page 119 of the TeamSite Workflow Developer's Guide (TS 6.5 SP1 -- page number may vary in other versions) - you'll see a little code example:
if (!defined(__VALUE__(iw_first_time)))
{
TAG_info(
first_time_hidden_placeholder =>
[
html => "<input type=hidden value=''>",
is_required => 'true',
],
);
}
The logic shown above for only including the piece of code the *first* time the wft is processed can be expanded and/or reversed to only process certain code the *second* time the wft is processed.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
kaalraa
Hi Fish,
What if i used the same... function as a condition to invoke my job spec file.
if (!defined(__VALUE__(iw_first_time)))
{
$wf->Invoke();
}
It sis giving an error.... iw_first_time as a bare word.
- AKs.... The Shadow
Adam Stoller
I don't think you want your entire wft code to be conditionalized as such - the reason there are multiple passes is, I believe, because the first pass takes care of some pre-processing of some directives to make their values available for the second pass where the code is then fully interpreted / compiled; so if you conditionalized the entire thing it is possible that the generated code may not be what is expected, desired, or needed.
The bare-word error is probably due to a typo (either on my part or in the manual) - try putting single-quotes around the string.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
kaalraa
Hi,
As to brief you the complete scenario, what i have to do is the following:
1. On starting a new job, cgi screen would be instantiated. The CGI form gathers all the inputs from the request person about the work to do, the list of approvers, notifiers etc.
2. All data is to be collected in the form of an XML and placed physically in a pre-defined folder.
3. The next task is to be launcher workflow... which reads the data from that particular XML file and declares a new workflow and its tasks. Based on the inputs, the sequence of tasks is to be linked using links_task method.
4. Once the get_job_spec method is called, it invokes the dynamically built file and also creates the first and immediate task twice.
SO MY QUERIES in consildated format are:
a.) How to call a .wft file from a CGI file when it completes its process of taking inputs and creating XML.
b.) How to stop invoking the launcher workflow twice.
I really appreciate your understanding and help. Thanks in advance.
- AKs.... The Shadow
Adam Stoller
On starting a new job, cgi screen would be instantiated. The CGI form gathers all the inputs from the request person about the work to do, the list of approvers, notifiers etc.
Are you talking about the job instantiation screen or an immediate cgitask script?
The former is basic workflow development stuff; the latter is relatively basic CGI script development stuff - but they happen at different parts of the overall process
All data is to be collected in the form of an XML and placed physically in a pre-defined folder.
I do not understand the above - are you collecting job specification information to launch a new job?
Is this a nested job?
Are you trying to do this within the job instantiation process (in the WFT code) or within a cgitask or externaltask script after the [parent] job has been instantiated?
The next task is to be launcher workflow... which reads the data from that particular XML file and declares a new workflow and its tasks. Based on the inputs, the sequence of tasks is to be linked using links_task method.
Again, are you trying to do this within the WFT or within a cgitask or externaltask script?
Once the get_job_spec method is called, it invokes the dynamically built file and also creates the first and immediate task twice.
Until I understand the previous items, I don't really have much to comment on here.
SO MY QUERIES in consildated format are:
How to call a .wft file from a CGI file when it completes its process of taking inputs and creating XML.
You can invoke a wft using iwwft_compile.ipl - read the perldoc on IWHOME/bin/iwwft_compile.ipl for more details
How to stop invoking the launcher workflow twice.
First, you've been given the conditional code to use for that; Second I don't think you want to launch a new workflow during the instantiation of the initial workflow - better to do it within a task of the initial workflow
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
kaalraa
1. I am talking about the immeidiate cgitask, which is being called on START JOB
2. I am colloeting the inputs from the job initiator for checking as who are the editors, approver and notifiers. Also we have to check whether there is a need of approvers or not.
3. XML is to be created on submitting the inpuits on the CGI form. I ma using CreateDOM method for the same.
4. Now the WFT file is to be called, from CGI itself after placing XML, which is supposed to be launcher workflow for building and initiating a dynamic workflow (job spec file). And that job spec file creates tasks and job for editors and approvers.
Still not understand .. how to invoke the job spec file only once...
Thanks for all your support
- AKs.... The Shadow
Adam Stoller
Now the WFT file is to be called, from CGI itself after placing XML, which is supposed to be launcher workflow for building and initiating a dynamic workflow (job spec file). And that job spec file creates tasks and job for editors and approvers.
The "launcher" workflow is the initial workflow which has the immediate cgitask in it - right?
The "dynamic" workflow is the workflow launched from the immediate cgitask in the "launcher" workflow - based upon information collected in the "launcher" workflow - right?
Still not understand .. how to invoke the job spec file only once...
I assume you're talking about the "dynamic" workflow being invoked multiple times - yes?
The only reasons I could think for that to happen are:
If you post your cgitask script code it is possible that someone here might be able to spot something for you.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
kaalraa
Hi,
4. The LAUNCHER workflow is the wft file which is to be called from CGI file, when it completes the process of creating inputs XML and placing it in a pre-defined folder. Now this workflow have the new declared workflow and all the tasks which can be used in the process and also it parses the earlier made XML file for values. AS per the values it writes the sequence of tasks using link_task method and call get_job_spec()
Now what i have done is .:: Use WFsystem and uses Invoke() method of the same. And here lies the problem it provide the first task of the dynamic job spec file twice in the task list of that owner.
I hope ... you understand. and my quriy for calling a wft file from a cgi file stands still.
- AKs.... The Shadow
Adam Stoller
I'm not sure I understand - however, I think you might be better using either iwwft_compile.ipl (to instantiate a wft by passing in parameter information in place of tag_info paramaters) or iwjobc -i (to instantiate a job description file) -- both are probably much cleaner than using WFsystem to do this kind of thing (I've done both - I'm much happier using iwwf_compile.ipl)
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
kaalraa
Fish,
Can you suggest any other approach of doing these tasks as a complete process.
- AKs.... The Shadow
Adam Stoller
I'm not sure I understand your question - I've already provided a fair amount of suggestions based on your posts.
Do you not understand what I've written so far?
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com