Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Please refer to the Find-Primes example before starting with this example.

...

This graph is a little more interesting than the Find-Primes exmaple example since it has two Steps: createSpan and processSpan. createSpan produces Items for the span Item Collection. This in turn trigger the prescription of the processSpan step which writes results to the results Item Collection. The environment reads off these values from the results Item Collection.

...

Next, we need to provide the python implementations for the Steps using the generated templates (as explained in the Find-Primes example ):

Code Block
titleuserPartitionStringApp.py
borderStylesolid
class Application:
  @staticmethod
  def onStart(args, input, singletonTag):
    # TODO fill out the body of the function
    # e.g. operation on output item collections: anItemCollection.put(aTag, aValue)
    # e.g. operation on tag collections: aTagCollection.putTag(aTag)
    if len(args) > 0:
      firstArg = args[0]
      print("py: processing " + firstArg)
      input.put(firstArg, firstArg)
      singletonTag.putTag(firstArg)
    else:
      print("py: usage PartitionStringMain <the_string_to_process>")

  @staticmethod
  def onEnd(results):
    # e.g. operation on input item collections: anItemCollection.get(aTag)
    # e.g. operation on input item collections: anItemCollection.printContents()
    results.printContents()

...