-
1. Re: How to start a process with variable from JBPM-Console
swiderski.maciej Jun 1, 2010 7:29 AM (in response to wawan_beta)use form attribute of start activity, exactly the same as for task node.
<start form="start_form.ftl" name="start1">
Once you have that console will open a window with defined form prior to starting the process.
HTH
Maciej
-
2. Re: How to start a process with variable from JBPM-Console
wawan_beta Jun 1, 2010 9:46 AM (in response to swiderski.maciej)thanks for the reply, this works
I have one more question, how to create a variable Date?i have found this code
<input type="text" name="dTEMP"/><br/>
<#assign bTermin = "${dTEMP}"?datetime("yyyy-MM-dd hh:mm a")>but it doesn't work...
-
3. Re: How to start a process with variable from JBPM-Console
swiderski.maciej Jun 1, 2010 12:42 PM (in response to wawan_beta)I am afraid that everything that is transferred from the start form to the process instance will be of type String.
What I could suggest you to do is to use event listeners attached to an end event of start activity to do the required transformation for the variables.
HTH
-
4. Re: How to start a process with variable from JBPM-Console
wawan_beta Jun 2, 2010 4:56 AM (in response to swiderski.maciej)can you please show me an example transformation of the variables
and what is end event of start activity?
<start name="StartEvent_1" form="org/bew/prozess/test.ftl">
<on event="???????">
<event-listener class="org.bew.prozess.Convertor"/>
</on><transition to="ask name"/>
</start>Regards
Wladimir
-
5. Re: How to start a process with variable from JBPM-Console
swiderski.maciej Jun 2, 2010 5:40 AM (in response to wawan_beta)1 of 1 people found this helpfulYou can use something like that (note this is very simple just to illustrate):
public void notify(EventListenerExecution execution) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); try { //fist to the conversion Date date = sdf.parse((String) execution.getVariable("date")); // next replace string with newly created Date instance execution.setVariable("date", date); } catch (ParseException e) { e.printStackTrace(); } }
on you definition you can use end event:
<start name="StartEvent_1" form="org/bew/prozess/test.ftl"> <on event="end"> <event-listener class="org.bew.prozess.Convertor"/> </on> <transition to="ask name"/> </start>
That's it.
HTH
-
6. Re: How to start a process with variable from JBPM-Console
wawan_beta Jun 7, 2010 4:53 AM (in response to swiderski.maciej)thanks for the reply
Regards
Wladimir