1. Create a workitem business object, call it WI
  2. Create a workflow, call it W01
  3. Create two activities, call them A01 and A02
  4. Create a transition from A01 to A02 called A01_to_A02
  5. Create a new rule called get_wf_info; 
    1. Usage general, rule type NonQuery SQL
    2. The body of the rule will be

      DECLARE 
      v_col_Id integer;
      v_col_WF varchar2(255); 
      v_col_activity varchar2(255);
      
      begin
      select col_id, col_workflow, col_activity into v_col_Id, v_col_WF, v_col_activity from tbl_WI where col_instanceId = :instance_id; 
      :id := v_col_id;
      :wf := v_col_WF;
      :activity := v_col_activity;
      
      end;
    3. Click Save
    4. Click on the Parameters tab
      1. Check that id is type integer and behavior output
      2. Check that instance_Id is type text and behavior output
      3. Check that wf is type text and behavior output
  6. Create a new rule called Route_WF; rule usage general and rule type composite
    1. Click on the Parameters tab
      1. Add a parameter called Activity of type text and behavior output
      2. Add a parameter called ID of type integer and behavior output
      3. Add a parameter called Workflow of type text and behavior output
    2. Click on the Composite Rule tab
      1. Drag a Define block into the Begin End block
        1. Set Name to Instance_Id
        2. Set Clr Type to String
      2. Drag a Create Workflow block into Begin End
        1. Set Workflow to W01
        2. Set Activity to A01
        3. Set Owner to yourself
        4. Set Instance ID Map to Instance_Id
      3. Drag an Invoke Rule block into Begin End
        1. Set Data Source to get_WF_info
        2. Set the value of instance_id to Instance_Id
      4. Drag a Send Workflow block into Begin End
        1. Set the send mode to Auto
        2. Set InstanceId to Instance_Id
        3. Set workflow to W01
      5. Drag an Invoke Rule block into Begin End
        1. Set Data Source to get_WF_info
        2. Set instance_id to Instance_Id
        3. Set id to Id
        4. Set wf to Workflow
        5. set activity to Activity
    3. Click Save
  • No labels