Class WorkflowNetExamples

java.lang.Object
jline.examples.java.basic.WorkflowNetExamples

public class WorkflowNetExamples extends Object
Workflow net examples, twins of matlab/examples/basic/wfnet/wfnet_*.m.

The examples cover: - k-soundness checking with witnesses, and the three classic defects - the exact phase-type cycle time of one case, series-parallel or not - block structure, toWorkflow and the two toNetwork targets - shared resources, open and closed streams of cases - the PNML round trip

  • Constructor Details

    • WorkflowNetExamples

      public WorkflowNetExamples()
  • Method Details

    • wfnet_serial

      public static void wfnet_serial()
      Serial workflow net (wfnet_serial.m): i -> Task1 -> p1 -> Task2 -> p2 -> Task3 -> o.

      One case without contention takes Task1 + Task2 + Task3, so its cycle time is hypoexponential with mean 1/1 + 1/0.5 + 1/(2/3) = 4.5. getCycleTime returns that law exactly, and toWorkflow gives a Workflow with the same one.

    • wfnet_and_xor

      public static void wfnet_and_xor()
      AND and XOR blocks (wfnet_and_xor.m).

      split (AND) runs ReviewA ~ Exp(1) and ReviewB ~ Exp(2) in parallel; join (AND) waits for both. A choice (XOR) then runs FastTrack ~ Exp(4) with probability 3/4 or SlowTrack ~ Exp(0.5) with probability 1/4, set by the weights of the immediate transitions toFast and toSlow. Mean cycle time: E[max(A,B)] + 3/4 * 1/4 + 1/4 * 2, with E[max(A,B)] = 1 + 1/2 - 1/3.

    • wfnet_nonsp_sound

      public static void wfnet_nonsp_sound()
      A sound net that is not block-structured (wfnet_nonsp_sound.m).

      split starts A and B in parallel. A enables both C and D; B enables only D, so D waits for A and B while C waits only for A. join waits for C and D. This "N" dependency is not a nesting of series, AND, XOR and loop blocks, so toWorkflow and toNetwork("forkjoin") refuse it, but the net is sound: getCycleTime analyses it exactly and toNetwork("spn") simulates it.

    • wfnet_unsound

      public static void wfnet_unsound()
      Unsound workflow nets (wfnet_unsound.m).

      checkSoundness explores the reachability graph from one token in i and reports why a net is not sound, with a witness marking for each defect.

    • wfnet_resource

      public static void wfnet_resource()
      Tasks sharing a resource (wfnet_resource.m).

      Intake ~ Exp(4) and Approval ~ Exp(4) run in sequence and are both served by one clerk. Cases arrive as a Poisson stream of rate 1, so the clerk is an M/M/1 queue with two job classes and load 1*(1/4 + 1/4) = 0.5: each visit takes 0.25/(1 - 0.5) = 0.5 on average and the mean cycle time is 1.

    • wfnet_closed

      public static void wfnet_closed()
      A fixed number of concurrent cases (wfnet_closed.m).

      Three cases circulate through a serial net whose two tasks share one clerk: as soon as a case completes, a new one starts. That is a closed cyclic network with population 3, which exact MVA solves.

    • wfnet_pnml

      public static void wfnet_pnml() throws IOException
      PNML round trip (wfnet_pnml.m).

      savePNML writes the net as a PNML document with its timing; fromPNML reads it back into a WorkflowNet, finding the source and sink from the arcs.

      Throws:
      IOException
    • main

      public static void main(String[] args) throws Exception
      Throws:
      Exception