
Product
Socket Now Supports pylock.toml Files
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
BPMN is a notation to describe a business process. The implementation and execution of the business process can be done with various technologies. As technologies evolve, the implementation becomes more easier to adopt and maintain. This python module implements some basics BPMN features for cloud to keep the things as simple as possible.
Sample code is as shown below
class Handler():
def on_enter_task(self,**kargs):
logger.info("Entering task")
def on_exit_task(self,**kargs):
logger.info("Exiting task")
def on_enter_task_2(self,**kargs):
logger.info("Entering task task_2")
def on_task_2(self,**kargs):
context = kargs.get("context")
payload = kargs.get("payload")
payload["user"] = True
task_context = kargs.get("task")
task_context.update({
"name1" : "value1"
})
logger.info("Process task task_2")
def on_exit_task_2(self,**kargs):
logger.info("Exiting task task_2")
def on_enter_task_3(self,**kargs):
logger.info("Entering task task_3")
def on_task_3(self,**kargs):
logger.info("Process task task_3")
def on_exit_task_3(self,**kargs):
logger.info("Exiting task task_3")
def on_enter_task_4(self,**kargs):
logger.info("Entering task task_4")
def on_task_4(self,**kargs):
time.sleep(3)
logger.info("Process task task_4")
def on_exit_task_4(self,**kargs):
logger.info("Exiting task task_4")
def on_enter_task_5(self,**kargs):
logger.info("Entering task task_5")
def on_task_5(self,**kargs):
time.sleep(5)
context = kargs.get("context")
context["user"] = True
task_context = kargs.get("task")
task_context.update({
"name1" : "value1"
})
logger.info("Process task task_5")
def on_exit_task_5(self,**kargs):
logger.info("Exiting task task_5")
def on_enter_task_6(self,**kargs):
logger.info("Entering task task_6")
def on_exit_task_6(self,**kargs):
logger.info("Exiting task task_6")
def test_process():
instance = BpmnProcess()
instance.start_process(open("tests/data/test_bpmn.xml","r").read(),Handler())
instance.get_activity_by_name("task_3").complete({"datatoadd":"Valuetoadd"})
instance.get_activity_by_name("task_5").complete({"datatoadd1":"Valuetoadd2"})
The below list of events are currently supported.
These are automated tasks which are pure functions which does desired functionality.
These are user tasks, the main difference between user and service tasks is, user tasks are required to be completed explicity to move the token in the process. Tasks can be completed by using the code as shown below
instance.get_activity_by_name("task_3").complete({"datatoadd":"Valuetoadd"})
Exclusive gateways could be diverging or converging. For diverging gateway, only one path should evaluate to true or first path that gets evaluated to true, will be the path the bpmn process will take. Path's with no conditional expression ( python ) is considered to be 'True'
For converging gateways, atleast one incoming pathways will move the token up the process.
Inclusive gateways again could be diverging or converging. These gateways by definition, will allow more than one pathways to be taken during process execution. All paths whose conditional expression evaluates to true OR doesnt have an expression will be chosen for execution. All paths will be executed in parallel until a blocking task is encountered.
For coverging gateways, the naming convention should be conv_<diverging_pair_name>. The inclusive gateway will await for as many as diverged paths to proceed execution of process.
Parallel gateways will execute all diverging paths, and awaits every converging path in the process.
FAQs
A bpmn framework focused on serverless infrastructure
We found that py-bpmn demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
Security News
Research
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.
Research
Security News
Malicious Ruby gems typosquat Fastlane plugins to steal Telegram bot tokens, messages, and files, exploiting demand after Vietnam’s Telegram ban.