cancel
Showing results for 
Search instead for 
Did you mean: 

Workflow task form

mrgrechkinn
Champ in-the-making
Champ in-the-making
Hello, I have a question about workflow task form. I have a one root type model and a couple child, when I start workflow at first task I choose a model type, and in second task I want show fields related only to specific type.
Example:

My model


  <type name="foo:rootModel">
    <parent>cm:content</parent>
    <properties>
      <property name="foo:id">
        <type>d:int</type>
      </property>
    </properties>
  </type>
  <type name="foo:child1">
    <parent>cm:content</parent>
    <properties>
      <property name="foo:caramba">
        <type>d:text</type>
      </property>
    </properties>
  </type>
  <type name="foo:child2">
    <parent>cm:content</parent>
    <properties>
      <property name="foo:bar">
        <type>d:text</type>
      </property>
    </properties>
  </type>



So, I'm create an node with type specified in start task, and I should fill properties for this node at second task. How I can show fields related to current node

My second task type


  <type name="foowf:secondTask">
    <parent>bpm:activitiOutcomeTask</parent>
    <properties>
      <property name="foowf:id">
        <type>d:int</type>
      </property>
    </properties>
  </type>

  <aspect name="foowf:child1Apect">
    <parent>cm:content</parent>
    <properties>
      <property name="foowf:caramba">
        <type>d:text</type>
      </property>
    </properties>
  </aspect>
  <aspect name="foowf:child2Aspect">
    <parent>cm:content</parent>
    <properties>
      <property name="foowf:bar">
        <type>d:text</type>
      </property>
    </properties>
  </aspect>



I found that on form config if task type doesn't containts a property, it will not show. So I think I can add aspect in runtime to task type but I don't known how to do this.

<stront>How I can show/hide different properties by using one task type?? Or I should create a lot of task types for each node?</strong>
2 REPLIES 2

mitpatoliya
Star Collaborator
Star Collaborator
You need to create a proper workflow model in which you will have to map set of properties with task type. Keep in mind that this is not related to content type your task names from workflow process definition  will be defined inside workflow model.
If you refer any of the out of box workflow related files things will be more clear to you.

mrgrechkinn
Champ in-the-making
Champ in-the-making
What do you mean by talking about "proper workflow model? My point that, how I can use only one form and hide/show optional field in runtime.

For example:

I have two tasks (scriptTask -> userTask), in scriptTask I'm check something and set variable showOptionalFields to "true", how I can display optional fields in userTask?
My point that I have about six type of documents, and user should fill params in user task. Documents have about 3-4 common field and individual fields. I don't what to create a lot of user tasks for each type of document, I want to use on user tasks, and display common fields and individial fields for each type.

Regards,
Eugene