pass variable from FORM to WORKFLOW

Hi!

I have a Workflow W and a form F.

F has a only field value (f1). F is into workflow W.

W has a variable (var1).

I need to pass de field value "f1" to "var1". Which is the best form to pass, because I have tried it but always var1 results "null"

Thanks for all.

[303 byte] By [heregoesthesuna] at [2007-11-27 10:28:39]
# 1

One of the possible reasons for getting a null value is probably you missed to add 'Base Context' to the form. To access a variable from a form to a workflow, Base Context has to be set.

Swatza at 2007-7-28 17:52:55 > top of Java-index,Web & Directory Servers,Directory Servers...
# 2

The workflow Flex has a variable (ses) and form Flexo has a field (processInputs.ses). In field set to ":display.session" and I need to pass this value to variable "ses" in workflow.

This is the code from workflow and form, I have tried with base context, with processInput, but nothing, it follow prints "null"

<!-- MemberObjectGroups="#ID#Top" createDate="Fri Jul 13 10:34:16 CEST 2007" extensionClass="WFProcess" id="#ID#61EB35254AB2529C:-4F625456:113BE83A96F:-7F97" name="Flex" visibility="runschedule"-->

<TaskDefinition id='#ID#61EB35254AB2529C:-4F625456:113BE83A96F:-7F97' name='Flex'>

<Form name='Flexo' baseContext='variables' objectLocationID='objectName=Flex&amp;isBegin=true&amp;objectPath=14 8;amp;objectType=TaskDefinition'>

<Display class='EditForm'/>

<Field name='processInputs.ses'>

<Derivation>

<ref>:display.session</ref>

</Derivation>

</Field>

</Form>

<Extension>

<WFProcess name='Flex' maxSteps='0'>

<Variable name='ses' value='$(processInputs.ses)' input='true'/>

<Activity id='0' name='Start'>

<Action id='0'>

<Variable name='ses' input='true'/>

<Return from='$(ses)' to='session'/>

</Action>

<Transition to='activity2'/>

<WorkflowEditor x='86' y='105'/>

</Activity>

<Activity id='1' name='activity2'>

<Action id='0'>

<expression>

<block trace='true'>

<print>

<ref>session</ref>

</print>

</block>

</expression>

</Action>

<Transition to='End'/>

<WorkflowEditor x='233' y='273'/>

</Activity>

<Activity id='2' name='End'>

<WorkflowEditor x='356' y='118'/>

</Activity>

</WFProcess>

</Extension>

<MemberObjectGroups>

<ObjectRef type='ObjectGroup' id='#ID#Top' name='Top'/>

</MemberObjectGroups>

<Properties>

<Property name='editorOriginalName' value='Flex'/>

</Properties>

</TaskDefinition>

heregoesthesuna at 2007-7-28 17:52:55 > top of Java-index,Web & Directory Servers,Directory Servers...
# 3

I couldn't exactly make out what u need from the code but I have changed a bit of the code you have sent me, where the user is prompted to enter value of f1 in a form and is set to var1 in the taskdef.

Pasting the sample code below. You don't need to use basecontext as the form is placed in the taskdef itself.

<TaskDefinition name='Flex' l taskType='Workflow' executor='com.waveset.workflow.WorkflowExecutor' suspendable='true' syncControlAllowed='true' execMode='sync' execLimit='0' resultLimit='0' resultOption='delete' visibility='runschedule' progressInterval='0'>

<Form name='Flexo'>

<Display class='EditForm'/>

<Field name='f1'>

<Display class='Text'>

<Property name='title' value='Enter F1'/>

</Display>

</Field>

</Form>

<Extension>

<WFProcess name='Flex' maxSteps='0'>

<Variable name='ses' input='true'/>

<Activity id='0' name='Start'>

<Transition to='activity2'/>

<WorkflowEditor x='86' y='105'/>

</Activity>

<Activity id='1' name='activity2'>

<Action id='0'>

<expression>

<block trace='true'>

<set name='var1'>

<ref>f1</ref>

</set>

<print>

<ref>session</ref>

</print>

</block>

</expression>

</Action>

<Transition to='End'/>

<WorkflowEditor x='233' y='273'/>

</Activity>

<Activity id='2' name='End'>

<WorkflowEditor x='356' y='118'/>

</Activity>

</WFProcess>

</Extension>

<MemberObjectGroups>

<ObjectRef type='ObjectGroup' id='#ID#Top' name='Top'/>

</MemberObjectGroups>

<Properties>

<Property name='editorOriginalName' value='Flex'/>

</Properties>

</TaskDefinition>

Hope this helps,

Thanks,

Swatz.

Swatza at 2007-7-28 17:52:55 > top of Java-index,Web & Directory Servers,Directory Servers...
# 4

Hi!

Thanks for all to you. Your code have helped me. Now I know what's the problem. I've got a object ":display.session" as expansion value in the field form,

and this object always is null when arrives to workflow.

With another type value like could be a string has not problems to pass the value from form to workflow.

is there any problem with objects (:display.session, etc.) when it 's passed from form to workflow?

THANKS, THANKS, THANKS.

heregoesthesuna at 2007-7-28 17:52:55 > top of Java-index,Web & Directory Servers,Directory Servers...
# 5

Hi!

Thanks for all to you. Your code have helped me. Now I know what's the problem. I've got a object ":display.session" as expansion value in the field form,

and this object always is null when arrives to workflow.

With another type value like could be a string has not problems to pass the value from form to workflow.

is there any problem with objects (:display.session, etc.) when it 's passed from form to workflow?

THANKS, THANKS, THANKS.

heregoesthesuna at 2007-7-28 17:52:55 > top of Java-index,Web & Directory Servers,Directory Servers...