Giter VIP home page Giter VIP logo

dativity's People

Contributors

agentbellnorm avatar mingfang avatar telekid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dativity's Issues

add edge to model like 'action-possible-conditional'

There should be an edge type that describes a relation between data and action that makes an action possible/allowed if a given data is present, and a predicate function is true.

An example where this would be useful is for example in a model of a legal process. The two actions 'release' and 'serve-punishment' would never both be relevant. Only one of them would be applicable depending on the result of a predicate function that takes the data 'verdict'

I think this is an important feature that the library has been missing that really allows you to model logic gateways.

Idea: simple data dsl for process graph creation.

Great work!

Idea, to make the creation of the graph less verbose, a little "data dsl" would work great.

Given:

(def case-model-dsl
    '[
      ;; roles
      applicant is-a role
      system is-a role
      officer is-a role
      ;; actions
      create-case is-a action
      enter-loan-details is-a action
      produce-credit-application-document is-a action
      sign-credit-application-document is-a action
      payout-loan is-a action
      ;; data
      case-id is-a data
      customer-id is-a data
      loan-details is-a data
      credit-application-document is-a data
      applicant-signature is-a data
      officer-signature is-a data
      loan-number is-a data

      ;; actions relationships
      create-case produces customer-id
      create-case produces case-id

      enter-loan-details produces loan-details
      enter-loan-details requires case-id

      produce-credit-application-document produces credit-application-document
      produce-credit-application-document requires loan-details
      produce-credit-application-document requires customer-id

      sign-credit-application-document produces applicant-signature
      sign-credit-application-document produces officer-signature
      sign-credit-application-document requires credit-application-document

      payout-loan produces loan-number
      payout-loan requires applicant-signature
      payout-loan requires officer-signature

      ;; role-action edges
      applicant performs create-case
      applicant performs enter-loan-details
      applicant performs sign-credit-application-document
      officer performs sign-credit-application-document
      system performs payout-loan
      system performs produce-credit-application-document])

we can transform it into code easily. Here is an example using core.match,
but maybe a little parser based on spec could be a better option ( will play with that when i have time ).

disclaimer: first time using core.match ;)

(defn from-dsl
  [model dsl]
    (reduce
      (fn [acc [from _ to :as i]]
        (m/match i
                 [_ :is-a :action] (dativity.define/add-entity-to-model acc (dativity.define/action from))
                 [_ :is-a :data] (dativity.define/add-entity-to-model acc (dativity.define/data from))
                 [_ :is-a :role] (dativity.define/add-entity-to-model acc (dativity.define/role from))
                 [_ :requires _] (dativity.define/add-relationship-to-model acc (dativity.define/action-requires from to))
                 [_ :produces _] (dativity.define/add-relationship-to-model acc (dativity.define/action-produces from to))
                 [_ :performs _] (dativity.define/add-relationship-to-model acc (dativity.define/role-performs from to))
                 :else "todo/look into errors"
                 ))
      model (map vec (partition 3 (map keyword dsl)))))

and used

(from-dsl (dativity.define/empty-case-model) case-model-dsl)

Here is a pic of this approach working in my live editor and visualising it using cytoscape so you can interactively create the graphs.

Screen Shot 2019-06-13 at 11 35 41

I will play also with adding visualization of process progress and adding a UI on top to perform actions etc...

Consider renaming actions-performed-by-role

Lovely work and very clean and understandable code.

May I suggest renaming actions-performed-by-role. I immediately assumed that it would return the actions actually performed by a certain role, as opposed to the actions allowed by a specific role. This especially because of actions-performed which returns all performed actions.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.