Page 1 of 1

Workflow Forms definition

PostPosted:Fri Mar 18, 2011 9:23 am
by luke
Hi everyone
I have question. I created a workflow - Eclipse generated a par file, OpenKM imported it but i don`t know where tu put this
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE workflow-forms PUBLIC "-//OpenKM//DTD Workflow Forms 1.0//EN"
                                "http://www.openkm.com/dtd/workflow-forms-1.0.dtd">
<workflow-forms>
  <workflow-form task="MyTask">
    <input label="Amount" name="amount" />
    <button label="Submit" />
  </workflow-form>
</workflow-forms>
I know that it must be an xml file but where to put it or how to import it to the workflow or OpenKM. Maybe in Eclipse there is such magic section to just paste it but I don`t know where it is. On the wiki there is no such information.
Please Help

Re: Workflow Forms definition

PostPosted:Sat Mar 19, 2011 9:23 am
by jllort
When you generate the par file all is into the par file. This is the page http://wiki.openkm.com/index.php/Eclipse_plugin:_Usage that you must understand

Re: Workflow Forms definition

PostPosted:Mon Mar 21, 2011 8:00 am
by luke
I understand but in the simple form I inserted this:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<process-definition  xmlns="urn:jbpm.org:jpdl-3.2"  name="UserInput">
  <start-state name="start">
    <transition to="PlaceOrder" name="trPlaceOrder"></transition>
  </start-state>
  <task-node name="PlaceOrder">
    <task name="MyTask">
      <assignment actor-id="tazplat"></assignment>
      <controller></controller>
    </task>
    <transition to="CheckAvailability"></transition>
  </task-node>
  <decision name="CheckAvailability" expression="#{(amount>100)?'trNotAvailable':'trAvailable'}">
    <transition to="end" name="trAvailable"></transition>
    <transition to="sendMail" name="trNotAvailable"></transition>
  </decision>
  <mail-node name="sendMail" to="stock@your-domain.com">
    <subject>We need more product</subject>
    <text>There is no product, so we must to buy more units!</text>
    <transition to="end"></transition>
  </mail-node>
  <end-state name="end"></end-state>
</process-definition>
My question is where to put User Input Value.
Just paste it in the end of the workflow definition ? or I had to create another xml file. If I had to create another xml file could tell me how to do it ?

Re: Workflow Forms definition

PostPosted:Tue Mar 29, 2011 6:10 pm
by pavila
The file should be named forms.xml and be located in the same place as processdefinition.xml.

Re: Workflow Forms definition

PostPosted:Wed Mar 30, 2011 3:40 pm
by luke
Pavila You are my hero. :mrgreen: Thank you very much.

Re: Workflow Forms definition

PostPosted:Fri Apr 01, 2011 1:17 pm
by luke
Dear Pavila

I created a workflow everything is ok but when I want to insert a value and click submit I get:


couldn't evaluate expression '#{(amount>100)?'trNotAvailable':'trAvailable'}'

What I could possibly do wrong ?

I am using latest OpenKM distribution.

Re: Workflow Forms definition

PostPosted:Fri Apr 08, 2011 2:06 pm
by pavila
Can you attach the PAR archive here to test it? If can't post, try to include inside a zip

Re: Workflow Forms definition

PostPosted:Wed Apr 27, 2011 12:18 am
by sgastevep
I am new, so I perhaps have done the same thing wrong, but using a fresh install of OpenKM 5.0.4, eclipse Helios with the required jBPM 3 downloaded components... The resulting process and forms xml files look to me just like the ones on the wiki web page, and I also get the error when hitting the submit button:

OKM-015026(setTaskInstanceValues): OKM-015026
couldn't evaluate expression
'#{(amount>100)?'trNotAvailable':'trAvailable'}'

I hope it is not a stupid user error.

Steve

Re: Workflow Forms definition

PostPosted:Wed May 04, 2011 10:06 am
by pavila
As I can see in the log, this is the error:
Code: Select all
Attempt to coerce a value of type "com.openkm.bean.form.Input" to type "java.lang.Long"
The "amount" object is an instance of "com.openkm.bean.form.Input" and should be converted to a more basic type. Try with:
Code: Select all
'#{(amount.value>100)?'trNotAvailable':'trAvailable'}'